Commit Graph

21679 Commits (641a93f0f226aa1b4e27bc6f1fc36f9fe63a11a0)

Author SHA1 Message Date
Adrian Schmutzler 0130022bae ath79: split base-files into subtargets
While most of the target's contents are split into subtargets, the
base-files are maintained for the target as a whole.

However, OpenWrt already implements a mechanism that will use (and
even prefer) files in the subtargets' directories. This can be
exploited to make several scripts subtarget-specific and thus save
some space (especially helpful for the tiny devices).

The only script remaining in parent base-files is
/etc/hotplug.d/ieee80211/00-wifi-migration, everything else is
moved/split.

Note that this will increase overall code lines, but reduce code
per subtarget.

base-files ipk size reduction:
master (generic)   49135 B
split (generic)    48533 B (- 0.6 kiB)
split (tiny)       43337 B (- 5.7 kiB)
split (nand)       44423 B (- 4.6 kiB)

Tested on TL-WR1043ND v4 (generic) and TL-WR841N v12 (tiny).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Rosen Penev c36ef5970b ramips: ethernet: Replace random_ether_addr with eth_hw_addr_random
eth_hw_addr_random additionally sets addr_assign_type to NET_ADDR_RANDOM.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
5 years ago
Adrian Schmutzler 0b2a2f4380 ipq40xx: add label MAC address for Netgear EX6100v2/EX6150v2
This is based on the EX6150v2, which should be identical to
the EX6100v2:

The device bears two MAC addresses ("MAC 1" and "MAC 2") that
correspond to phy0 and phy1.

The ethernet MAC address (gmac0) is the same as phy0.
As this one is accessible via local-mac-address in gmac0, the
latter is used for label-mac-device.

(Although this is a one-port, gmac1 also has a local-mac-address
assigned. This has the same vendor part as the other addresses,
but completely different data for the device part.)

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler dc7872d8f8 ipq40xx: use DEVICE_VARIANT for Unielec U4019 flash size
If flash size is used as part of a device's title, it should be
specified as DEVICE_VARIANT like for the other devices so far.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 2d2fa2fd2d ath79: fix remaining IMAGE_SIZE issues
This fixes the remaining IMAGE_SIZE issues in ath79 target.
All devices in target have been checked, so together with
previous patches this target should be "clean" afterwards.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4b4856bc53 ath79: fix IMAGE_SIZE for common TP-Link definitions
So far, IMAGE_SIZE is set as follows:
tplink-4m*   3904k  0x3d0000
tplink-8m*   7936k  0x7c0000
tplink-16m* 15872k  0xf80000

However, based on the size of firmware partitions in DTS it should
be:
tplink-4m*   3904k  0x3d0000
tplink-8m*   8000k  0x7d0000
tplink-16m* 16192k  0xfd0000

All (!) 8m*/16m* devices actually follow the latter scheme, which
is also consistent in terms of left free space for other
partitions. Thus, fix it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 3202ee0fc6 ath79: tidy up and fix IMAGE_SIZE for Ubiquiti devices
This addresses IMAGE_SIZE inconsistencies in generic_ubnt.mk by:

1. (cosmetical) Move IMAGE_SIZE out of top definition ("ubnt"),
   since despite two all subdefinition have different values.
2. (change) Fix IMAGE_SIZE for ubnt-xm and ubnt-bz (7552k->7488k).
3. (cosmetical) Move IMAGE_SIZE of ubnt-wa devices to parent node
   since all have same size (it is defined in parent DTSI ...).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz 3f275f2ac8 ath79: wnr1000v2: fix image header information
Factory image generated for Netgear WNR1000 v2 has incorrect device
and hardware ID information in header due to missing makefile
variables. This fix adds them to device section.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
André Valentin 99835e0999 ath79: add support for ZyXEL NBG6716
Attention: Kernel partition size has been enlarged to 4MB.
To switch, you must update to latest ar71xx-nand snapshort and flash the
sysupgrade-4M-Kernel.bin:

zcat openwrt-ath79-nand-zyxel_nbg6716-squashfs-sysupgrade-4M-Kernel.bin | mtd -r -e ubi write - firmware; reboot -f
You will end up with a fresh config if you do not inject config into the image.

The NBG6716 may come with 128MB or 256MB NAND. ar71xx was able to use all, but
ath79 can only use the first 128MB. Therefore the complete NAND needs to be
overwritten. If not, the old UBI may make problems and lead to reboot loop.

Access the real u-boot shell:
ZyXEL uses a proprietary loader/shell on top of u-boot: "ZyXEL zloader v2.02"
When the device is starting up, the user can enter the the loader shell
by simply pressing a key within the 3 seconds once the following string
appears on the serial console:

|   Hit any key to stop autoboot:  3

The user is then dropped to a locked shell.

|NBG6716> HELP
|ATEN    x[,y]     set BootExtension Debug Flag (y=password)
|ATSE    x         show the seed of password generator
|ATSH              dump manufacturer related data in ROM
|ATRT    [x,y,z,u] RAM read/write test (x=level, y=start addr, z=end addr, u=iterations)
|ATGO              boot up whole system
|ATUR    x         upgrade RAS image (filename)
|NBG6716>

In order to escape/unlock a password challenge has to be passed.
Note: the value is dynamic! you have to calculate your own!

First use ATSE $MODELNAME (MODELNAME is the hostname in u-boot env)
to get the challange value/seed.

|NBG6716> ATSE NBG6716
|012345678901

This seed/value can be converted to the password with the help of this
bash script (Thanks to http://www.adslayuda.com/Zyxel650-9.html authors):

- tool.sh -
ror32() {
  echo $(( ($1 >> $2) | (($1 << (32 - $2) & (2**32-1)) ) ))
}
v="0x$1"
a="0x${v:2:6}"
b=$(( $a + 0x10F0A563))
c=$(( 0x${v:12:14} & 7 ))
p=$(( $(ror32 $b $c) ^ $a ))
printf "ATEN 1,%X\n" $p
- end of tool.sh -

|# bash ./tool.sh 012345678901
|
|ATEN 1,879C711

copy and paste the result into the shell to unlock zloader.

|NBG6716> ATEN 1,0046B0017430

If the entered code was correct the shell will change to
use the ATGU command to enter the real u-boot shell.

|NBG6716> ATGU
|NBG6716#

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years ago
André Valentin 353ecbbf64 ar71xx: fix bug in NBG6716 kernelpacking, add firmware partition
-Fix the kernel image generation (more robust)
-Add a firmware partition table allowing easy upgrade to ath79

Signed-off-by: André Valentin <avalentin@marcant.net>
5 years ago
Paul Fertser 522d5ff428 ramips: add support for Xiaomi Mi Wi-Fi Router 3G v2
- CMIIT ID: 2019AP2581
- SoC:      MediaTek MT7621
- Flash:    16MiB NOR SPI (GigaDevice GD25Q128B)
- RAM:      128MiB DDR3 (ESMT M15T1G1664A)
- Serial:   As marked on PCB, 3V3 logic, baudrate is 115200, 8n1
- Ethernet: 3x 10/100/1000 Mbps (switched, 2xLAN + WAN)
- WIFI0:    MT7603E 2.4GHz 802.11b/g/n
- WIFI1:    MT7612E 5GHz 802.11ac
- Antennas: 4x external (2 per radio), non-detachable
- LEDs:     Programmable "power" LED (two-coloured, yellow/blue)
            Non-programmable "internet" LED (shows WAN activity)
- Buttons:  Reset

INSTALLATION:

Bootloader won't accept any serial input unless "boot_wait" u-boot
environment variable is changed to "on". Vendor firmware (looks like
an illegal OpenWrt fork) won't accept any serial input unless
"uart_en" is set to "1". Tricks to force u-boot to use default
environment do not help as it's restricted in the same way.

With bootloader unlocked the easiest way would be to TFTP the
sysupgrade image or to sysupgrade after loading an initramfs one.

For porting the flash contents were changed externally with an SPI
programmer (after lifting Vcc flash IC pin away from the PCB).

Forum thread [0] indicates that this device is identical to "Xiaomi Mi
Router 4A Gigabit Edition".

[0] https://forum.openwrt.org/t/xiaomi-mi-router-4a-gigabit-edition-r4ag-r4a-gigabit-fully-supported-but-requires-overwriting-spi-flash-with-programmer/36685

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
5 years ago
Tim Harvey d3d06f1500 octeontx: fix thunderx BGX underflow irq name
request_irq requires irq names to be static/allocated and not on the stack

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
5 years ago
Adrian Schmutzler 1abb473cea ramips: remove phy0tpt trigger from RT-AC65P/RT-AC85P power LED
This patch removes a phy0tpt trigger from the power LED, which
seems to have been added by mistake.

WiFi LEDs using phy0radio and phy1radio triggers are present and
used correctly.

Cc: Birger Koblitz <mail@birger-koblitz.de>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler b6d53f1d02 ramips: remove redundant mtd-eeprom in mt76x8 DTS files
In mt7628an.dtsi, calibration data for wmac is already defined:
mediatek,mtd-eeprom = <&factory 0x0>;

Thus, this patch removes redundant entries of this property in
derived DTS files.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 547720fb48 ramips: remove redundant mtd-mac-address for WiFi
When caldata locations are defined with mediatek,mtd-eeprom the
MAC address is automatically read from offset +4. Thus, specifying
that location explicitly is redundant.

This patch removes those redundant definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Jeff Kletsky b9d58f7e06 kernel: mtd: spinand: Backport chip definitions
generic: Add/rename patches for upstream consistency

ipq40xx: generic-level patch replaces same-source patches-4.19/
         082-v4.20-mtd-spinand-winbond-Add-support-for-W25N01GV.patch

The SPI-NAND framework from Linux uses common driver code that is then
"tuned" by a tiny struct of chip-specific data that describes
available commands, timing, and layout (data and OOB data). Several
manufacturers and chips have been added since 4.19, several of which
are used in devices already supported by OpenWrt (typically with no or
"legacy" access to their NAND memory). This commit catches up the
supported-chip definitions through Linux 5.2-rc6 and linux/next.

The driver is only compiled for platforms with CONFIG_MTD_SPI_NAND=y.
This presently includes ipq40xx and pistachio, with the addition of
ath79-nand in these commits (and not ath79-generic or ath79-tiny).

Upstream patches refreshed against 4.19.75

Build-tested-on: ipq40xx
Run-tested-on: ath79-nand

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 18848312c5 ath79: Refactor GL.iNet GL-AR300M-series generic.mk
Rework DEVICE_VENDOR, DEVICE_MODEL, and DEVICE_VARIANT
for the GL-AR300M series on the ath79-generic target.

Changes GL-AR300M-Lite to the current form with
DEVICE_VARIANT := Lite (board name is unchanged)

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 1f748df085 ath79: GL-AR750S: Add I2C Support
The GL-AR750S has an internal header for I2C.

Provide DTS definitions for the i2c-gpio driver.

The I2C drivers; kmod-i2c-core, kmod-i2c-gpio
consume ~20 kB of flash and can be loaded as modules,

Default clock measured ~11.2 ms period, ~89 kHz

The board has well-labeled (unpopulated) headers for serial and I2C
along the front edge of the board (the edge with the LEDs). Looking
from the top, rear of the unit (behind Ethernet jacks)

  -------------------------------------------
       5G_LED        2G_LED      PWR_LED

                 O O O O O O O

                 3 S S G T R G
                 V C D N X X N
                 3 L A D     D

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Jeff Kletsky 736d16baad ath79: GL-AR300M series: Add I2C Support
The GL-AR300M series have an internal header for I2C.

Provide DTS definitions for the i2c-gpio driver.

The I2C drivers; kmod-i2c-core, kmod-i2c-gpio
consume ~20 kB of flash and can be loaded as modules,

Default clock measured ~11.4 ms period, ~88 kHz

The board has two sets of (unpopulated) headers.  While facing the
back of the board (looking into the Ethernet jacks), and looking from
the top, the one on the left edge of the baord with four holes is the
I2C header. It appears to be labeled J8 on "GL-AR300M-V1.4.0" boards.

    | (Patch antenna)
    |
    |
    |  O   GND
    |  O   SDA / GPIO 17
    |  O   SCL / GPIO 16
    |  ⊡   3V3 (square land)
    |
    | (Ethernet jacks)

https://docs.gl-inet.com/en/3/hardware/ar300m/#pcb-pinout states
"Note: I2C is not working in some early version of the router."

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
5 years ago
Gabor Varga 7c5f712e4f ramips: add support for Asus RT-AC65P
The Asus RT-AC65P router is identical with the RT-AC85P, but better to make separate images for it.

On both routers the installation can be done also via SSH:

Note: The user/password for SSH is identical with the one used in the
Web-interface.

1. Complete the initial setup wizard.
2. Activate SSH under "Administration" -> "System".
3. Transfer the OpenWrt factory image via scp:
 > scp openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin admin@192.168.50.1:/tmp
4. Connect via SSH to the router.
 > ssh admin@192.168.50.1
5. Write the OpenWrt image to flash.
 > mtd-write -i
/tmp/openwrt-ramips-mt7621-asus_rt-ac65p-squashfs-factory.bin -d linux
6. Reboot the router
 > reboot

Changelog:

v3: removed [] from filename, rebased to latest master
v2: Rebased to latest master
v1: Initial release

Signed-off-by: Gabor Varga <vargagab@gmail.com>
5 years ago
Andreas Ziegler 2bc7c519dc ar71xx: add model detection for UniFi AC-LR
This commit adds correct model detection for UniFi
AC-LR. Previously, said device was incorrectly detected
as UniFi-AC-LITE/MESH.

The Information about the device is stored at 0xC in the EEPROM
partition. It corresponds to the sysid in /etc/board.info of the
Ubiquiti stock firmware.

Signed-off-by: Andreas Ziegler <dev@andreas-ziegler.de>
[adjust naming style of target to existing ones]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 7f187229a8 ipq40xx: add support for AVM FRITZ!Repeater 1200
Hardware
--------
SoC:   Qualcomm IPQ4019
RAM:   256M DDR3
FLASH: 128M NAND
WiFi:  2T2R IPQ4019 bgn
       2T2R IPQ4019 a/n/ac
ETH:   Atheros AR8033 RGMII PHY
BTN:   1x Connect (WPS)
LED:   Power (green/red/yellow)

Installation
------------

1. Grab the uboot for the Device from the 'u-boot-fritz1200'
   subdirectory. Place it in the same directory as the 'eva_ramboot.py'
   script. It is located in the 'scripts/flashing' subdirectory of the
   OpenWRT tree.

2. Assign yourself the IP address 192.168.178.10/24. Connect your
   Computer to one of the boxes LAN ports.

3. Connect Power to the Box. As soon as the LAN port of your computer
   shows link, load the U-Boot to the box using following command.

   > ./eva_ramboot.py --offset 0x85000000 192.168.178.1 uboot-fritz1200.bin

4. The U-Boot will now start. Now assign yourself the IP address
   192.168.1.70/24. Copy the OpenWRT initramfs (!) image to a TFTP
   server root directory and rename it to 'FRITZ1200.bin'.

5. The Box will now boot OpenWRT from RAM. This can take up to two
   minutes.

6. Copy the U-Boot and the OpenWRT sysupgrade (!) image to the Box using
   scp. SSH into the Box and first write the Bootloader to both previous
   kernel partitions.

   > mtd write /path/to/uboot-fritz1200.bin uboot0
   > mtd write /path/to/uboot-fritz1200.bin uboot1

7. Remove the AVM filesystem partitions to make room for our kernel +
   rootfs + overlayfs.

   > ubirmvol /dev/ubi0 --name=avm_filesys_0
   > ubirmvol /dev/ubi0 --name=avm_filesys_1

8. Flash OpenWRT peristently using sysupgrade.

   > sysupgrade -n /path/to/openwrt-sysupgrade.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 6fd9eeeeb2 ipq40xx: add missing backslash in 11-ath10k-caldata
This adds a missing backslash in the caldata-extraction script. Without
this fix, caldata extraction fails for every device.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
David Bauer 7be79a3ab2 ipq40xx: fix ethernet probe abort on missing phy-reset
This commit completely fixes the abortion of the ipq40xx ethernet driver
probe in case no phy-reset is defined.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Moritz Warning d263883796 brcm63xx: split up DEVICE_TITLE
DEVICE_TITLE is split up into DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT
Uses DEVICE_ALT* variables for alternative vendor/retailer names.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Jonas Gorski 4f86397022 brcm63xx: fix build with GCC 8.3
Fixes the following build error when building when using GCC 8.3:

In file included from ./include/linux/string.h:19,
                 from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/mips/include/asm/processor.h:15,
                 from ./arch/mips/include/asm/thread_info.h:16,
                 from ./include/linux/thread_info.h:38,
                 from ./include/asm-generic/preempt.h:5,
                 from ./arch/mips/include/generated/asm/preempt.h:1,
                 from ./include/linux/preempt.h:81,
                 from ./include/linux/spinlock.h:51,
                 from ./include/linux/mmzone.h:8,
                 from ./include/linux/bootmem.h:8,
                 from arch/mips/bcm63xx/prom.c:10:
arch/mips/bcm63xx/prom.c: In function 'prom_init':
./arch/mips/include/asm/string.h:162:11: error: '__builtin_memcpy' forming offset [2, 32] is out of the bounds [0, 1] of object 'bmips_smp_movevec' with type 'char' [-Werror=array-bounds]
   __ret = __builtin_memcpy((dst), (src), __len); \
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/bcm63xx/prom.c:97:3: note: in expansion of macro 'memcpy'
   memcpy((void *)0xa0000200, &bmips_smp_movevec, 0x20);
   ^~~~~~
In file included from arch/mips/bcm63xx/prom.c:14:
./arch/mips/include/asm/bmips.h:80:13: note: 'bmips_smp_movevec' declared here
 extern char bmips_smp_movevec;

Reported-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
5 years ago
Adrian Schmutzler fd1d03f853 ramips: fix LAN/WAN MAC addresses of Xiaomi MiWiFi Mini board
Based on stock firmware tests, both LAN and WAN ports use the
MAC address from 0x28 on factory partition.

In OpenWrt, this one is already set in DTS. This patch removes the
local bit set in 02_network previously, and adjusts LAN/WAN
addresses as on stock firmware.

Note that in tests we found a MAC address in 0x2e that is the one
in 0x28 plus 1. Since stock firmware does not use it though, we
do not use it either.

Thanks to Chih-Wei Chen for testing this on his device.

ref: https://github.com/openwrt/openwrt/pull/2497

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
John Crispin 8285af1928 ipq40xx: fix optional gpio-reset
If a gpio reset pin was not defined we should not bog out.

Signed-off-by: John Crispin <john@phrozen.org>
5 years ago
Adrian Schmutzler c79b796280 ar71xx: improve support for TP-Link CPE510 v2
This fixes commit bae927c551 ("ar71xx: add support for TP-LINK CPE510
V2.0") where the support for this device wasn't optimal.

Device support for the CPE510v2 so far has been a hack to enable
flashing with CPE510v1 images. Those even have different hardware (e.g.
additional ethernet port).

With this patch, we provide proper support for this device in ar71xx.

Installation:
- Flash factory image through stock firmware WEB UI or through TFTP
- To get to TFTP recovery just hold reset button while powering on
  for around 4-5 seconds and release.
- Rename factory image to recovery.bin
- Stock TFTP server IP: 192.168.0.100
- Stock device TFTP address: 192.168.0.254

Fixes: bae927c551 ("ar71xx: add support for TP-LINK CPE510 V2.0")
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[Rebased onto revert commit, changed comments in mach-cpe510.c,
changed commit title and description, fixed eth0 MAC address,
removed eth1 initialization]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[squashed revert, added fixes tag]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler e4155bcc45 ramips: fix TARGET_DEVICES after UniElec rename
Device node names were updated, but updating TARGET_DEVICES
was overlooked.

Fixes: 4408723d42 ("ramips: remove RAM size from device name
for UniElec devices")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 4408723d42 ramips: remove RAM size from device name for UniElec devices
UniElec devices are the last ones in ramips target still having
the RAM size in device name although RAM size is auto-detected.

Remove this from device name, compatible, etc., as it's not
required and might be misleading to users and developers adding
device support copying those devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Tomasz Maciej Nowak cc5256a8bf ath79: base-files: disable sysupgrade for routerstations and ja76pf2
Previous commit 0cc87b3 "ath79: image: disable sysupgrade images for
routerstations and ja76pf2" doesn't remedy completely the posibility of
bricking the device, since user could try to downgrade with an older
image. Therefore disable sysupgrade code for these boards with a small
note.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Adrian Schmutzler 8c36fd3105 ath79: apply alphabetical sorting to entries in 10_fix_wifi_mac
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 244745d7fc ath79: remove empty default case in 10_fix_wifi_mac
This removes a useless empty default case.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 44da2e0344 ath79: fix whitespaces in 10_fix_wifi_mac
This converts leading whitespaces to tabs and removes a double
newline at the end of the file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 556ff09875 ramips/mt762x: convert devices to interrupt-driven gpio-keys
This converts all remaining devices to use interrupt-driven
gpio-keys compatible instead of gpio-keys-polled.
The poll-interval is removed.

While at it, add/remove newlines in keys and leds node where
necessary.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 53e6cc7a81 ath79: add LED migration for several Archer Cxx devices
Several Archer Cxx devices were using board-specific LED names in
ar71xx, which were changed to "tp-link:*" in ath79.

This patch adds migration for them.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 6b0eb84336 ath79: use board name in LED migrations
Several devices added to LED migration script will just have their
(old) board name converted to tp-link.

By using a variable for this, the amount of code in the migration
script can be reduced and the chance for typos is reduced.

This patch also introduces the marker for beginning of a pattern
"^" to the regex, so the match is more specific.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler e816c50993 ramips: fix whitespace issues in DTS files
This is the result of grepping/searching for several common
whitespace issues like double empty lines, leading spaces, etc.

This patch fixes them for the ramips target.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler f473ce6f23 ath79: fix SUPPORTED_DEVICES for ubnt_nanostation-m
The ar71xx images for the Ubiquiti NanoStation M (XM) devices use
"nanostation-m" as board name, but the ath79 images are only
compatible with the "nano-m" board name, so sysupgrade complains.

By changing this additional supported device, sysupgrade smoothly
upgrades from ar71xx to ath79.

Ref: openwrt#2418

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Adrian Schmutzler 86a1f52617 lantiq: modify ath9k caldata extraction to reuse caldata.sh
In lantiq, ath9k caldata extraction is implemented to work in two
alternate "modes", the standard one and another one with swapped
byte pairs.

This rearranges the functions so "standard" use is based on the
caldata.sh library, while only a single local function is required
for the special case.

Note that while the parameter for switching between normal and swab
is removed, the size of the caldata is added to the function calls
to stay consistent.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz 380cf82f99 ar71xx: WNDR4300: fix WAN LED behaviour
Change WAN LED behaviour to be consistent with other Netgear
routers running OpenWrt. Instead of link speed, use amber colour
to indicate link status. Green LED should be used when Internet
connection is up and running.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz 77e14181d9 ar71xx: WNDR4300: use standard labels for buttons
GPIO key labels have been changed to standard ones (rfkill, reset, wps).
It does not affect button functionality.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Adrian Schmutzler 6b53033783 ath79: fix patching ath9k MAC address for MyNet WiFi Range Extender
The code line patching ath9k MAC address for this device contains
a wrong number of arguments including an unset "$mac", which
looks like a typo or copy/paste mistake.

This has been introduced already in the device support commit
745dee11ac ("ath79: add support for WD My Net Wi-Fi Range
Extender").

This patch just removes the "$mac" argument, leaving a formally
valid line. (No on-device test has been performed.)

Cc: Christian Lamparter <chunkeey@gmail.com>

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Michal Cieslakiewicz 09f46c6b54 ath79: add support for Netgear WNR1000 v2
This patch adds ath79 support for Netgear WNR1000v2.
Router was previously supported by ar71xx target only.
Note: this is a 4_32 device with limited upgrade capabilities.

Specification
=============
  * Description: Netgear WNR1000 v2
  * Loader: U-boot
  * SOC: Atheros AR7240 (340 MHz)
  * RAM: 32 MiB
  * Flash: 4 MiB (SPI NOR)
	- U-boot binary: 256 KiB
	- U-boot environment: 64 KiB
	- Firmware: 3712 KiB
	- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9285)
  * USB: no
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN (blue)
	- 4 x LAN (amber/green)
	- WPS (green)
  * UART: 4-pin connector JP2, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr1000-v2=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz 12719ce37a ath79: add support for Netgear WNR2000 v3
This patch adds ath79 support for Netgear WNR2000v3.
Router was previously supported by ar71xx target only.
Note: this is a 4_32 device with limited upgrade capabilities.

Specification
=============
  * Description: Netgear WNR2000 v3
  * Loader: U-boot
  * SOC: Atheros AR7241 (360 MHz)
  * RAM: 32 MiB
  * Flash: 4 MiB (SPI NOR)
	- U-boot binary: 256 KiB
	- U-boot environment: 64 KiB
	- Firmware: 3712 KiB
	- ART: 64 KiB
  * Ethernet: 4 x 10/100 LAN + 1 x 10/100 WAN
  * Wireless: 2.4 GHz b/g/n (Atheros AR9287)
  * USB: no
  * Buttons:
	- Reset
	- WiFi (rfkill)
	- WPS
  * LEDs:
	- Power (amber/green)
	- WAN (amber/green)
	- WLAN (blue)
	- 4 x LAN (amber/green)
	- WPS (green)
  * UART: 4-pin connector JP1, 3.3V (Vcc, TX, RX, GND), 115200 8N1
  * Power supply: DC 12V 1A
  * MAC addresses: LAN on case label, WAN +1, WLAN +2

Installation
============
  * TFTP recovery
  * TFTP via U-boot prompt
  * sysupgrade
  * Web interface

Test build configuration
========================
CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_tiny=y
CONFIG_TARGET_ath79_tiny_DEVICE_netgear_wnr2000-v3=y
CONFIG_ALL_KMODS=y
CONFIG_DEVEL=y
CONFIG_CCACHE=y
CONFIG_COLLECT_KERNEL_DEBUG=y
CONFIG_IMAGEOPT=y
CONFIG_KERNEL_DEBUG_INFO=y
CONFIG_KERNEL_DEBUG_KERNEL=y

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz d74324e407 ath79: WNR612v2: improve device support
This patch improves ath79 support for Netgear WNR612v2.
Router functionality becomes identical to ar71xx version.

Changes include:
* software control over LAN LEDs via sysfs
* correct MAC addresses for network interfaces
* correct image size in device definition
* dts: 'keys' renamed to 'ath9k-keys'
* dts: 'label-mac-device' set to eth1 (LAN)
* dts: formatting adjustments

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Michal Cieslakiewicz 69df7eb73d ath79: add LAN LEDs control bits for AR724x GPIO function pinmux
Currently AR724x pinmux for register 0x18040028 controls only JTAG disable bit.
This patch adds new DTS settings to control LAN LEDs and CLKs that allow
full software control over these diodes - exactly the same is done by ar71xx
target in device setup phase for many routers (WNR2000v3 for example).

'switch_led_disable_pins' clears AR724X_GPIO_FUNC_ETH_SWITCH_LED[0-4]_EN bits.
'clks_disable_pins' clears AR724X_GPIO_FUNC_CLK_OBS[1-5]_EN and
AR724X_GPIO_FUNC_GE0_MII_CLK_EN bits. These all should be used together, along
with 'jtag_disable_pins', to allow OS to control all GPIO-connected LEDs and
buttons on device.

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
5 years ago
Tomasz Maciej Nowak 1bc921f419 ath79: add support for Sitecom WLR-7100
Sitecom WLR-7100 v1 002 (marketed as X7 AC1200) is a dual band wireless
router.

Specification
SoC: Atheros AR1022
RAM: 64 MB DDR2
Flash: 8 MB SPI NOR
WIFI: 2.4 GHz 2T2R integrated
      5 GHz 2T2R QCA9882 integrated (connected to PCIe lane)
Ethernet: 5x 10/100/1000 Mbps QCA8337N
USB: 1x 2.0
LEDS: 4x GPIO controlled, 5x switch
Buttons: 2x GPIO controlled
UART: row of 4 unpopulated holes near USB port, starting count from
      white triangle on PCB
      1. VCC 3.3V, 2. GND, 3. TX, 4. RX
      baud: 115200, parity: none, flow control: none

Installation
1. Connect to one of LAN (yellow) ethernet ports,
2. Open router configuration interface,
3. Go to Toolbox > Firmware,
4. Browse for OpenWrt factory image with dlf extension and hit Apply,
5. Wait few minutes, after the Power LED will stop blinking, the router
   is ready for configuration.

Known issues
5GHz LED doesn't work

Additional information
When TX line on UART is connected, and board is switched on from power
off state, the DDR memory training may fail.
If connected to UART, when prompted for number on boot, one can enter
number 4 to open bootloader (U-Boot) command line.
OEM firmware shell password is: SitecomSenao
useful for creating backup of original firmware.
There is also another revision of this device (v1 001), which may or may
not work with introduced images.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Kristian Evensen 6f6c00cfc9 ipq40xx: Add support for Unielec U4019
This commit adds support for the 32MB storage/512MB RAM version of the U4019
IPQ4019-based board from Unielec. The board has the following specifications:

* Qualcomm IPQ4019 (running at 717MHz)
* 512MB DDR3 RAM (optional 256MB/1GB)
* 32MB SPI NOR (optional 8/16MB or NAND)
* Five gigabit ports (Qualcomm QCA8075)
* 1x 2.4 GHz wifi (QCA4019 hw1.0)
* 1x 5 Ghz wifi (QCA4019 hw1.0)
* 1x mini-PCIe slot (only USB-pins connected)
* 1x SIM slot (mini-SIM)
* 1x USB2.0 port
* 1x button
* 1x controllable LED
* 1x micro SD-card reader

Working:
* Ethernet
* Wifi
* USB-port
* mini-PCIe slot + SIM slot
* Button
* Sysupgrade

Not working:
* SD card slot (no upstream support)

Installation instructions:

In order to install OpenWRT on the U4019, you need to go via the
initramfs-image. The installation steps are as follows:

* Connect to board via serial (header exposed and clearly marked).
* Interrupt bootloader by pressing a button.
* Copy the initramfs-image to your tftp folder, call the file C0A80079.img.
* Give the network interface connected to the U4019 the address
192.168.0.156/24.
* Start your tftp-server and run tftpboot on the board.
* Run bootm when the file has been transferred, to boot OpenWRT.
* Once OpenWRT has booted, copy the sysupgrade-image to the device and run
sysupgrade to install OpenWRT on the U4019.

Notes:

- Since IPQ4019 has been moved to 4.19, I have not added support for kernel
4.14.

- There is a bug with hardware encryption on IPQ4019, causing poor performance
with TCP and ipsec (see for example FS#2355). In order to improve performance,
I have disabled hardware encryption in the DTS. We can enable hw. enc. once/if
bug is fixed.

- In order for Ethernet to work, the phy has to be reset by setting gpio 47
low/high. Adding support for phy reset via gpio required patching the
mdio-driver, and the code added comes from the vendor driver. I do not know if
patching the driver is an acceptable approach or not.

v1->v2:
* Do not use wildcard as identifier in the board.d-scripts (thanks
Adrian Schmutzler).

Signed-off-by: Kristian Evensen <kristian.evensen@gmail.com>
5 years ago