Commit Graph

268 Commits

Author SHA1 Message Date
Michael Pratt 6c98edaae2 ath79: add support for Senao Engenius EAP600
FCC ID: A8J-EAP600

Engenius EAP600 is a wireless access point with 1 gigabit ethernet port,
dual-band wireless, external ethernet switch, 4 internal antennas
and 802.3af PoE.

Specification:

  - AR9344 SOC			(5 GHz, 2x2, WMAC)
  - AR9382 WLAN			(2.4 GHz, 2x2, PCIe on-board)
  - AR8035-A switch		(GbE with 802.3af PoE)
  - 40 MHz reference clock
  - 16 MB FLASH			MX25L12845EMI-10G
  - 2x 64 MB RAM		NT5TU32M16DG
  - UART at H1			(populated)
  - 5 LEDs, 1 button		(power, eth, 2.4 GHz, 5 GHz, wps) (reset)
  - 4 internal antennas

MAC addresses:

  MAC addresses are labeled MAC1 and MAC2
  The MAC address in flash is not on the label
  The OEM software reports these MACs for the ifconfig

  eth0	MAC 1	*:5e	---
  phy1	MAC 2	*:5f	---	(2.4 GHz)
  phy0	-----	*:60	art 0x0	(5 GHz)

Installation:

  2 ways to flash factory.bin from OEM:

  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    Navigate to "Upgrade Firmware" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fdf0000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions
  otherwise, uboot-env can be used to make uboot load the failsafe image

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt

  ssh into openwrt and run
  `fw_setenv rootfs_checksum 0`
  reboot, wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

Format of OEM firmware image:

  The OEM software of EAP600 is a heavily modified version
  of Openwrt Kamikaze. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-senao-eap600-uImage-lzma.bin
    openwrt-senao-eap600-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

  The OEM upgrade script is at /etc/fwupgrade.sh

  Later models in the EAP series likely have a different platform
  and the upgrade and image verification process differs.

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin upgrade procedure would
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035-A switch between
  the SOC and the ethernet PHY chips.

  For AR934x series, the PLL register for GMAC0
  can be seen in the DTSI as 0x2c.
  Therefore the PLL register can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x1805002c 1`.

  Unfortunately uboot did not have the best values
  so they were taken from other similar DTS files.

Tested from master, all link speeds functional

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2020-12-25 10:38:13 +01:00
Michael Pratt 4a55ef639d ath79: add support for Senao Engenius ECB600
FCC ID: A8J-ECB600

Engenius ECB600 is a wireless access point with 1 gigabit PoE ethernet port,
dual-band wireless, external ethernet switch, and 4 external antennas.

Specification:

  - AR9344 SOC			(5 GHz, 2x2, WMAC)
  - AR9382 WLAN			(2.4 GHz, 2x2, PCIe on-board)
  - AR8035-A switch		(GbE with 802.3af PoE)
  - 40 MHz reference clock
  - 16 MB FLASH			MX25L12845EMI-10G
  - 2x 64 MB RAM		NT5TU32M16DG
  - UART at H1			(populated)
  - 4 LEDs, 1 button		(power, eth, 2.4 GHz, 5 GHz) (reset)
  - 4 external antennas

MAC addresses:

  MAC addresses are labeled MAC1 and MAC2
  The MAC address in flash is not on the label
  The OEM software reports these MACs for the ifconfig

  phy1	MAC 1	*:52	---	(2.4 GHz)
  phy0	MAC 2	*:53	---	(5 GHz)
  eth0	-----	*:54	art 0x0

Installation:

  2 ways to flash factory.bin from OEM:

  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    Navigate to "Upgrade Firmware" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fdf0000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions
  otherwise, uboot-env can be used to make uboot load the failsafe image

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt

  ssh into openwrt and run
  `fw_setenv rootfs_checksum 0`
  reboot, wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

Format of OEM firmware image:

  The OEM software of ECB600 is a heavily modified version
  of Openwrt Kamikaze. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-senao-ecb600-uImage-lzma.bin
    openwrt-senao-ecb600-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

  The OEM upgrade script is at /etc/fwupgrade.sh

  Later models in the ECB series likely have a different platform
  and the upgrade and image verification process differs.

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin upgrade procedure would
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8035-A switch between
  the SOC and the ethernet PHY chips.

  For AR934x series, the PLL register for GMAC0
  can be seen in the DTSI as 0x2c.
  Therefore the PLL register can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x1805002c 1`.

  Unfortunately uboot did not have the best values
  so they were taken from other similar DTS files.

Tested from master, all link speeds functional

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2020-12-25 10:38:13 +01:00
Sven Wegener 57e6f3ae65 ath79: update image command for Plasma Cloud PA300
Commit 5fc28ef479 ("ath79: Add support for Plasma Cloud PA300")
added the IMAGE/sysupgrade.bin/squashfs definition, which leaks into
other devices, resulting in sysupgrade.bin images that are actually
tarballs and do not boot when directly written to flash.

We can use the normal sysupgrade.bin command variable for this device.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
[fix format, spelling]
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-12-25 01:57:01 +01:00
Michael Pratt 4d0c442a0a ath79: expand factory.bin support for some Senao Engenius boards
Newer EnGenius software that still uses the tar.gz platform
  instead of the custom header requires more checks for upgrading,
  but their script includes a way to skip them...
  the existence of a file in the tar.gz called failsafe.bin

  Their upgrade script has these lines:

  \#pass check when upload with full image file
  [ "${errcode}" -eq "1" ] && [ -f failsafe.bin ] && errcode="0"

  This overrides the script's "errcode" variable
  which can be set if any of the following actions/checks fail:

  - untarring of the upload

  - magic number for kernel: "2705"

  - magic num for rootfs: "7371" or "6873"

  - md5sums for each file in the format
	filename:md5

  - existence of a file matching FWINFO*
	that it has boardname in the name somewhere (grep)
	that the 4th field of separator "-" is at least 3 (version)

  Otherwise we would need to generate md5sums in this strange format
  and touch a file with specific requirements in the name.

  This does not effect boards where the advanced checks do not apply.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
[fixed SoB to match From:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-12-22 19:11:50 +01:00
Michael Pratt fe2f53f21c ath79: add support for Senao Engenius EnStationAC v1
FCC ID: A8J-ENSTAC

Engenius EnStationAC v1 is an outdoor wireless access point/bridge with
2 gigabit ethernet ports on 2 external ethernet switches,
5 GHz only wireless, internal antenna plates, and proprietery PoE.

Specification:

  - QCA9557 SOC
  - QCA9882 WLAN		(PCI card, 5 GHz, 2x2, 26dBm)
  - AR8035-A switch		(RGMII GbE with PoE+ IN)
  - AR8031 switch		(SGMII GbE with PoE OUT)
  - 40 MHz reference clock
  - 16 MB FLASH			MX25L12845EMI-10G
  - 2x 64 MB RAM		NT5TU32M16FG
  - UART at J10			(unpopulated)
  - internal antenna plates	(19 dbi, directional)
  - 7 LEDs, 1 button		(power, eth, wlan, RSSI) (reset)

MAC addresses:

  MAC addresses are labeled as ETH and 5GHz
  Vendor MAC addresses in flash are duplicate

  eth0	ETH	*:d3	art 0x0/0x6
  eth1	----	*:d4	---
  phy0	5GHz	*:d5	---

Installation:

  2 ways to flash factory.bin from OEM:

  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    Navigate to "Firmware" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt uboot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fd70000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions
  otherwise, uboot-env can be used to make uboot load the failsafe image

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt

  ssh into openwrt and run
  `fw_setenv rootfs_checksum 0`
  reboot, wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

TFTP recovery:

  rename initramfs to 'vmlinux-art-ramdisk'
  make available on TFTP server at 192.168.1.101
  power board
  hold or press reset button repeatedly

  NOTE: for some Engenius boards TFTP is not reliable
  try setting MTU to 600 and try many times

Format of OEM firmware image:

  The OEM software of EnStationAC is a heavily modified version
  of Openwrt Altitude Adjustment 12.09. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-ar71xx-enstationac-uImage-lzma.bin
    openwrt-ar71xx-enstationac-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

  Newer EnGenius software requires more checks but their script
  includes a way to skip them, otherwise the tar must include
  a text file with the version and md5sums in a deprecated format.

  The OEM upgrade script is at /etc/fwupgrade.sh.

  OKLI kernel loader is required because the OEM software
  expects the kernel to be no greater than 1536k
  and the factory.bin upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on PLL-data cells:

  The default PLL register values will not work
  because of the external AR8033 switch between
  the SOC and the ethernet PHY chips.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  For eth0 at 1000 speed, the value returned was
  ae000000 but that didn't work, so following
  the logical pattern from the rest of the values,
  the guessed value of a3000000 works better.

  later discovered that delay can be placed on the PHY end only
  with phy-mode as 'rgmii-id' and set register to 0x82...

Tested from master, all link speeds functional

Signed-off-by: Michael Pratt <mcpratt@pm.me>
[fixed SoB to match From:]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2020-12-22 19:11:50 +01:00
Sebastian Schaper 8ec997d006 ath79: add support for D-Link DAP-2660 A1
Specifications:
 * QCA9557, 16 MiB Flash, 128 MiB RAM, 802.11n 2T2R
 * QCA9882, 802.11ac 2T2R
 * Gigabit LAN Port (AR8035), 802.11af PoE

Installation:
 * Factory Web UI is at 192.168.0.50
   login with 'admin' and blank password, flash factory.bin
 * Recovery Web UI is at 192.168.0.50
   connect network cable, hold reset button during power-on and keep it
   pressed until uploading has started (only required when checksum is ok,
   e.g. for reverting back to oem firmware), flash factory.bin

After flashing factory.bin, additional free space can be reclaimed by
flashing sysupgrade.bin, since the factory image requires some padding
to be accepted for upgrading via OEM Web UI.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
2020-12-22 19:11:50 +01:00
Sven Eckelmann 17e5920490 ath79: Add support for Plasma Cloud PA300E
Device specifications:

* Qualcomm/Atheros QCA9533 v2
* 650/600/217 MHz (CPU/DDR/AHB)
* 64 MB of RAM
* 16 MB of SPI NOR flash (mx25l12805d)
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 2x 10/100 Mbps Ethernet
* 2T2R 2.4 GHz Wi-Fi
* multi-color LED (controlled via red/green/blue GPIOs)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x fast ethernet
  - eth0
    + Label: Ethernet 1
    + 24V passive POE (mode B)
    + used as WAN interface
  - eth1
    + Label: Ethernet 2
    + 802.3af POE
    + builtin switch port 2
    + used as LAN interface
* 12-24V 1A DC
* external antennas

Flashing instructions:

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-12-22 19:11:50 +01:00
Sven Eckelmann 5fc28ef479 ath79: Add support for Plasma Cloud PA300
Device specifications:

* Qualcomm/Atheros QCA9533 v2
* 650/600/217 MHz (CPU/DDR/AHB)
* 64 MB of RAM
* 16 MB of SPI NOR flash (mx25l12805d)
  - 2x 7 MB available; but one of the 7 MB regions is the recovery image
* 2x 10/100 Mbps Ethernet
* 2T2R 2.4 GHz Wi-Fi
* multi-color LED (controlled via red/green/blue GPIOs)
* 1x GPIO-button (reset)
* external h/w watchdog (enabled by default)
* TTL pins are on board (arrow points to VCC, then follows: GND, TX, RX)
* 2x fast ethernet
  - eth0
    + Label: Ethernet 1
    + 24V passive POE (mode B)
    + used as WAN interface
  - eth1
    + Label: Ethernet 2
    + 802.3af POE
    + builtin switch port 2
    + used as LAN interface
* 12-24V 1A DC
* internal antennas

Flashing instructions:

The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the factory image to the u-boot when the device boots up.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2020-12-22 19:11:50 +01:00
Michael Pratt 7073ebf0f9 ath79: add support for Senao Engenius ECB350 v1
FCC ID: A8J-ECB350

Engenius ECB350 v1 is an indoor wireless access point with a gigabit ethernet port,
2.4 GHz wireless, external antennas, and PoE.

**Specification:**

  - AR7242 SOC
  - AR9283 WLAN			2.4 GHz (2x2), PCIe on-board
  - AR8035-A switch		RGMII, GbE with 802.3af PoE
  - 40 MHz reference clock
  - 8 MB FLASH			25L6406EM2I-12G
  - 32 MB RAM
  - UART at J2			(populated)
  - 2 external antennas
  - 3 LEDs, 1 button		(power, lan, wlan) (reset)

**MAC addresses:**

  MACs are labeled as WLAN and WAN
  vendor MAC addresses in flash are duplicate

  phy0	WLAN	*:b8	---
  eth0	WAN	*:b9	art 0x0/0x6

**Installation:**

  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

  OEM webpage at 192.168.1.1
  username and password "admin"
  Navigate to "Firmware" page from left pane
  Click Browse and select the factory.bin image
  Upload and verify checksum
  Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

  After connecting to serial console and rebooting...
  Interrupt uboot with any key pressed rapidly
  execute `run failsafe_boot` OR `bootm 0x9f670000`
  wait a minute
  connect to ethernet and navigate to
  "192.168.1.1/index.htm"
  Select the factory.bin image and upload
  wait about 3 minutes

**Return to OEM:**

  If you have a serial cable, see Serial Failsafe instructions
  otherwise, uboot-env can be used to make uboot load the failsafe image

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, it can cause kernel loop or halt

  ssh into openwrt and run
  `fw_setenv rootfs_checksum 0`
  reboot, wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

**TFTP recovery** (unstable / not reliable):

  rename initramfs to 'vmlinux-art-ramdisk'
  make available on TFTP server at 192.168.1.101
  power board while holding or pressing reset button repeatedly

  NOTE: for some Engenius boards TFTP is not reliable
  try setting MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software of ECB350 v1 is a heavily modified version
  of Openwrt Kamikaze. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names
  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

  The OEM upgrade script is at /etc/fwupgrade.sh.

  OKLI kernel loader is required because the OEM software
  expects the kernel size to be no greater than 1536k
  and otherwise the factory.bin upgrade procedure would
  overwrite part of the kernel when writing rootfs.
  The factory upgrade script follows the original mtd partitions.

**Note on PLL-data cells:**

  The default PLL register values will not work
  because of the AR8035 switch between
  the SOC and the ethernet port.

  For AR724x series, the PLL register for GMAC0
  can be seen in the DTSI as 0x2c.
  Therefore the PLL register can be read from u-boot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x1805002c 1`

  However the registers that u-boot sets are not ideal and sometimes wrong...
  the at803x driver supports setting the RGMII clock/data delay on the PHY side.
  This way the pll-data register only needs to handle invert and phase.

  for this board no extra adjustements are needed on the MAC side
  all link speeds functional

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2020-12-22 19:11:50 +01:00
Chen Minqiang a1b5a43fc4 ath79: add support for GL.iNet GL-USB150
Add support for the ar71xx supported GL.iNet GL-USB150 to ath79.

GL.iNet GL-USB150 is an USB dongle WiFi router, based on Atheros AR9331.

Specification:

- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- Realtek RTL8152B USB to Ethernet bridge (connected with AR9331 PHY4)
- 1T1R 2.4 GHz
- 2x LED, 1x button
- UART header on PCB

Flash instruction:

Vendor software is based on openwrt so you can flash the sysupgrade
image via the vendor GUI or using command line sysupgrade utility.
Make sure to not save configuration over reflash as uci settings
differ between versions.

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2020-12-22 19:11:50 +01:00
Michael Pratt 73bdbb3d20 ath79: enable factory.bin and adjust profile of ECB1750
factory.bin was not tested for ECB1750...
but it was tested on it's sister board ECB1200

The product ID for the header can be verified by inspecting
the header of OEM images, or in the u-boot environment.

Also:

  - the LAN LED is controlled directly by the AR8035 switch
  - the labelled (first increment) MAC for both is ethaddr (eth0)
  - list packages in alphabetical order
  - use default sysupgrade.bin recipe

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2020-12-22 19:11:50 +01:00
Michael Pratt f244143609 ath79: add support for Senao Engenius ECB1200
FCC ID: A8J-ECB1200

Engenius ECB1200 is an indoor wireless access point with a GbE port,
2.4 GHz and 5 GHz wireless, external antennas, and 802.3af PoE.

**Specification:**

  - QCA9557 SOC			MIPS, 2.4 GHz (2x2)
  - QCA9882 WLAN		PCIe card, 5 GHz (2x2)
  - AR8035-A switch		RGMII, GbE with 802.3af PoE, 25 MHz clock
  - 40 MHz reference clock
  - 16 MB FLASH			25L12845EMI-10G
  - 2x 64 MB RAM		1538ZFZ V59C1512164QEJ25
  - UART at JP1			(unpopulated, RX shorted to ground)
  - 4 external antennas
  - 4 LEDs, 1 button		(power, eth, wifi2g, wifi5g) (reset)

**MAC addresses:**

  MAC Addresses are labeled as ETH and 5GHZ
  U-boot environment has the vendor MAC addresses
  MAC addresses in ART do not match vendor

  eth0	ETH	*:5c	u-boot-env ethaddr
  phy0	5GHZ	*:5d	u-boot-env athaddr
  ----	----	????	art 0x0/0x6

**Installation:**

  Method 1: Firmware upgrade page:

  OEM webpage at 192.168.1.1
  username and password "admin"
  Navigate to "Firmware" page from left pane
  Click Browse and select the factory.bin image
  Upload and verify checksum
  Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

  After connecting to serial console and rebooting...
  Interrupt uboot with any key pressed rapidly

  (see TFTP recovery)
  perform a sysupgrade

**Serial Access:**

  the RX line on the board for UART is shorted to ground by resistor R176
  therefore it must be removed to use the console
  but it is not necessary to remove to view boot log
  optionally, R175 can be replaced with a solder bridge short

  the resistors R175 and R176 are next to the UART pinout at JP1

**Return to OEM:**

  If you have a serial cable, see Serial Failsafe instructions

  Unlike most Engenius boards, this does not have a 'failsafe' image
  the only way to return to OEM is TFTP or serial access to u-boot

**TFTP recovery:**

  Unlike most Engenius boards, TFTP is reliable here

  rename initramfs-kernel.bin to 'ap.bin'
  make the file available on a TFTP server at 192.168.1.10
  power board while holding or pressing reset button repeatedly

  or with serial access:
  run `tftpboot` or `run factory_boot` with initramfs-kernel.bin
  then `bootm` with the load address

**Format of OEM firmware image:**

  The OEM software of ECB1200 is a heavily modified version
  of Openwrt Altitude Adjustment 12.09.

  This Engenius board, like ECB1750, uses a proprietary header
  with a unique Product ID. The header for factory.bin is
  generated by the mksenaofw program included in openwrt.

**Note on PLL-data cells:**

  The default PLL register values will not work
  because of the AR8035 switch between
  the SOC and the ethernet port.

  For QCA955x series, the PLL registers for eth0 and eth1
  can be see in the DTSI as 0x28 and 0x48 respectively.
  Therefore the PLL registers can be read from uboot
  for each link speed after attempting tftpboot
  or another network action using that link speed
  with `md 0x18050028 1` and `md 0x18050048 1`.

  However the registers that u-boot sets are not ideal and sometimes wrong...
  the at803x driver supports setting the RGMII clock/data delay on the PHY side.
  This way the pll-data register only needs to handle invert and phase.

  for this board clock invert is needed on the MAC side
  all link speeds functional

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2020-12-22 19:11:50 +01:00
Tomasz Maciej Nowak 13581a5fa7 ath79: airtight c-75: use second flash chip
The flash capacity is divided in two flash chips and currently only
first is used. Increase available space for OpenWrt by additional 16 MiB
using mtd-concat driver. Because U-Boot might not be able to load kernel
image spanned through two flash chips, the size of kernel is limited
to space available on first first chip.

Cc: Vladimir Georgievsky <vladimir.georgievsky@yahoo.com>
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-12-19 19:42:00 +01:00
Tomasz Maciej Nowak 0d96d36841 ath79: add support for AirTight C-75
AirTight Networks (later renamed to Mojo Networks) C-75 is a dual-band
access point, also sold by WatchGuard under name AP320.

Specification
SoC: Qualcomm Atheros QCA9550
RAM: 128 MiB DDR2
Flash: 2x 16 MiB SPI NOR
WIFI: 2.4 GHz 3T3R integrated
      5 GHz 3T3R QCA9890 oversized Mini PCIe card
Ethernet: 2x 10/100/1000 Mbps QCA8334
          port labeled LAN1 is PoE capable (802.3at)
USB: 1x 2.0
LEDs: 7x which two are GPIO controlled, four switch controlled, one
      controlled by wireless driver
Buttons: 1x GPIO controlled
Serial: RJ-45 port, Cisco pinout
        baud: 115200, parity: none, flow control: none
JTAG: Yes, pins marked J1 on PCB

Installation
1. Prepare TFTP server with OpenWrt initramfs-kernel image.
2. Connect to one of LAN ports.
3. Connect to serial port.
4. Power on the device and when prompted to stop autoboot, hit any key.
5. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
   'setenv' to do that, then run following commands:
    tftpboot 0x81000000 <openwrt_initramfs-kernel_image_name>
    bootm 0x81000000
6. Wait about 1 minute for OpenWrt to boot.
7. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
   with:
    sysupgrade -n /tmp/<openwrt_sysupgrade_image_name>
8. After flashing, the access point will reboot to OpenWrt. Wait few
   minutes, until the Power LED stops blinking, then it's ready for
   configuration.

Known issues
Green power LED does not work.

Additional information
The U-Boot fails to initialise ethernet ports correctly when a UART
adapter is attached to UART pins (marked J3 on PCB).

Cc: Vladimir Georgievsky <vladimir.georgievsky@yahoo.com>
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-12-19 19:42:00 +01:00
Martin Blumenstingl b403a6e124 ath79: add support for the Belkin F9K1115 v2 (AC1750 DB Wi-Fi)
This device has (almost?) identical hardware to the F9J1108 v2 but uses
a different firmware magic and model number.

Specifications:

SoC: QCA9558
CPU: 720 MHz
Flash: 16 MiB NOR
RAM: 128 MiB
WiFi 2.4 GHz: QCA9558-AT4A 3x3 MIMO 802.11b/g/n
WiFi 5 GHz: QCA9880-2R4E 3x3 MIMO 802.11a/n/ac
Ethernet: 4x LAN and 1x WAN (all 1Gbit/s ports)
USB: 1 x USB 2.0 (lower), 1 x USB 3.0 (upper)

MAC addresses based on OEM firmware:

Interface   Address   Location
---------   -------   --------
lan         *:5A      sometimes in 0x6
wan         *:5B      0x0
2.4Ghz      *:5A      0x1002
5Ghz        As per mini PCIe EEPROM

Flashing instructions:

The factory.bin can be flashed via the Belkin web UI or via the uboot
HTTP upgrade page (which is by default listening on 192.168.2.1). Once
the factory.bin has been written, sysupgrade.bin will work as usual.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
2020-12-14 16:59:49 +01:00
Martin Blumenstingl 563ece8a85 ath79: create shared DTSI/definition for Belkin F9J1108/F9K1115 v2
Belkin F9J1108 v2 and F9K1115 v2 are (seemingly) identical hardware
with different model numbers. Extract all non-device specific code to a
common .dtsi so it can be re-used when adding support for the
F9K1115 v2.

Similar to the .dtsi most of the image building recipe code can be
re-used. Move everything except the device model, edimax header magic
and edimax header model into a shared build recipe.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
[drop duplicate TARGET_DEVICES, add EDIMAX_* to DEVICE_VARS, edit title]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-12-14 16:57:21 +01:00
Damien Mascord b9971db7c3 ath79: add support for Belkin F9J1108v2 (AC1750 DB Wi-Fi)
This device is the non-US build of the F9K1115 v2, with a different
firmware magic.

Specifications:

SoC: QCA9558
CPU: 720 MHz
Flash: 16 MiB NOR
RAM: 128 MiB
WiFi 2.4 GHz: QCA9558-AT4A 3x3 MIMO 802.11b/g/n
WiFi 5 GHz: QCA9880-2R4E 3x3 MIMO 802.11a/n/ac
Ethernet: 4x LAN and 1x WAN (all 1gbps)
USB: 1 x USB 2.0 (lower), 1 x USB 3.0 (upper)

MAC addresses based on OEM firmware:

Interface   Address   Location
---------   -------   --------
lan         *:5A      sometimes in 0x6
wan         *:5B      0x0
2.4Ghz      *:5A      0x1002
5Ghz        As per mini PCIe EEPROM

Flashing instructions:

The factory.bin can be flashed via the Belkin web UI or via the uboot
http upgrade page.
Once the factory.bin has been written, sysupgrade.bin will work as usual.

Signed-off-by: Damien Mascord <tusker@tusker.org>
Acked-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
[wrap commit message/code, adjust label-mac-device, whitespace fixes,
merge block in 02_network]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-12-07 14:22:00 +01:00
Tomasz Maciej Nowak 760952ad02 ath79: restore sysupgrade support for ja76pf2 and routerstations
Because the bug described in FS#2428 has been fixed with bf2870c1d9
("kernel: fix mtd partition erase < parent_erasesize writes") these
devices can now safely do sysupgrade.

Restore sysupgrade support disabled in:

0cc87b3bac ("ath79: image: disable sysupgrade images for routerstations
and ja76pf2")

cc5256a8bf ("ath79: base-files: disable sysupgrade for routerstations
and ja76pf2")

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
[move Build block, remove check-size argument, wrap sysupgrade line,
make commit message easier to read]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-12-01 20:03:15 +01:00
Tomasz Maciej Nowak 474aa3237c ath79: wlr-7100: remove device variant indicator
As reported by user, the same image works on both device variants which
are v1 001 and v1 002.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
2020-12-01 19:43:18 +01:00
Sander Vanheule ab1584a797 ath79: netgear: trim down uImage customisations
Replace NETGEAR_KERNEL_MAGIC by UIMAGE_MAGIC to better match the
variable's purpose. This allows to drop the custom
Build/netgear-uImage.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
[keep UIMAGE_MAGIC definitions even for default value]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 16:33:49 +01:00
Michael Pratt b31aaa0580 ath79: add support for Senao Engenius EAP300 v2
FCC ID: A8J-EAP300A

Engenius EAP300 v2 is an indoor wireless access point with a
100/10-BaseT ethernet port, 2.4 GHz wireless, internal antennas,
and 802.3af PoE.

**Specification:**

  - AR9341
  - 40 MHz reference clock
  - 16 MB FLASH			MX25L12845EMI-10G
  - 64 MB RAM
  - UART at J1			(populated)
  - Ethernet port with POE
  - internal antennas
  - 3 LEDs, 1 button		(power, eth, wlan) (reset)

**MAC addresses:**

  phy0  *:d3   art 0x1002 (label)
  eth0  *:d4   art 0x0/0x6

**Installation:**

  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

  OEM webpage at 192.168.1.1
  username and password "admin"
  Navigate to "Firmware" page from left pane
  Click Browse and select the factory.bin image
  Upload and verify checksum
  Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

  After connecting to serial console and rebooting...
  Interrupt uboot with any key pressed rapidly
  execute `run failsafe_boot` OR `bootm 0x9fdf0000`
  wait a minute
  connect to ethernet and navigate to
  "192.168.1.1/index.htm"
  Select the factory.bin image and upload
  wait about 3 minutes

**Return to OEM:**

  If you have a serial cable, see Serial Failsafe instructions

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, can cause kernel loop or halt

  The easiest way to return to the OEM software is the Failsafe image
  If you dont have a serial cable, you can ssh into openwrt and run

  `mtd -r erase fakeroot`

  Wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

**TFTP recovery** (unstable / not reliable):

  rename initramfs to 'vmlinux-art-ramdisk'
  make available on TFTP server at 192.168.1.101
  power board while holding or pressing reset button repeatedly

  NOTE: for some Engenius boards TFTP is not reliable
  try setting MTU to 600 and try many times

**Format of OEM firmware image:**

  The OEM software of EAP300 v2 is a heavily modified version
  of Openwrt Kamikaze. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names
  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring.

  The OEM upgrade script is at /etc/fwupgrade.sh.

  OKLI kernel loader is required because the OEM software
  expects the kernel size to be no greater than 1536k
  and otherwise the factory.bin upgrade procedure would
  overwrite part of the kernel when writing rootfs.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
[clarify MAC address section, bump PKG_RELEASE for uboot-envtools]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-25 13:23:06 +01:00
Piotr Dymacz 64a6f4a9c1 ath79: add support for ALFA Network Pi-WiFi4
ALFA Network Pi-WiFi4 is a Qualcomm QCA9531 v2 based, high-power 802.11n
WiFi board in Raspberry Pi 3B shape, equipped with 1x FE and 4x USB 2.0.

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16+ MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 2T2R 2.4 GHz Wi-Fi with Qorvo RFFM8228P FEM
- 2x IPEX/U.FL connectors on PCB
- 4x USB 2.0 Type-A
- Genesys Logic GL850G 4-port USB HUB
- USB power is controlled by GPIO
- 5x LED (3x on PCB, 2x in RJ45, 4x driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- 1x micro USB Type-B for power and system console (Holtek HT42B534)
- UART and GPIO (8-pin, 1.27 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-11-18 23:49:34 +01:00
张鹏 448de2e2e5 ath79: add support for Qxwlan E600G v2 / E600GAC v2
E600G v2 based on Qualcomm/Atheros QCA9531

Specification:

 - 650/600/200 MHz (CPU/DDR/AHB)
 - 128/64 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz
 - 2 x 10/100 Mbps Ethernet(RJ45)
 - 1 x MiniPCI-e
 - 1 x SIM (3G/4G)
 - 5 x LED , 1 x Button(SW2-Reset Buttun), 1 x power input
 - UART(J100) header on PCB(115200 8N1)

E600GAC v2 based on Qualcomm/Atheros QCA9531 + QCA9887

Specification:

 - 650/600/200 MHz (CPU/DDR/AHB)
 - 128/64 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz
 - 1T1R 5 GHz
 - 2 x 10/100 Mbps Ethernet(RJ45)
 - 6 x LED (one three-color led), 2 x Button(SW2-Reset Buttun),1 x power input
 - UART (J100)header on PCB(115200 8N1)

Flash instruction:

1.Using tftp mode with UART connection and original OpenWrt image
 - Configure PC with static IP 192.168.1.10 and tftp server.
 - Rename "openwrt-ath79-generic-xxx-squashfs-sysupgrade.bin"
   to "firmware.bin" and place it in tftp server directory.
 - Connect PC with one of LAN ports, power up the router and press
   key "Enter" to access U-Boot CLI.
 - Use the following commands to update the device to OpenWrt:
   run lfw
 - After that the device will reboot and boot to OpenWrt.
 - Wait until all LEDs stops flashing and use the router.

2.Using httpd mode with Web UI connection and original OpenWrt image
 - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
 - Connect PC with one of LAN ports,press the reset button, power up
   the router and keep button pressed for around 6-7 seconds, until
   leds flashing.
 - Open your browser and enter 192.168.1.1,You will see the upgrade
   interface, select "openwrt-ath79-generic-xxx-squashfs-
   sysupgrade.bin" and click the upgrade button.
 - After that the device will reboot and boot to OpenWrt.
 - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[rearrange in generic.mk, fix one case in 04_led_migration, update
commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-11-12 17:18:26 +01:00
David Bauer 22be18effb ath79: streamline image-generation for OCEDO boards
Use the default sysupgrade generation procedure provided
by the target. The previously generated images had the rootfs not
aligned to an eraseblock.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-11-05 00:00:37 +01:00
Adrian Schmutzler 8087499ac5 ath79: enable upgrade from ar71xx for Qxwlan devices
This supports upgrade from ar71xx for the recently added Qxwlan
devices E1700AC v2, E558 v2, E750A v4 and E750G v8.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-26 21:07:22 +01:00
张鹏 4ff7bdfeeb ath79: add support for Qxwlan E1700AC v2
E1700AC v2 based on Qualcomm/Atheros QCA9563 + QCA9880.

Specification:

 - 750/400/250 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 3T3R 2.4 GHz
 - 3T3R 5 GHz
 - 2 x 10/1000M Mbps Ethernet (RJ45)
 - 1 x MiniPCI-e
 - 1 x SIM (3G/4G)
 - 1 x USB 2.0 Port
 - 5 x LED , 2 x Button(S8-Reset Buttun), 1 x power input
 - UART (J5) header on PCB (115200 8N1)

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig, whitespace fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-17 20:18:00 +02:00
张鹏 987d9028e1 ath79: add support for Qxwlan E558 v2
Qxwlan E558 v2 is based on Qualcomm QCA9558 + AR8327.

Specification:

 - 720/600/200 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz (QCA9558)
 - 3x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 4x miniPCIe slot (USB 2.0 bus only)
 - 1x microSIM slot
 - 5x LED (4 driven by GPIO)
 - 1x button (reset)
 - 1x 3-pos switch
 - 1x DC jack for main power input (9-48 V)
 - UART (JP5) and LEDs (J8) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig, whitespace adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-17 20:17:59 +02:00
张鹏 27a7d071c0 ath79: add support for Qxwlan E750G v8
Qxwlan E750G v8 is based on Qualcomm QCA9344 + QCA9334.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4G GHz (AR9344)
 - 2x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-17 20:17:59 +02:00
Peng Zhang 5666ca913a ath79: add support for Qxwlan E750A v4
Qxwlan E750A v4 is based on Qualcomm QCA9344.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 5G GHz (AR9344)
 - 2x 10/100 Mbps Ethernet (one port with PoE support)
 - 1x miniPCIe slot (USB 2.0 bus only)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: Peng Zhang <sd20@qxwlan.com>
[cut out of bigger patch, alter use of DEVICE_VARIANT, merge case
in 01_leds, use lower case for v4]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-10-15 18:52:39 +02:00
Piotr Dymacz e9263123f9 ath79: add support for Hak5 WiFi Pineapple NANO
Hak5 WiFi Pineapple NANO is an "USB dongle" device dedicated for Wi-Fi
pentesters. This device is based on Atheros AR9331 and AR9271. Support
for it was first introduced in 950b278c81 (ar71xx). FCC ID: 2AB87-NANO.

Specifications:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR1)
- 16 MB of flash (SPI NOR)
- 1T1R 2.4 GHz Wi-Fi (AR9331)
- 1T1R 2.4 GHz Wi-Fi (AR9271L), with ext. PA and LNA (Qorvo RFFM4203)
- 2x RP-SMA antenna connectors
- 1x USB 2.0 to 10/100 Ethernet bridge (ASIX AX88772A)
- integrated 4-port USB 2.0 HUB: Alcor Micro AU6259:
  - 1x USB 2.0
  - 1x microSD card reader (Genesys Logic GL834L)
  - Atheros AR9271L
- 1x LED, 1x button
- UART (4-pin, 2 mm pitch) header on PCB
- USB 2.0 Type-A plug for power and AX88772A

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz b33ce8c535 ath79: add support for Hak5 Packet Squirrel
Hak5 Packet Squirrel is a pocket-sized device dedicated for pentesters
(MITM attacks). This device is based on Atheros AR9331 but it lacks
WiFi. Support for it was first introduced in 950b278c81 (ar71xx).

Specifications:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x RJ45 10/100 Mbps Ethernet (AR9331)
- 1x USB 2.0
- 1x RGB LED, 1x button, 1x 4-way mechanical switch
- 1x Micro USB Type-B for main power input

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz a2f3a58607 ath79: add support for Hak5 LAN Turtle
Hak5 LAN Turtle is an "USB Ethernet Adapter" shaped device dedicated for
sysadmins and pentesters. This device is based on Atheros AR9331 but it
lacks WiFi. Support for it was first introduced in 950b278c81 (ar71xx).

Two different versions of this device exist and it's up to the user to
install required drivers (generic image supports only common features):

- LAN Turtle 3G with Quectel UG96 3G modem
- LAN Turtle SD with microSD card reader (Alcorlink AU6435R)

Specifications:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 1x RJ45 10/100 Mbps Ethernet (AR9331)
- 1x USB 2.0 to 10/100 Ethernet bridge (Realtek RTL8152B)
- 2x LED (power, system), 1x button (inside, on the PCB)
- USB 2.0 Type-A plug for power and RTL8152B

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz 70a57d48db ath79: add support for ALFA Network N5Q
ALFA Network N5Q is a successor of previous model, the N5 (outdoor
CPE/AP, based on Atheros AR7240 + AR9280). New version is based on
Atheros AR9344.

Support for this device was first introduced in 4b0eebe9df (ar71xx
target) but users are advised to migrate from ar71xx target without
preserving settings as ath79 support includes some changes in network
and LED default configuration. They were aligned with vendor firmware
and recently added N2Q model (both Ethernet ports as LAN, labelled as
LAN1 and LAN2).

Specifications:

- Atheros AR9344
- 550/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet, with passive PoE support (24 V)
- 2T2R 5 GHz Wi-Fi, with ext. PA (RFPA5542) and LNA, up to 27 dBm
- 2x IPEX/U.FL or MMCX antenna connectors (for PCBA version)
- 8x LED (7 are driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- header for optional 802.3at/af PoE module
- DC jack for main power input (optional, not installed by default)
- UART (4-pin, 2.54 mm pitch) header on PCB
- LEDs (2x 5-pin, 2.54 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on OpenWrt/LEDE. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz 6492ea7d9e ath79: add support for ALFA Network N2Q
ALFA Network N2Q is an outdoor N300 AP/CPE based on Qualcomm/Atheros
QCA9531 v2. This model is a successor of the old N2 which was based
on Atheros AR7240. FCC ID: 2AB8795311.

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2T2R 2.4 GHz Wi-Fi with ext. PA (Skyworks SE2623L) and LNA
- 2x 10/100 Mbps Ethernet with passive PoE input in one port (24 V)
- PoE pass through in second port (controlled by GPIO)
- support for optional 802.3af/at PoE module
- 1x mini PCIe slot (PCIe bus, extra 4.2 V for high power cards)
- 2x IPEX/U.FL connectors on PCB
- 1x USB 2.0 mini Type-B (power controlled by GPIO)
- 8x LED (7 of them are driven by GPIO)
- 1x button (reset)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- UART (4-pin, 2.54 mm pitch) header on PCB
- LEDs (2x 5-pin, 2.54 mm pitch) header on PCB

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz 9bcf98ed85 ath79: add support for ALFA Network R36A
ALFA Network R36A is a successor of the previous model, the R36 (Ralink
RT3050F based). New version is based on Qualcomm/Atheros QCA9531 v2, FCC
ID: 2AB879531.

Support for this device was first introduced in af8f0629df (ar71xx
target). When updating from previous release (and/or ar71xx target),
user should only adjust the WAN LED trigger type (netdev in ar71xx,
switch port in ath79).

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 650/400/200 MHz (CPU/DDR/AHB)
- 128 MB (R36AH/-U2) or 64 MB (R36A) of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet
- Passive PoE input support (12~36 V) in RJ45 near DC jack
- 2T2R 2.4 GHz Wi-Fi with Qorvo RFFM8228P FEM
- 2x IPEX/U.FL connectors on PCB
- 1x USB 2.0 Type-A
- 1x USB 2.0 mini Type-B in R36AH-U2 version
- USB power is controlled by GPIO
- 6/7x LED (5/6 of them are driven by GPIO)
- 2x button (reset, wifi/wps)
- external h/w watchdog (EM6324QYSP5B, enabled by default)
- DC jack with lock, for main power input (12 V)
- UART (4-pin, 2.54 mm pitch) header on PCB

Optional/additional features in R36A series (R36A was the first model):
- for R36AH:    USB 2.0 hub*
- for R36AH-U2: USB 2.0 hub*, 1x USB 2.0 mini Type-B, one more LED

*) there are at least three different USB 2.0 hub in R36AH/-U2 variants:
- Terminus-Tech FE 1.1
- Genesys Logic GL852G
- Genesys Logic GL850G (used in latests revision)

Flash instruction:

You can use sysupgrade image directly in vendor firmware which is based
on LEDE/OpenWrt. Alternatively, you can use web recovery mode in U-Boot:

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with one of RJ45 ports, press the reset button, power up
   device, wait for first blink of all LEDs (indicates network setup),
   then keep button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz cf42660dce ath79: add support for Samsung WAM250
Samsung WAM250 is a dual-band (selectable, not simultaneous) wireless
hub, dedicated for Samsung Shape Wireless Audio System. The device is
based on Atheros AR9344 (FCC ID: A3LWAM250). Support for this device
was first introduced in e58e49bdbe (ar71xx target).

Specifications:

- Atheros AR9344
- 560/450/225 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 2x 10/100 Mbps Ethernet
- 2T2R 2.4/5 GHz Wi-Fi, with ext. PA (SE2598L, SE5003L) and LNA
- 1x USB 2.0
- 4x LED (all are driven by GPIO)
- 2x button (reset, wps/speaker add)
- DC jack for main power input (14 V)
- UART header on PCB (J4, RX: 3, TX: 5)

Flash instruction:

This device uses dual-image (switched between upgrades) with a common
jffs2 config partition. Fortunately, there is a way to disable this mode
so that more flash space can be used by OpenWrt image.

You can easily access this device over telnet, using root/root
credentials (the same also work for serial console access).

1. Make sure that your device uses second (bootpart=2) image using
   command: "fw_printenv bootpart".
2. If your device uses first image (bootpart=1), perform upgrade to the
   latest vendor firmware (after the update, device should boot from
   second partition) using web gui (default login: admin/1234567890).
3. Rename "sysupgrade" image to "firmware.bin", download it (you can use
   wget, tftp or ftpget) to "/tmp" and issue below commands:

   mtd_debug erase /dev/mtd3 0 $(wc -c /tmp/firmware.bin | awk -F' ' '{print $1}')
   mtd_debug write /dev/mtd3 0 $(wc -c /tmp/firmware.bin)
   fw_setenv bootpart
   fw_setenv bootcmd "bootm 0x9f070000"
   reboot

Revert to vendor firmware instruction:

1. Download vendor firmware to "/tmp" device and issue below commands:

   fw_setenv bootpart 1
   sysupgrade -n -F SS_BHUB_v2.2.05.bin

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz f777bca95d ath79: image: don't combine kmod-usb2 with kmod-usb-chipidea2
Include of kmod-usb-chipidea2 is enough to support USB host mode in
devices with Atheros AR9331 WiSOC.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz c65c306d33 ath79: add support for Wallys DR531
Wallys DR531 is based on Qualcomm Atheros QCA9531 v2. Support for this
device was first introduced in e767980eb8 (ar71xx target).

Specifications:

- Qualcomm/Atheros QCA9531 v2
- 550/400/200 MHz (CPU/DDR/AHB)
- 2x 10/100 Mbps Ethernet
- 64 MB of RAM (DDR2)
- 8 MB of flash (SPI NOR)
- 2T2R 2.4 GHz Wi-Fi, with external PA (SE2576L), up to 30 dBm
- 2x MMCX connectors (optional IPEX/U.FL)
- mini PCIe connector (PCIe/USB buses and mini SIM slot)
- 7x LED, 1x button, 1x optional buzzer
- UART, JTAG and LED headers on PCB

Flash instruction (do it under U-Boot, using UART):

  tftpb 0x80060000 openwrt-ath79-...-dr531-squashfs-sysupgrade.bin
  erase 0x9f050000 +$filesize
  cp.b $fileaddr 0x9f050000 $filesize
  setenv bootcmd "bootm 0x9f050000"
  saveenv && reset

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Piotr Dymacz 66abd58196 ath79: add support for ALFA Network AP121FE
The AP121FE is a slightly modified version of already supported AP121F
model (added to ar71xx in 0c6165d21a and to ath79 in 334bbc5198).

The differences in compare to AP121F:

- no micro SD card reader
- USB data lines are included in Type-A plug
- USB bus switched to device/peripheral mode (permanently, in bootstrap)

Other than that, specifications are the same:

- Atheros AR9331
- 400/400/200 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR1)
- 16 MB of flash (SPI NOR)
- 1x 10/100 Mbps Ethernet
- 1T1R 2.4 GHz Wi-Fi, up to 15 dBm
- 1x IPEX/U.FL connector, internal PCB antenna
- 3x LED, 1x button, 1x switch
- 4-pin UART header on PCB (2 mm pitch)
- USB 2.0 Type-A plug (power and data)

Flash instruction (under U-Boot web recovery mode):

1. Configure PC with static IP 192.168.1.2/24.
2. Connect PC with RJ45 port, press the reset button, power up device,
   wait for first blink of all LEDs (indicates network setup), then keep
   button for 3 following blinks and release it.
3. Open 192.168.1.1 address in your browser and upload sysupgrade image.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2020-09-28 01:28:37 +02:00
Adrian Schmutzler b284333b3a ath79: move engenius_loader_okli recipe before devices
Move engenius_loader_okli image recipe in front of all Engenius
devices, so adding new device entries will not have them sorted
before the shared recipe.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-25 20:07:16 +02:00
Adrian Schmutzler 25f2f66eea ath79: add support for Buffalo WZR-600DHP
The hardware of this device seems to be identical to WZR-HP-AG300H.
It was already implemented as a clone in ar71xx.

Specification:
- 680 MHz CPU (Qualcomm Atheros AR7161)
- 128 MiB RAM
- 32 MiB Flash
- WiFi 5 GHz a/n
- WiFi 2.4 GHz b/g/n
- 5x 1000Base-T Ethernet
- 1x USB 2.0

Installation of OpenWRT from vendor firmware:
- Connect to the Web-interface at http://192.168.11.1
- Go to “Administration” → “Firmware Upgrade”
- Upload the OpenWrt factory image

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 17:32:12 +02:00
Adrian Schmutzler c68105c3b4 ath79: use common device definition for Buffalo devices
The Buffalo devices in ath79 share their image generation code,
so let's create a shared Device definition for them.

Since most of them use BUFFALO_HWVER := 3, this is moved as
default to the shared definition as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-16 17:31:03 +02:00
Zhong Jianxin 53df30f02b ath79: add support for Mercury MW4530R v1
Mercury MW4530R is a TP-Link TL-WDR4310 clone.

Specification:

* SOC: Atheros AR9344 (560 MHz)
* RAM: 128 MiB
* Flash: 8192 KiB
* Ethernet: 5 x 10/100/1000 (4 x LAN, 1 x WAN) (AR8327)
* Wireless:
  - 2.4 GHz b/g/n (internal)
  - 5 GHz a/n (AR9580)
* USB: yes, 1 x USB 2.0

Installation:

Flash factory image via OEM web interface.

Signed-off-by: Zhong Jianxin <azuwis@gmail.com>
2020-09-12 18:47:26 +02:00
Michael Pratt 22caf30a65 ath79: add support for Senao Engenius ENH202 v1
FCC ID: U2M-ENH200

Engenius ENH202 is an outdoor wireless access point with 2 10/100 ports,
built-in ethernet switch, internal antenna plates and proprietery PoE.

Specification:

  - Qualcomm/Atheros AR7240 rev 2
  - 40 MHz reference clock
  - 8 MB FLASH                  ST25P64V6P (aka ST M25P64)
  - 32 MB RAM
  - UART at J3                  (populated)
  - 2x 10/100 Mbps Ethernet     (built-in switch at gmac1)
  - 2.4 GHz, 2x2, 29dBm         (Atheros AR9280 rev 2)
  - internal antenna plates     (10 dbi, semi-directional)
  - 5 LEDs, 1 button            (LAN, WAN, RSSI) (Reset)

Known Issues:

  - Sysupgrade from ar71xx no longer possible
  - Power LED not controllable, or unknown gpio

MAC addresses:

  eth0/eth1  *:11   art 0x0/0x6
  wlan       *:10   art 0x120c

  The device label lists both addresses, WLAN MAC and ETH MAC,
  in that order.

  Since 0x0 and 0x6 have the same content, it cannot be
  determined which is eth0 and eth1, so we chose 0x0 for both.

Installation:

  2 ways to flash factory.bin from OEM:

  - Connect ethernet directly to board (the non POE port)
      this is LAN for all images
  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    In upper right select Reset
    "Restore to factory default settings"
    Wait for reboot and login again
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt boot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9f670000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, can cause kernel loop or halt

  The easiest way to return to the OEM software is the Failsafe image
  If you dont have a serial cable, you can ssh into openwrt and run

  `mtd -r erase fakeroot`

  Wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

Format of OEM firmware image:

  The OEM software of ENH202 is a heavily modified version
  of Openwrt Kamikaze bleeding-edge. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-senao-enh202-uImage-lzma.bin
    openwrt-senao-enh202-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring, and by swapping headers to see
  what the OEM upgrade utility accepts and rejects.

  OKLI kernel loader is required because the OEM firmware
  expects the kernel to be no greater than 1024k
  and the factory.bin upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on built-in switch:

  ENH202 is originally configured to be an access point,
  but with two ethernet ports, both WAN and LAN is possible.

  the POE port is gmac0 which is preferred to be
  the port for WAN because it gives link status
  where swconfig does not.

Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[assign label_mac in 02_network, use ucidef_set_interface_wan,
use common device definition, some reordering]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Michael Pratt 6decbf3186 ath79: add support for Senao Engenius ENS202EXT v1
Engenius ENS202EXT v1 is an outdoor wireless access point with 2 10/100 ports,
with built-in ethernet switch, detachable antennas and proprietery PoE.

FCC ID:	A8J-ENS202

Specification:

  - Qualcomm/Atheros AR9341 v1
  - 535/400/200/40 MHz          (CPU/DDR/AHB/REF)
  - 64 MB of RAM
  - 16 MB of FLASH              MX25L12835F(MI-10G)
  - UART (J1) header on PCB     (unpopulated)
  - 2x 10/100 Mbps Ethernet     (built-in switch Atheros AR8229)
  - 2.4 GHz, up to 27dBm        (Atheros AR9340)
  - 2x external, detachable antennas
  - 7x LED (5 programmable in ath79), 1x GPIO button (Reset)

Known Issues:

  - Sysupgrade from ar71xx no longer possible
  - Ethernet LEDs stay on solid when connected, not programmable

MAC addresses:

  eth0/eth1  *:7b   art 0x0/0x6
  wlan       *:7a   art 0x1002

  The device label lists both addresses, WLAN MAC and ETH MAC,
  in that order.

  Since 0x0 and 0x6 have the same content, it cannot be
  determined which is eth0 and eth1, so we chose 0x0 for both.

Installation:

  2 ways to flash factory.bin from OEM:

  - Connect ethernet directly to board (the non POE port)
      this is LAN for all images
  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    In upper right select Reset
    "Restore to factory default settings"
    Wait for reboot and login again
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt boot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fdf0000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

  *If you are unable to get network/LuCI after flashing*
  You must perform another factory reset:

    After waiting 3 minutes or when Power LED stop blinking:

    Hold Reset button for 15 seconds while powered on
    or until Power LED blinks very fast

    release and wait 2 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions

  *DISCLAIMER*
  The Failsafe image is unique to this model.
  The following directions are unique to this model.
  DO NOT downgrade to ar71xx this way, can cause kernel loop

  The easiest way to return to the OEM software is the Failsafe image
  If you dont have a serial cable, you can ssh into openwrt and run

  `mtd -r erase fakeroot`

  Wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

TFTP Recovery:

  For some reason, TFTP is not reliable on this board.
  Takes many attempts, many timeouts before it fully transfers.

  Starting with an initramfs.bin:

  Connect to ethernet
  set IP address and TFTP server to 192.168.1.101
  set up infinite ping to 192.168.1.1
  rename the initramfs.bin to "vmlinux-art-ramdisk" and host on TFTP server
  disconnect power to the board
  hold reset button while powering on board for 8 seconds

  Wait a minute, power LED should blink eventually if successful
  and a minute after that the pings should get replies
  You have now loaded a temporary Openwrt with default settings temporarily.
  You can use that image to sysupgrade another image to overwrite flash.

Format of OEM firmware image:

  The OEM software of ENS202EXT is a heavily modified version
  of Openwrt Kamikaze bleeding-edge. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-senao-ens202ext-uImage-lzma.bin
    openwrt-senao-ens202ext-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring, and by swapping headers to see
  what the OEM upgrade utility accepts and rejects.

Note on the factory.bin:

  The newest kernel is too large to be in the kernel partition

  the new ath79 kernel is beyond   1592k
  Even ath79-tiny is               1580k

  Checksum fails at boot because the bootloader (modified uboot)
  expects kernel to be 1536k. If the kernel is larger, it gets
  overwritten when rootfs is flashed, causing a broken image.
  The mtdparts variable is part of the build and saving a new
  uboot environment will not persist after flashing.
  OEM version might interact with uboot or with the custom
  OEM partition at 0x9f050000.

  Failed checksums at boot cause failsafe image to launch,
  allowing any image to be flashed again.

  HOWEVER: one should not install older Openwrt from failsafe
  because it can cause rootfs to be unmountable,
  causing kernel loop after successful checksum.
  The only way to rescue after that is with a serial cable.

  For these reasons, a fake kernel (OKLI kernel loader)
  and fake squashfs rootfs is implemented to take care of
  the OEM firmware image verification and checksums at boot.
  The OEM only verifies the checksum of the first image
  of each partition respectively, which is the loader
  and the fake squashfs. This completely frees
  the "firmware" partition from all checks.

  virtual_flash is implemented to make use of the wasted space.
  this leaves only 2 erase blocks actually wasted.

  The loader and fakeroot partitions must remain intact, otherwise
  the next boot will fail, redirecting to the Failsafe image.

  Because the partition table required is so different
  than the OEM partition table and ar71xx partition table,
  sysupgrades are not possible until one switches to ath79 kernel.

Note on sysupgrade.tgz:

  To make things even more complicated, another change is needed to
  fix an issue where network does not work after flashing from either
  OEM software or Failsafe image, which implants the OEM (Openwrt Kamikaze)
  configuration into the jffs2 /overlay when writing rootfs from factory.bin.

  The upgrade script has this:

    mtd -j "/tmp/_sys/sysupgrade.tgz" write "${rootfs}" "rootfs"

  However, it also accepts scripts before and after:

    before_local="/etc/before-upgradelocal.sh"
    after_local="/etc/after-upgradelocal.sh"
    before="before-upgrade.sh"
    after="after-upgrade.sh"

  Thus, we can solve the issue by making the .tgz an empty file
  by making a before-upgrade.sh in the factory.bin

Note on built-in switch:

  There is two ports on the board, POE through the power supply brick,
  the other is on the board. For whatever reason, in the ar71xx target,
  both ports were on the built-in switch on eth1. In order to make use
  of a port for WAN or a different LAN, one has to set up VLANs.

  In ath79, eth0 and eth1 is defined in the DTS so that the
  built-in switch is seen as eth0, but only for 1 port
  the other port is on eth1 without a built-in switch.

  eth0: switch0
    CPU is port 0
    board port is port 1

  eth1: POE port on the power brick

  Since there is two physical ports,
  it can be configured as a full router,
  with LAN for both wired and wireless.

  According to the Datasheet, the port that is not on the switch
  is connected to gmac0. It is preferred that gmac0 is chosen as WAN
  over a port on an internal switch, so that link status can pass
  to the kernel immediately which is more important for WAN connections.

Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[apply sorting in 01_leds, make factory recipe more generic, create common
device node, move label-mac to 02_network, add MAC addresses to commit
message, remove kmod-leds-gpio, use gzip directly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Martin Kennedy af9dee336d ath79: add support for Meraki MR16
Port device support for Meraki MR16 from the ar71xx target to ath79.

Specifications:

  * AR7161 CPU, 16 MiB Flash, 64 MiB RAM
  * One PoE-capable Gigabit Ethernet Port
  * AR9220 / AR9223 (2x2 11an / 11n) WLAN

Installation:

  * Requires TFTP server at 192.168.1.101, w/ initramfs & sysupgrade .bins
  * Open shell case and connect a USB to TTL cable to upper serial headers
  * Power on the router; connect to U-boot over 115200-baud connection
  * Interrupt U-boot process to boot Openwrt by running:
       setenv bootcmd bootm 0xbf0a0000; saveenv;
       tftpboot 0c00000 <filename-of-initramfs-kernel>.bin;
       bootm 0c00000;
  * Copy sysupgrade image to /tmp on MR16
  * sysupgrade /tmp/<filename-of-sysupgrade>.bin

Notes:

  - There are two separate ARTs in the partition (offset 0x1000/0x5000 and
    0x11000/0x15000) in the OEM device. I suspect this is an OEM artifact;
    possibly used to configure the radios for different regions,
    circumstances or RF frontends. Since the ar71xx target uses the
    second offsets, use that second set (0x11000 and 0x15000) for the ART.

  - kmod-owl-loader is still required to load the ART partition into the
    driver.

  - The manner of storing MAC addresses is updated from ar71xx; it is
    at 0x66 of the 'config' partition, where it was discovered that the
    OEM firmware stores it. This is set as read-only. If you are
    migrating from ar71xx and used the method mentioned above to
    upgrade, use kmod-mtd-rw or UCI to add the MAC back in. One more
    method for doing this is described below.

  - Migrating directly from ar71xx has not been thoroughly tested, but
    one method has been used a couple of times with good success,
    migrating 18.06.2 to a full image produced as of this commit. Please
    note that these instructions are only for experienced users, and/or
    those still able to open their device up to flash it via the serial
    headers should anything go wrong.

    1) Install kmod-mtd-rw and uboot-envtools
    2) Run `insmod mtd-rw.ko i_want_a_brick=1`
    3) Modify /etc/fw_env.config to point to the u-boot-env partition.
       The file /etc/fw_env.config should contain:

       # MTD device   env offset  env size    sector size
       /dev/mtd1      0x00000     0x10000     0x10000

       See https://openwrt.org/docs/techref/bootloader/uboot.config
       for more details.

    4) Run `fw_printenv` to verify everything is correct, as per the
       link above.
    5) Run `fw_setenv bootcmd bootm 0xbf0a0000` to set a new boot address.
    6) Manually modify /lib/upgrade/common.sh's get_image function:
       Change ...

       cat "$from" 2>/dev/null | $cmd

       ... into ...

       (
         dd if=/dev/zero bs=1 count=$((0x66)) ; # Pad the first 102 bytes
         echo -ne '\x00\x18\x0a\x12\x34\x56'  ; # Add in MAC address
         dd if=/dev/zero bs=1 count=$((0x20000-0x66-0x6)) ; # Pad the rest
         cat "$from" 2>/dev/null | $cmd
       )

       ... which, during the upgrade process, will pad the image by
       128K of zeroes-plus-MAC-address, in order for the ar71xx's
       firmware partition -- which starts at 0xbf080000 -- to be
       instead aligned with the ath79 firmware partition, which
       starts 128K later at 0xbf0a0000.

    7) Copy the sysupgrade image into /tmp, as above
    8) Run `sysupgrade -F /tmp/<sysupgrade>.bin`, then wait

    Again, this may BRICK YOUR DEVICE, so make *sure* to have your
    serial cable handy.

Addenda:

  - The MR12 should be able to be migrated in a nearly identical manner as
    it shares much of its hardware with the MR16.

  - Thank-you Chris B for copious help with this port.

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[fix typo in compat message, drop art DT label,
move 05_fix-compat-version to subtarget]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-31 17:41:21 +02:00
Petr Štetiar a14f5bb4bd treewide: use wpad-basic-wolfssl as default
In order to support SAE/WPA3-Personal in default images. Replace almost
all occurencies of wpad-basic and wpad-mini with wpad-basic-wolfssl for
consistency. Keep out ar71xx from the list as it won't be in the next
release and would only make backports harder.

Build-tested (build-bot settings):
ath79: generic, ramips: mt7620/mt76x8/rt305x, lantiq: xrx200/xway,
sunxi: a53

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[rebase, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-20 14:19:39 +02:00
Tomasz Maciej Nowak ebf71533f9 ath79: add support for ALLNET ALL-WAP02860AC
ALLNET ALL-WAP02860AC is a dual-band wireless access point.

Specification
SoC: Qualcomm Atheros QCA9558
RAM: 128 MB DDR2
Flash: 16 MB SPI NOR
WIFI: 2.4 GHz 3T3R integrated
      5 GHz 3T3R QCA9880 Mini PCIe card
Ethernet: 1x 10/100/1000 Mbps AR8035-A, PoE capable (802.3at)
LEDS: 5x, which four are GPIO controlled
Buttons: 1x GPIO controlled
UART: 4 pin header near Mini PCIe card, starting count from white
      triangle on PCB
      1. VCC 3.3V, 2. GND, 3. TX, 4. RX
      baud: 115200, parity: none, flow control: none

MAC addresses
Calibration data does not contain valid MAC addresses.
The calculated MAC addresses are chosen in accordance with OEM firmware.

Because of:
a) constrained environment (SNMP) when connecting through Telnet
   or SSH,
b) hard-coded kernel and rootfs sizes,
c) checksum verification of kerenel and rootfs images in bootloder,

creating factory image accepted by OEM web interface is difficult,
therefore, to install OpenWrt on this device UART connection is needed.
The teardown is simple, unscrew four screws to disassemble the casing,
plus two screws to separate mainboard from the casing.
Before flashing, be sure to have a copy of factory firmware, in case You
wish to revert to original firmware.

Installation
1. Prepare TFTP server with OpenWrt initramfs-kernel image.
2. Connect to LAN port.
3. Connect to UART port.
4. Power on the device and when prompted to stop autoboot, hit any key.
5. Alter U-Boot environment with following commands:
    setenv failsafe_boot bootm 0x9f0a0000
    saveenv
6. Adjust "ipaddr" and "serverip" addresses in U-Boot environment, use
   'setenv' to do that, then run following commands:
    tftpboot 0x81000000 <openwrt_initramfs-kernel_image_name>
    bootm 0x81000000
7. Wait about 1 minute for OpenWrt to boot.
8. Transfer OpenWrt sysupgrade image to /tmp directory and flash it
   with:
    sysupgrade -n /tmp/<openwrt_sysupgrade_image_name>
9. After flashing, the access point will reboot to OpenWrt. Wait few
   minutes, until the Power LED stops blinking, then it's ready for
   configuration.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
[add MAC address comment to commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-15 15:58:39 +02:00
Christoph Krapp 459c8c9ef8 ath79: add support for ZyXEL NBG6616
Specifications:

  SoC: Qualcomm Atheros QCA9557
  RAM: 128 MB (Nanya NT5TU32M16EG-AC)
  Flash: 16 MB (Macronix MX25L12845EMI-10G)
  Ethernet: 5x 10/100/1000 (1x WAN, 4x LAN)
  Wireless: QCA9557 2.4GHz (nbg), QCA9882 5GHz (ac)
  USB: 2x USB 2.0 port
  Buttons: 1x Reset
  Switches: 1x Wifi
  LEDs: 11 (Pwr, WAN, 4x LAN, 2x Wifi, 2x USB, WPS)

MAC addresses:

WAN *:3f uboot-env ethaddr + 3
LAN *:3e uboot-env ethaddr + 2
2.4GHz *:3c uboot-env ethaddr
5GHz *:3d uboot-env ethaddr + 1

The label contains all four MAC addresses, however the one without
increment is first, so this one is taken for label MAC address.

Notes:

The Wifi is controlled by an on/off button, i.e. has to be implemented
by a switch (EV_SW). Despite, it appears that GPIO_ACTIVE_HIGH needs
to be used, just like recently fixed for the NBG6716.
Both parameters have been wrong at ar71xx.

Flash Instructions:

At first the U-Boot variables need to be changed in order to boot the
new combined image format. ZyXEL uses a split kernel + root setup and
the current kernel is too large to fit into the partition. As resizing
didnt do the trick, I've decided to use the prefered combined image
approach to be future-kernel-enlargement-proof (thanks to blocktrron for
the assistance).

First add a new variable called boot_openwrt:
setenv boot_openwrt bootm 0x9F120000

After that overwrite the bootcmd and save the environment:
setenv bootcmd run boot_openwrt
saveenv

After that you can flash the openwrt factory image via TFTP. The servers
IP has to be 192.168.1.33. Connect to one of the LAN ports and hold the
WPS Button while booting. After a few seconds the NBG6616 will look for
a image file called 'ras.bin' and flash it.

Return to vendor firmware is possible by resetting the bootcmd:
setenv bootcmd run boot_flash
saveenv
and flashing the vendor image via the TFTP method as described above.

Accessing the 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.

| NBG6616> ?
| 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) ATRT 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)

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.

| NBG6616> ATSE NBG6616
| 00C91D7EAC3C

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 00C91D7EAC3C
| ATEN 1,10FDFF5

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

| NBG6616> ATEN 1,10FDFF5

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

| NBG6616> ATGU
| NBG6616#

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
[move keys to DTSI, adjust usb_power DT label, remove kernel config
change, extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 18:37:43 +02:00
Adrian Schmutzler d4ac0ad543 treewide: make dependency on kmod-usb-net selective
A bunch of kernel modules depends on kmod-usb-net, but does not
select it. Make AddDepends/usb-net selective, so we can drop
some redundant +kmod-usb-net definitions for DEVICE_PACKAGES.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 12:54:30 +02:00
Nicholas Smith c00b8dcf72 ath79: add support for Telco T1
Description:
    2x 100Mbps Etherent ports
    24V passive PoE
    64MB RAM
    16MB Flash
    2.4GHz WiFi
    1x WiFi antenna (RP-SMA connector)
    1x LTE antenna (SMA connector)
    Sierra Wireless MC7430 LTE modem

Flash instructions:
    Original firmware is based on OpenWrt.
    Flash using sysupgrade -n

SUPPORTED_DEVICES is added to support factory firmware.

Signed-off-by: Nicholas Smith <nicholas.smith@telcoantennas.com.au>
[add missing led_rssi0 DT label, add SUPPORTED_DEVICES]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-10 12:49:29 +02:00
Adrian Schmutzler 4f1a51f438 ath79: drop redundant kmods-leds-gpio
The ath79 target has CONFIG_LEDS_GPIO=y set in kernel config, so
no need to pull the kmod-leds-gpio module for specific devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-08-08 16:13:51 +02:00
Adrian Schmutzler 01a3e891d7 ath79: reorganize common image definitions for Netgear
Netgear currently has a special definition for tiny devices, which
is only used by two devices. Despite, it sets ups the IMAGE/default
definition individually for all devices, although there is actually
only one exception.

This merges the common parts into a single netgear_generic definition
(in contrast to netgear_ath79_nand), and adjusts the individual
definitions accordingly.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-29 12:08:16 +02:00
Leon M. George 15f585afc5 ath79: add support for Compex WPJ563
Specifications:

SoC: QCA9563
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
2 Gigabit ethernet ports
3×3 2.4GHz on-board radio
miniPCIe slot that supports 5GHz radio
PoE 24V passive or 36V-56V passive with optional IEEE 802.3af/at
USB 3.0 header

Installation:

To install, either start tftp in bin/targets/ath79/generic/ and use
the u-boot prompt over UART:

tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj563-squashfs-sysupgrade.bin
erase 0x9f680000 +1
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
boot

The cpximg file can be used with sysupgrade in the stock firmware (add
SSH key in luci for root access) or with the built-in cpximg loader.
The cpximg loader can be started either by holding the reset button
during power up or by entering the u-boot prompt and entering 'cpximg'.
Once it's running, a TFTP-server under 192.168.1.1 will accept the image
appropriate for the board revision that is etched on the board.

For example, if the board is labelled '7A02':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj563-squashfs-cpximg-7a02.bin

MAC addresses:

<&uboot 0x2e010>  *:71  (label)
<&uboot 0x2e018>  *:72
<&uboot 0x2e020>  *:73
<&uboot 0x2e028>  *:74

Only the first two are used (for ethernet), the WiFi modules have
separate (valid) addresses. The latter two addresses are not used.

Signed-off-by: Leon M. George <leon@georgemail.eu>
2020-07-26 02:14:45 +02:00
Sebastian Schaper 361c670a46 ath79: add support for D-Link DAP-1330/DAP-1365 A1
Port device support for DAP-1330 from the ar71xx target to ath79.

Additionally, images are generated for the European through-socket
case variant DAP-1365. Both devices run the same vendor firmware, the
only difference being the DAP_SIGNATURE field in the factory header.
The vendor's Web UI will display a model string stored in the flash.

Specifications:

 * QCA9533, 8 MiB Flash, 64 MiB RAM
 * One Ethernet Port (10/100)
 * Wall-plug style case (DAP-1365 with additional socket)
 * LED bargraph RSSI indicator

Installation:

 * Web UI: http://192.168.0.50 (or different address obtained via DHCP)
   There is no password set by default
 * Recovery Web UI: Keep reset button pressed during power-on
   until LED starts flashing red, upgrade via http://192.168.0.50
 * Some modern browsers may have problems flashing via the Web UI,
   if this occurs consider booting to recovery mode and flashing via:
   curl -F \
     files=@openwrt-ath79-generic-dlink_dap-1330-a1-squashfs-factory.bin \
     http://192.168.0.50/cgi/index

The device will use the same MAC address for both wired and wireless
interfaces, however it is stored at two different locations in the flash.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
2020-07-09 10:28:40 +02:00
Sungbo Eo 358aec7775 ath79: add support for Arduino Yun
Arduino Yun is a microcontroller development board, based on Atmel
ATmega32u4 and Atheros AR9331.

Specifications:
- MCU: ATmega32U4
- SoC: AR9331
- RAM: DDR2 64MB
- Flash: SPI NOR 16MB
- WiFi:
  - 2.4GHz: SoC internal
- Ethernet: 1x 10/100Mbps
- USB: 1x 2.0
- MicroSD: 1x SDHC

Notes:
- Stock firmware is based on OpenWrt AA.
- The SoC UART can be accessed only through the MCU.
  YunSerialTerminal is recommended for access to serial console.
- Stock firmware uses non-standard 250000 baudrate by default.
- The MCU can be reprogrammed from the SoC with avrdude linuxgpio.

Installation:
1.  Update U-Boot environment variables to adapt to new partition scheme.
    > setenv bootcmd "run addboard; run addtty; run addparts; run addrootfs; bootm 0x9f050000 || bootm 0x9fea0000"
    > setenv mtdparts "spi0.0:256k(u-boot)ro,64k(u-boot-env),15936k(firmware),64k(nvram),64k(art)ro"
    > saveenv
2.  Boot into stock firmware normally and perform sysupgrade with
    sysupgrade image.
    # sysupgrade -n -F /tmp/sysupgrade.bin

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2020-07-08 23:22:30 +02:00
Sebastian Schaper 14599c5945 ath79: add support for D-Link DCH-G020 Rev. A1
The DCH-G020 is a Smart Home Gateway for Z-Wave devices.

Specifications:

 * QCA9531, 16 MiB Flash, 64 MiB RAM
 * On-Board USB SD3503A Z-Wave dongle
 * GL850 USB 2.0 Hub (one rear port, internal Z-Wave)
 * Two Ethernet Ports (10/100)

Installation:

 * Web UI: http://192.168.0.60 (or different address obtained via DHCP)
   Login with 'admin' and the 6-digit PIN Code from the bottom label
 * Recovery Web UI: Keep reset button pressed during power-on
   until LED starts flashing red, upgrade via http://192.168.0.60
 * Some modern browsers may have problems flashing via the Web UI,
   if this occurs consider booting to recovery mode and flashing via:
   curl -F \
     files=@openwrt-ath79-generic-dlink_dch-g020-a1-squashfs-factory.bin \
     http://192.168.0.60/cgi/index

Known issues:

 * Real-Time-Clock is not working as there is currently no matching driver
   It is still included in the dts as compatible = "pericom,pt7c43390";
 * openzwave was tested on v19.07 (running MinOZW as a proof-of-concept),
   but the package grew too big as lots of device pictures were included,
   thus any use of Z-Wave is up to the user (e.g. extroot and domoticz)

The device will use the same MAC address for both wired and wireless
interfaces, however it is stored at two different locations in the flash.

Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
2020-07-08 22:54:34 +02:00
Andrey Bondar ba59021d64 ath79: add support for 8devices Lima board
Specification:

  • 650/600/216 MHz (CPU/DDR/AHB)
  • 64 MB of RAM (DDR2)
  • 32 MB of FLASH
  • 2T2R 2.4 GHz
  • 2x 10/100 Mbps Ethernet
  • 1x USB 2.0 Host socket
  • 1x miniPCIe slot
  • UART for serial console
  • 14x GPIO

Flash instructions:

Upgrading from ar71xx target:

  • Upload image into the board:
    scp openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin
    root@192.168.1.1/tmp/
  • Run sysupgrade
    sysupgrade -F /tmp/openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin

Upgrading from u-boot:

  • Set up tftp server with
    openwrt-ath79-generic-8dev_lima-initramfs-kernel.bin
  • Go to u-boot (reboot and press ESC when prompted)
  • Set TFTP server IP
    setenv serverip 192.168.1.254
  • Set device ip from the same subnet
    setenv ipaddr 192.168.1.1
  • Copy new firmware to board
    tftpboot 0x82000000 initramfs.bin
  • Boot OpenWRT
    bootm 0x82000000
  • Upload image openwrt-ath79-generic-8dev_lima-squashfs-sysupgrade.bin into
    the board
  • Run sysupgrade.

Signed-off-by: Andrey Bondar <a.bondar@8devices.com>
2020-07-08 16:07:05 +02:00
Antti Seppälä a175bc8f36 ath79: add support for GL.iNet GL-MiFi
Add support for the ar71xx supported GL.iNet GL-MiFi to ath79.

Specifications:
 - Atheros AR9331
 - 64 MB of RAM
 - 16 MB of FLASH (SPI NOR)
 - 2x 10/100/1000 Mbps Ethernet
 - 2.4GHz (AR9330), 802.11b/g/n
 - 1x USB 2.0 (vbus driven by GPIO)
 - 4x LED, driven by GPIO
 - 1x button (reset)
 - 1x mini pci-e slot (vcc driven by GPIO)

Flash instructions:

Vendor software is based on openwrt so you can flash the sysupgrade
image via the vendor GUI or using command line sysupgrade utility.
Make sure to not save configuration over reflash as uci settings
differ between versions.

Note on MAC addresses:

Even though the platform is capable to providing separate MAC addresses
to the interfaces vendor firmware does not seem to take advantage of
that. It appears that there is only single unique pre-programmed
address in the art partition and vendor firmware uses that for
every interface (eth0/eth1/wlan0). Similar behaviour has also been
implemented in this patch.

Note on GPIOs:

In vendor firmware the gpio controlling mini pci-e slot is named
3gcontrol while it actually controls power supply to the entire mini
pci-e slot. Therefore a more descriptive name (minipcie) was chosen.
Also during development of this patch it became apparent that the
polarity of the signal is actually active low rather than active high
that can be found in vendor firmware.

Acknowledgements:

This patch is based on earlier work[1] done by Kyson Lok. Since the
initial mailing-list submission the patch has been modified to comply
with current openwrt naming schemes and dts conventions.

[1] http://lists.openwrt.org/pipermail/openwrt-devel/2018-September/019576.html

Signed-off-by: Antti Seppälä <a.seppala@gmail.com>
2020-07-03 20:48:05 +02:00
Leon M. George a0bb356612 ath79: add support for Compex WPJ344
Specifications:

SoC: AR9344
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
2 Gigabit ethernet ports
2×2 2.4GHz on-board radio
miniPCIe slot that supports 5GHz radio
PoE 48V IEEE 802.3af/at - 24V passive optional
USB 2.0 header

Installation:

To install, either start tftp in bin/targets/ath79/generic/ and use
the u-boot prompt over UART:

tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj344-16m-squashfs-sysupgrade.bin
erase 0x9f030000 +$filesize
erase 0x9f680000 +1
cp.b $fileaddr 0x9f030000 $filesize
boot

The cpximg file can be used with sysupgrade in the stock firmware (add
SSH key in luci for root access) or with the built-in cpximg loader.
The cpximg loader can be started either by holding the reset button
during power up or by entering the u-boot prompt and entering 'cpximg'.
Once it's running, a TFTP-server under 192.168.1.1 will accept the image
appropriate for the board revision that is etched on the board.

For example, if the board is labelled '6A08':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj344-16m-squashfs-cpximg-6a08.bin

MAC addresses:

<&uboot 0x2e010>  *:99  (label)
<&uboot 0x2e018>  *:9a
<&uboot 0x2e020>  *:9b
<&uboot 0x2e028>  *:9c

Only the first two are used (for ethernet), the WiFi modules have
separate (valid) addresses. The latter two addresses are not used.

Signed-off-by: Leon M. George <leon@georgemail.eu>
[minor commit message adjustments, drop gpio in DTS, DTS style fixes,
sorting, drop unused cpximg recipe]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-07-03 17:37:02 +02:00
Leon M. George 9f261e36de ath79: build Compex WPJ531 cpximg files
Generate additional images that are compatible to the cpximg loader.
The cpximg loader can be started either by holding the reset button during
power up or by entering the u-boot prompt and entering 'cpximg'.
Once it's running, a TFTP-server under 192.168.1.1 will accept the image
appropriate for the board revision that is etched on the board.

For example, if the board is labelled '7A04':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj531-16m-squashfs-cpximg-7A04.bin

These files can also be used with the sysupgrade utility in stock images (add
SSH key in luci for root access).

Signed-off-by: Leon M. George <leon@georgemail.eu>
[fix sorting of definitions]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-28 00:26:39 +02:00
Leon M. George e10dd48360 ath79: add support for Compex WPJ531 (16M)
Specifications:

SoC: QCA9531
DRAM: 128MB DDR2
Flash: 16MB SPI-NOR
2 100MBit ethernet ports
2×2 2.4GHz on-board radio
miniPCIe slot that supports 5GHz radio
PoE 24V - 48V IEEE 802.3af optional
USB 2.0 header

Installation:

To install, start a tftp server in bin/targets/ath79/generic/ and use the
u-boot prompt over UART:

tftpboot 0x80500000 openwrt-ath79-generic-compex_wpj531-16m-squashfs-sysupgrade.bin
erase 0x9f030000 +$filesize
erase 0x9f680000 +1
cp.b $fileaddr 0x9f030000 $filesize
boot

The cpximg file can be used with sysupgrade in the stock firmware (add SSH key
in luci for root access).

Another way is to hold the reset button during power up or running 'cpximg' in
the u-boot prompt.
Once the last LED starts flashing regularly, a TFTP-server under 192.168.1.1
will accept the image appropriate for the board revision that is etched on the
board.

For example, if the board is labelled '7A04':

tftp -v -m binary 192.168.1.1 -c put openwrt-ath79-generic-compex_wpj531-16m-squashfs-cpximg-7A04.bin

MAC addresses:

<&uboot 0x2e010>  *:cb  (label)
<&uboot 0x2e018>  *:cc
<&uboot 0x2e020>  *:cd
<&uboot 0x2e028>  *:ce

Only the first two are used (for ethernet), the WiFi modules have
separate (valid) addresses. The latter two addresses are not used.

Signed-off-by: Leon M. George <leon@georgemail.eu>
[commit title/message facelift, fix rssileds, add led aliases]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-28 00:26:39 +02:00
Natalie Kagelmacher 8ff631feff ath79: add support for AVM FRITZ!WLAN Repeater DVB-C
This commit adds support for the AVM FRITZ!WLAN Repeater DVB-C

SOC:   Qualcomm Atheros QCA9556
RAM:   64 MiB
FLASH: 16 MB SPI-NOR
WLAN:  QCA9556 3T3R 2.4 GHZ b/g/n and
       QCA9880 3T3R 5 GHz n/ac
ETH:   Atheros AR8033 1000 Base-T
DVB-C: EM28174 with MaxLinear MXL251 tuner
BTN:   WPS Button
LED:   Power, WLAN, TV, RSSI0-4

Tested and working:
 - Ethernet (correct MAC, gigabit, iperf3 about 200 Mbit/s)
 - 2.4 GHz Wi-Fi (correct MAC)
 - 5 GHz Wi-Fi (correct MAC)
 - WPS Button (tested using wifitoggle)
 - LEDs
 - Installation via EVA bootloader (FTP recovery)
 - OpenWrt sysupgrade (both CLI and LuCI)
 - Download of "urlader" (mtd0)

Not working:
 - Internal USB
 - DVB-C em28174+MxL251 (depends on internal USB)

Installation via EVA bootloader (FTP recovery):
Set NIC to 192.168.178.3/24 gateway 192.168.178.1 and power on the device,
connect to 192.168.178.1 through FTP and sign in with adam2/adam2:

ftp> quote USER adam2
ftp> quote PASS adam2
ftp> binary
ftp> debug
ftp> passive
ftp> quote MEDIA FLSH
ftp> put openwrt-sysupgrade.bin mtd1

Wait for "Transfer complete" together with the transfer details.
Wait two minutes to make sure flash is complete (just to be safe).

Then restart the device (power off and on) to boot into OpenWrt.
Revert your NIC settings to reach OpenWrt at 192.168.1.1

Signed-off-by: Natalie Kagelmacher <nataliek@pm.me>
[fixed sorting - removed change to other board -
prettified commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-06-25 02:35:35 +02:00
Stijn Tintel cd09f26660 ath79: add support for D-Link DAP-2695-A1
Hardware:
* SoC: Qualcomm Atheros QCA9558
* RAM: 256MB
* Flash: 16MB SPI NOR
* Ethernet: 2x 10/100/1000 (1x 802.3at PoE-PD)
* WiFi 2.4GHz: Qualcomm Atheros QCA9558
* WiFi 5GHz: Qualcomm Ahteros QCA9880-2R4E
* LEDS: 1x 5GHz, 1x 2.4GHz, 1x LAN1(POE), 1x LAN2, 1x POWER
* Buttons: 1x RESET
* UART: 1x RJ45 RS-232 Console port

Installation via stock firmware:
* Install the factory image via the stock firmware web interface

Installation via bootloader Emergency Web Server:
* Connect your PC to the LAN1(PoE) port
* Configure your PC with IP address 192.168.0.90
* Open a serial console to the Console port (115200,8n1)
* Press "q" within 2s when "press 'q' to stop autoboot" appears
* Open http://192.168.0.50 in a browser
* Upload either the factory or the sysupgrade image
* Once you see "write image into flash...OK,dest addr=0x9f070000" you
  can power-cycle the device. Ignore "checksum bad" messages.

Setting the MAC addresses for the ethernet interfaces via
/etc/board.d/02_network adds the following snippets to
/etc/config/network:

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr 'xx:xx:xx:xx:xx:xx'

config device 'wan_eth1_2_dev'
        option name 'eth1.2'
        option macaddr 'xx:xx:xx:xx:xx:xx'

This would result in the proper MAC addresses being set for the VLAN
subinterfaces, but the parent interfaces would still have a random MAC
address. Using untagged VLANs could solve this, but would still leave
those extra snippets in /etc/config/network, and then the device VLAN
setup would differ from the one used in ar71xx. Therefore, the MAC
addresses of the ethernet interfaces are being set via preinit instead.

The bdcfg partition contains 4 MAC address labels:
 - lanmac
 - wanmac
 - wlanmac
 - wlanmac_a

The first 3 all contain the same MAC address, which is also the one on
the label.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-11 19:44:45 +03:00
Renaud Lepage 108df3eabb ath79: add support for the Netgear WNDRMAC v1
The Netgear WNDRMAC v1 is a hardware variant of the Netgear WNDR3700 v2

Specifications
==============
* SoC: Atheros AR7161
* RAM: 64mb
* Flash on board: 16mb
* WiFi: Atheros AR9220 (a/n), Atheros AR9223 (b/g/n)
* Ethernet: RealTek RTL8366SR (1xWAN, 4xLAN, Gigabit)
* Power: 12 VDC, 2.5 A
* Full specs on [openwrt.org](https://openwrt.org/toh/hwdata/netgear/netgear_wndrmac_v1)

Flash Instructions
==================
It is possible to use the OEM Upgrade page to install the `factory`
variant of the firmware.

After the initial upgrade, you will need to telnet into the router
(default IP 192.168.1.1) to install anything. You may install LuCI
this way. At this point, you will have a web interface to configure
OpenWRT on the WNDRMAC v1.

Please use the `sysupgrade` variant for subsequent flashes.

Recovery Instructions
=====================
A TFTP-based recovery flash is possible if the need arises. Please refer
to the WNDR3700 page on openwrt.org for details.

https://openwrt.org/toh/netgear/wndr3700#troubleshooting_and_recovery

Signed-off-by: Renaud Lepage <root@cybikbase.com>
[update DTSI include name]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-11 01:44:13 +02:00
Renaud Lepage 7f297e740b ath79: add support for the Netgear WNDRMAC v2
The Netgear WNDRMAC v2 is a hardware variant of the Netgear WNDR3800

Specifications
==============
* SoC: Atheros AR7161
* RAM: 128mb
* Flash on board: 16mb
* WiFi: Atheros AR9220 (a/n), Atheros AR9223 (b/g/n)
* Ethernet: RealTek RTL8366SR (1xWAN, 4xLAN, Gigabit)
* Serial console: Yes, 115200 / 8N1 (JTAG)
* USB: 1x2.0
* Power: 12 VDC, 2.5 A
* Full specs on [openwrt.org](https://openwrt.org/toh/hwdata/netgear/netgear_wndrmac_v2)

Flash Instructions
==================
It is possible to use the OEM Upgrade page to install the `factory`
variant of the firmware.

After the initial upgrade, you will need to telnet into the router
(default IP 192.168.1.1) to install anything. You may install LuCI
this way. At this point, you will have a web interface to configure
OpenWRT on the WNDRMAC v2.

Please use the `sysupgrade` variant for subsequent flashes.

Recovery Instructions
=====================
A TFTP-based recovery flash is possible if the need arises. Please refer
to the WNDR3800 page on openwrt.org for details.

https://openwrt.org/toh/netgear/wndr3800#recovery_flash_in_failsafe_mode

Signed-off-by: Renaud Lepage <root@cybikbase.com>
[do not add device to uboot-envtools, update DTSI name]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-06-11 01:44:13 +02:00
Pavel Balan ad84c09502 ath79: add support for COMFAST CF-E130N v2
This patch adds support for the COMFAST CF-E130N v2, an outdoor wireless
CPE with a single Ethernet port and a 802.11bgn radio.

Specifications:

 - QCA9531 SoC
 - 1x 10/100 Mbps Ethernet with PoE-in support
 - 64 MB of RAM (DDR2)
 - 16 MB of FLASH
 - 5 dBi built-in antenna
 - POWER/LAN/WLAN green LEDs
 - 4x RSSI LEDs (2x red, 2x green)
 - UART (115200 8N1) and GPIO (J9) headers on PCB

Flashing instructions:

 The original firmware is based on OpenWrt so a sysupgrade image can be
 installed via the stock web GUI.

 The U-boot bootloader also contains a backup TFTP client to upload the
 firmware from. Upon boot, it checks its ethernet network for the IP
 192.168.1.10. Host a TFTP server and provide the image to be flashed as
 file firmware_auto.bin.

MAC address setup:

The art partition contains four consecutive MAC addresses:

0x0    aa:bb:cc:xx:xx:c4
0x6    aa:bb:cc:xx:xx:c6
0x1002 aa:bb:cc:xx:xx:c5
0x5006 aa:bb:cc:xx:xx:c7

However, the manufacturer in its infinite wisdom decided that one address
is enough and both eth0 and WiFi get the MAC address from 0x0 (yes, that's
overwriting the existing and valid address in 0x1002). This is obviously
also the address on the device's label.

Signed-off-by: Pavel Balan <admin@kryma.net>
[fix configs partition, fix IMAGE_SIZE, add MAC address comment, rename
ATH_SOC to SOC]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-05-28 01:47:54 +02:00
David Bauer ebddc5f984 ath79: add support for Enterasys WS-AP3705i
Hardware
--------
SoC:    Atheros AR9344
RAM:    128M DDR2
FLASH:  2x Macronix MX25L12845EM
        2x 16MiB SPI-NOR
WLAN2:  Atheros AR9344 2x2 2T2R
WLAN5:  Atheros AR9580 2x2 2T2R
SERIAL: Cisco-RJ45 on the back (115200 8n1)

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

The U-Boot CLI is password protected (using the same credentials as the
OS). Default is admin/new2day.

1. Download the OpenWrt initramfs-image. Place it into a TFTP server
   root directory and rename it to 1401A8C0.img. Configure the TFTP
   server to listen at 192.168.1.66/24.

2. Connect the TFTP server to the access point.

3. Connect to the serial console of the access point. Attach power and
   interrupt the boot procedure when prompted (bootdelay is 1 second).

4. Configure the U-Boot environment for booting OpenWrt from Ram and
   flash:

   $ setenv boot_openwrt 'setenv bootargs; bootm 0xbf230000'
   $ setenv ramboot_openwrt 'setenv serverip 192.168.1.66;
     tftpboot 0x85000000; bootm'
   $ setenv bootcmd 'run boot_openwrt'
   $ saveenv

5. Load OpenWrt into memory:

   $ run ramboot_openwrt

   Wait for the image to boot.

6. Transfer the OpenWrt sysupgrade image to the device. Write the image
   to flash using sysupgrade:

   $ sysupgrade -n /path/to/openwrt-sysuograde.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-05-22 21:54:30 +02:00
Daniel Golle aa4a33ac62 ath79: add support for Teltonika RUT955 H7V3C0
This board was previously supported in ar71xx as 'RUT9XX'. The
difference between that and the other RUT955 board already supported in
ath79 is that instead of the SPI shift registers driving the LEDs and
digital outputs that model got an I2C GPIO expander instead.

To support LEDs during early boot and interrupt-driven digital inputs,
I2C support as well as support for PCA953x has to be built-in and
cannot be kernel modules, hence select those symbols for ath79/generic.

Specification:

- 550/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 4x 10/100 Mbps Ethernet, with passive PoE support on LAN1
- 2T2R 2,4 GHz (AR9344)
- built-in 4G/3G module (example: Quectel EC-25EU)
- internal microSD slot (spi-mmc, buggy and disabled for now)
- RS232 on D-Sub9 port (Cypress ACM via USB, /dev/ttyACM0)
- RS422/RS485 (AR934x high speed UART, /dev/ttyATH1)
- analog 0-24V input (MCP3221)
- various digital inputs and outputs incl. a relay
- 11x LED (4 are driven by AR9344, 7 by PCA9539)
- 2x miniSIM slot (can be swapped via GPIO)
- 2x RP-SMA/F (Wi-Fi), 3x SMA/F (2x WWAN, GPS)
- 1x button (reset)
- DC jack for main power input (9-30 V)
- debugging UART available on PCB edge connector

Serial console (/dev/ttyS0) pinout:

- RX: pin1 (square) on top side of the main PCB (AR9344 is on top)
- TX: pin1 (square) on bottom side

Flash instruction:

Vendor firmware is based on OpenWrt CC release. Use the "factory" image
directly in GUI (make sure to uncheck "keep settings") or in U-Boot web
based recovery. To avoid any problems, make sure to first update vendor
firmware to latest version - "factory" image was successfully tested on
device running "RUT9XX_R_00.06.051" firmware and U-Boot "3.0.1".

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-04-29 21:32:35 +01:00
Álvaro Fernández Rojas 2e5e9b459e ath10k-ct-firmware: rename ct-htt packages
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2020-04-28 09:33:09 +02:00
David Bauer 8d9c1087e4 ath79: add support for AVM FRITZ!WLAN Repeater 450E
SOC:    Qualcomm QCA9556 (Scorpion) 560MHz MIPS74Kc
RAM:    64MB Zentel A3R12E40CBF DDR2
FLASH:  16MiB Winbond W25Q128 SPI NOR
WLAN1:  QCA9556 2.4 GHz 802.11b/g/n 3x3
INPUT:  WPS button
LED:    Power, WiFi, LAN, RSSI indicator
Serial: Header Next to Black metal shield
        Pinout is 3.3V - RX - TX - GND (Square Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

Installation via EVA:
In the first seconds after Power is connected, the bootloader will
listen for FTP connections on 192.168.178.1. Firmware can be uploaded
like following:

  ftp> quote USER adam2
  ftp> quote PASS adam2
  ftp> binary
  ftp> debug
  ftp> passive
  ftp> quote MEDIA FLSH
  ftp> put openwrt-sysupgrade.bin mtd1

Note that this procedure might take up to two minutes.
You need to powercycle the device afterwards to boot OpenWRT.

Tested-by: Andreas Ziegler <dev@andreas-ziegler.de>
Signed-off-by: David Bauer <mail@david-bauer.net>
2020-04-19 16:45:40 +02:00
David Bauer edf812e25c ath79: remove stray pipe
Fixes: 8918c038f3 ("ath79: add support for AVM FRITZ!WLAN Repeater 1750E")

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-04-17 14:15:09 +02:00
David Bauer 8918c038f3 ath79: add support for AVM FRITZ!WLAN Repeater 1750E
This commit adds support for the AVM Fritz!WLAN Repeater 1750E

SOC:	Qualcomm QCA9556 (Scorpion) 720MHz MIPS74Kc
RAM:    64MB Zentel A3R12E40CBF DDR2
FLASH:  16MiB Winbond W25Q128 SPI NOR
WLAN1:  QCA9556 2.4 GHz 802.11b/g/n 3x3
WLAN2:  QCA9880 5 GHz 802.11 n/ac 3x3
INPUT:  WPS button
LED:    Power, WiFi, LAN, RSSI indicator
Serial: Header Next to Black metal shield
        Pinout is 3.3V - RX - TX - GND (Square Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

Tested and working:
 - Ethernet
 - 2.4 GHz WiFi (correct MAC)
 - 5 GHz WiFi (correct MAC)
 - Installation via EVA bootloader
 - OpenWRT sysupgrade
 - Buttons
 - LEDs

Installation via EVA:
In the first seconds after Power is connected, the bootloader will
listen for FTP connections on 192.168.178.1. Firmware can be uploaded
like following:

  ftp> quote USER adam2
  ftp> quote PASS adam2
  ftp> binary
  ftp> debug
  ftp> passive
  ftp> quote MEDIA FLSH
  ftp> put openwrt-sysupgrade.bin mtd1

Note that this procedure might take up to two minutes.
You need to powercycle the Device afterwards to boot OpenWRT.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-04-17 13:27:40 +02:00
Roman Hampel cd510e775b ath79: add support for Comfast CF-WR752AC v1
Specifications:

- Qualcomm QCA9531 + QCA9886
- dual band, antenna 2*3dBi
- Output power 50mW (17dBm)
- 1x 10/100 Mbps LAN RJ45
- 128 MB RAM / 16 MB FLASH (w25q128)
- 3 LEDs (red/green/blue)
  incorporated in
  "color wheel reset switch"
- UART 115200 8N1

Flashing instructions:

 The U-boot bootloader contains a recovery HTTP server
 to upload the  firmware. Push the reset button while powering the
 device on and keep it pressed for ~10 seconds. The device's LEDs will
 blink several times and the recovery page will be at
 http://192.168.1.1; use it to upload the sysupgrade image.

 Alternatively, the original firmware is based on OpenWrt so a
 sysupgrade image can be installed via the stock web GUI. Settings from
 the original firmware will be saved and restored on the new one, so a
 factory reset will be needed. To do so, once the new firmware is flashed,
 enter into failsafe mode by pressing the reset button several times during
 the boot process, until it starts flashing. Once in failsafe mode, perform
 a factory reset as usual.

LED-Info:

 The LEDs on the Comfast stock fw have a very proprietary behaviour,
 corresponding to the user selected working mode (AP, ROUTER or REPEATER).
 In the first two cases, only blue is used for status and LAN signaling. When
 using the latter, blue is always off (except for sysupgrade), either red
 signals bad rssi on master-link, or green good. Since the default working
 mode of OpenWrt resembles that of a router/AP, the default behavior is
 implemented accordingly.

MAC addresses (art partition):

location  address (example)    use in vendor firmware
0x0       xx:xx:xx:xx:xc:f8 -> eth0
0x6       xx:xx:xx:xx:xc:fa -> wlan5g (+2)
0x1002    xx:xx:xx:xx:xc:f9 -> not used
0x5006    xx:xx:xx:xx:xc:fb -> not used
---       xx:xx:xx:xx:xd:02 -> wlan2g (+10)

The same strange situation has already been observed and documented
for COMFAST CF-E560AC.

Signed-off-by: Roman Hampel <rhamp@arcor.de>
Co-developed-by: Joao Albuquerque <joaohccalbu@gmail.com>
Signed-off-by: Joao Albuquerque <joaohccalbu@gmail.com>
[adjust and extend commit message, rebase, minor DTS adjustments,
add correct MAC address for wmac, change RSSI LED names and behavior]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-09 01:06:37 +02:00
Chris Morgan 7daab62861 ath79: add support for Comfast CF-EW72
Specifications:
Qualcomm/Atheros QCA9531 + QCA9886
2x 10/100 Mbps Ethernet, with 48v PoE
2T2R 2.4 GHz, 802.11b/g/n
2T2R 5 GHz, 802.11a/n/ac
128MB RAM
16MB SPI Flash
4x LED (Always On Power, LAN, WAN, WLAN)

Flashing Instructions:
Original firmware is based on OpenWRT, so flashing the sysupgrade image on
the factory firmware is sufficient.

Tested: Reset button, WAN LED, LAN LED, Power LED (always on, not much
to test), WLAN LED (one LED only for 2 interfaces, by default it gets
assigned to the first interface), MAC addresses (match factory firmware).
My LAN factory MAC address ends in F2.

use	stock_mac	art_loc
lan	:f2		0x0
wan	:f3		0x1002
5g	:f4		0x6
2g	:f5		0x5006

Since MAC address flash locations do not really match their use in vendor
firmware (e.g. address from 5 GHz calibration data is assigned to 2.4 GHz
WiFi), just calculate the MAC addresses with an offset based on 0x0 address.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
[add MAC address comment]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-04-07 01:00:10 +02:00
Sungbo Eo 3f14f034fb treewide: omit IMAGE_SIZE argument from check-size
Now that check-size uses IMAGE_SIZE by default, we can skip the argument from
image recipes to reduce redundancy.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[do not touch ar71xx]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-03-21 20:02:55 +01:00
Roger Pueyo Centelles a66eee6336 ath79: add mikrotik subtarget
This commit creates the ath79/mikrotik subtarget in order to support
MikroTik devices based on Qualcomm Atheros MIPS SoCs.

MikroTik devices need a couple of specific features: the split MiNOR
firmware MTD format, which is not used by other devices, and the 4k
sector erase size on SPI NOR storage, which can not be added to the
ath79/generic and ath79/nand subtargets now.

Additionally, the commit moves the two MikroTik devices already in
the generic and nand subtargets to this new one.

Tested on the RB922 board and the wAP AC router.

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
2020-03-17 11:50:47 +01:00
Sungbo Eo 4caaa778f7 kernel: make kmod-i2c-core selected by dependent modules
Currently kmod-i2c-* will not get into images unless kmod-i2c-core is added to
DEVICE_PACKAGES as well. By changing the dependencies from "depends on" to
"select", we do not have the issue anymore.

Furthermore, we can remove most occurrences of the package from DEVICE_PACKAGES
and similar variables, as it is now pulled by dependent modules such as:
- kmod-hwmon-lm75
- kmod-i2c-gpio
- kmod-i2c-gpio-custom
- kmod-i2c-mux
- kmod-i2c-ralink

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
[do not touch ar71xx]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-03-13 15:40:43 +01:00
Davide Fioravanti dfb7a4ce5d ath79: add support for Sitecom WLR-8100
Sitecom WLR-8100 v1 002 (marketed as X8 AC1750) is a dual band wireless
router.

Specification:

- Qualcomm Atheros SoC QCA9558
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (Macronix MX25L12845EMI-10G - SPI NOR)
- 5x 10/100/1000 Mbps Ethernet
- 3T3R 2.4 GHz (QCA9558 WMAC)
- 3T3R 5.8 Ghz (QCA9880-BR4A)
- 1x USB 3.0 (Etron EJ168A)
- 1x USB 2.0
- 9x LEDs
- 2x GPIO buttons

Everything working.
Installation and restore procedure tested

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.

Restore OEM FW (Linux only)
1. Download OEM FW from website (tested with WLR-8100v1002-firmware-v27.dlf)
2. Compile the FW for this router and locate the "mksenaofw" tool
	in build_dir/host/firmware-utils/bin/ inside the OpenWrt buildroot
3. Execute "mksenaofw -d WLR-8100v1002-firmware-v27.dlf -o WLR-8100v1002-firmware-v27.dlf.out" where:
	WLR-8100v1002-firmware-v27.dlf is the path to the input file
		(use the downloaded file)
	WLR-8100v1002-firmware-v27.dlf.out is the path to the output file
		(you can use the filename you want)
4. Flash the new WLR-8100v1002-firmware-v27.dlf.out file. WARNING: Do not keep settings.

Additional notes.
The original firmware has the following button configuration:
- Press for 2s the 2.4GHz button: WPS for 2.4GHz
- Press for 2s the 5GHz button: WPS for 5GHz
- Press for 15s both 2.4GHz and 5GHz buttons: Reset
I am not able to replicate this behaviour, so I used the following configuration:
- Press the 2.4GHz button: RFKILL (disable/enable every wireless interfaces)
- Press the 5GHz button: Reset

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
2020-03-07 11:02:13 +08:00
Manuel Giganto b2130b9ce8 ath79: add support for Devolo Magic 2 WIFI
This patch support Devolo Magic 2 WIFI, board devolo_dlan2-2400-ac.
This device is a plc wifi AC2400 router/extender with 2 Ethernet
ports, has a G.hn PLC and uses LCMP protocol from Home Grid Forum.

Hardware:
   SoC:         AR9344
   CPU:         560 MHz
   Flash:       16 MiB (W25Q128JVSIQ)
   RAM:         128 MiB DDR2
   Ethernet:    2xLAN 10/100/1000
   PLC:         88LX5152 (MaxLinear G.hn)
   PLC Flash:   W25Q32JVSSIQ
   PLC Uplink:  1Gbps MIMO
   PLC Link:    RGMII 1Gbps (WAN)
   WiFi:        Atheros AR9340 2.4GHz 802.11bgn
                Atheros AR9882-BR4A 5GHz 802.11ac
   Switch:      QCA8337, Port0:CPU, Port2:PLC, Port3:LAN1, Port4:LAN2
   Button:      3x Buttons (Reset, wifi and plc)
   LED:         3x Leds (wifi, plc white, plc red)
   GPIO Switch: 11-PLC Pairing (Active Low)
                13-PLC Enable
                21-WLAN power

MACs Details verified with the stock firmware:
   Radio1: 2.4 GHz &wmac     *:4c Art location: 0x1002
   Radio0: 5.0 GHz &pcie     *:4d Art location: 0x5006
   Ethernet        &ethernet *:4e = 2.4 GHz + 2
   PLC uplink      ---       *:4f = 2.4 GHz + 3
Label MAC address is from PLC uplink

OEM SSID: echo devolo-$(grep SerialNumber /dev/mtd1 | grep -o ...$)
OEM WiFi password: grep DlanSecurityID /dev/mtd1|tr -d -|cut -d'=' -f 2

Recommendations: Configure and link your PLC with OEM firmware
BEFORE you flash the device. PLC configuration/link should
remain in different memory and should work straight forward
after flashing.

Restrictions: PLC link detection to trigger plc red led is not
available. PLC G.hn chip is not compatible with open-plc-tools,
it uses LCMP protocol with AES-128 and requires different
software.

Notes: Pairing should be possible with gpio switch. Default
configuration will trigger wifi led with 2.4Ghz wifi traffic
and plc white led with wan traffic.

Flash instruction (TFTP):
 1. Set PC to fixed ip address 192.168.0.100
 2. Download the sysupgrade image and rename it to uploadfile
 3. Start a tftp server with the image file in its root directory
 4. Turn off the router
 5. Press and hold Reset button
 6. Turn on router with the reset button pressed and wait ~15 seconds
 7. Release the reset button and after a short time
    the firmware should be transferred from the tftp server
 8. Allow 1-2 minutes for the first boot.

Signed-off-by: Manuel Giganto <mgigantoregistros@gmail.com>
2020-03-07 11:02:13 +08:00
Daniel Golle d1130ad265 ath79: add support for Teltonika RUT955
Specification:

- 550/400/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 4x 10/100 Mbps Ethernet, with passive PoE support on LAN1
- 2T2R 2,4 GHz (AR9344)
- built-in 4G/3G module (example: Quectel EC-25EU)
- internal microSD slot (spi-mmc, buggy and disabled for now)
- RS232 on D-Sub9 port (Cypress ACM via USB, /dev/ttyACM0)
- RS422/RS485 (AR934x high speed UART, /dev/ttyATH1)
- analog 0-24V input (MCP3221)
- various digital inputs and outputs incl. a relay
- 11x LED (4 are driven by AR9344, 7 by 74HC595)
- 2x miniSIM slot (can be swapped via GPIO)
- 2x RP-SMA/F (Wi-Fi), 3x SMA/F (2x WWAN, GPS)
- 1x button (reset)
- DC jack for main power input (9-30 V)
- debugging UART available on PCB edge connector

Serial console (/dev/ttyS0) pinout:

- RX: pin1 (square) on top side of the main PCB (AR9344 is on top)
- TX: pin1 (square) on bottom side

Flash instruction:

Vendor firmware is based on OpenWrt CC release. Use the "factory" image
directly in GUI (make sure to uncheck "keep settings") or in U-Boot web
based recovery. To avoid any problems, make sure to first update vendor
firmware to latest version - "factory" image was successfully tested on
device running "RUT9XX_R_00.06.051" firmware and U-Boot "3.0.2".

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2020-02-21 22:35:12 +01:00
David Bauer 0709943182 ath79: correct Siemens WS-AP3610 blocksize
With the wrong blocksize, the rootfs was not positioned on the boundary
of a block, thus breaking the mtdsplit driver.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-02-20 10:41:12 +01:00
David Bauer d2b8ccb1c0 ath79: add support for Siemens WS-AP3610
Hardware
--------
SoC:  Atheros AR7161
RAM:  Samsung K4H511638D-UCCC
      2x 64M DDR1
SPI:  Micron M25P128 (16M)
WiFi: Atheros AR9160 bgn
      Atheros AR9160 an
ETH:  Broadcom BCM5481
LED:  Power (Green/Red)
      ETH (Green / Blue / Yellow)
          (PHY-controlled)
      WiFi 5 (Green / Blue)
      WiFi 2 (Green / Blue)
BTN:  Reset

Serial: Cisco-Style RJ45 - 115200 8N1

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

1. Download the OpenWrt initramfs-image. Place it into a TFTP server
   root directory and rename it to 1401A8C0.img. Configure the TFTP
   server to listen at 192.168.1.66/24.

2. Connect the TFTP server to the access point.

3. Connect to the serial console of the access point. Attach power and
   interrupt the boot procedure when prompted (bootdelay is 1 second).

4. Configure the U-Boot environment for booting OpenWrt from Ram and
   flash:

   $ setenv boot_openwrt 'setenv bootargs; bootm 0xbf080000'
   $ setenv ramboot_openwrt 'setenv serverip 192.168.1.66;
     tftpboot; bootm'
   $ saveenv

5. Load OpenWrt into memory:

   $ run ramboot_openwrt

   Wait for the image to boot.

6. Transfer the OpenWrt sysupgrade image to the device. Write the image
   to flash using sysupgrade:

   $ sysupgrade -n /path/to/openwrt-sysuograde.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-02-16 15:36:29 +01:00
Adrian Schmutzler 49ff00db34 ath79: enable forceless sysupgrade from ar71xx on fritz300e
This adds the ar71xx board name to the SUPPORTED_DEVICES on ath79,
so forceless sysupgrade on this device becomes possible.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-02-13 17:33:20 +01:00
August Huber ae61d21ca3 ath79: add support for COMFAST CF-E560AC
This commit adds support for the COMFAST CF-E560AC, an ap143 based
in-wall access point.

Specifications:
 - SoC: Qualcomm Atheros QCA9531
 - RAM: 128 MB DDR2 (Winbond W971GG6SB-25)
 - Storage: 16 MB NOR (Winbond 25Q128JVSO)
 - WAN: 1x 10/100 PoE ethernet (48v)
 - LAN: 4x 10/100 ethernet
 - WLAN1: QCA9531 - 802.11b/g/n - 2x SKY85303-21 FEM
 - WLAN2: QCA9886 - 802.11ac/n/a - 2x SKY85735-11 FEM
 - USB: one external USB2.0 port
 - UART: 3.3v, 2.54mm headers already populated on board
 - LED: 7x external
 - Button: 1x external
 - Boot: U-Boot 1.1.4 (pepe2k/u-boot_mod)

MAC addressing:

- stock
  LAN    *:40 (label)
  WAN    *:41
  5G     *:42
  2.4G   *:4a

- flash (art partition)
  0x0    *:40 (label)
  0x6    *:42
  0x1002 *:41
  0x5006 *:43

This device contains valid MAC addresses in art 0x0, 0x6, 0x1002 and
0x5006, however the vendor firmware only reads from art:0x0 for the LAN
interface and then increments in 02_network. They also jump 8 addresses
for the second wifi interface (2.4 GHz). This behavior has been duplicated
in the DTS and ath10k hotplug to align addresses with the vendor firmware
v2.6.0.

Recovery instructions:

This device contains built-in u-boot tftp recovery.

1. Configure PC with static IP 192.168.1.10/24 and tftp server.
2. Place desired image at /firmware_auto.bin at tftp root.
3. Connect device to PC, and power on.
4. Device will fetch flash from tftp, flash and reboot into new image.

Signed-off-by: August Huber <auh@google.com>
[move jtag_disable_pins, remove unnecessary statuses in DTS, remove
duplicate entry in 11-ath10k-caldata, remove hub_port0 label in DTS]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-02-03 16:18:08 +01:00
Michal Cieslakiewicz 3b99d67639 ath79: WNDR3700 v2: add dash before version in device name
Adapt Netgear WNDR3700v2 device identification string to ath79 naming
scheme by changing from 'wndr3700v2' to 'wndr3700-v2' (affects config,
makefile, init scripts and device tree definition).

Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
2020-02-03 11:28:05 +01:00
Adrian Schmutzler b4d3110ac1 ath79: add support for GL.iNet 6408/6416 (GL.iNet V1)
This ports the GL.iNet 6408/6416 from ar71xx.

The GL-Connect GL.iNet v1 routers are basically a TP-Link TL-WR710N with
more DRAM/Flash and console/GPIO header in the same small form-factor.

Specifications:
 - SoC: Atheros AR9331
 - CPU: 400 MHz
 - Flash: 8/16 MiB
 - RAM: 64 MiB
 - WiFi: 2.4 GHz b/g/n (SoC)
 - Ethernet: 2x 100M ports (LAN/WAN)
 - USB: 1x 2.0

The difference between 6408 and 6416 is just the flash size. It looks like
only the 16 MiB version has been advertised, while the 6408 is a modified
version. There are also 1-port versions sold by third parties.

Installation:
Install the sysupgrade image via stock firmware GUI or upload it via uboot
(web-based). The device will be available at 192.168.1.1.

Attention: In ar71xx, the same board name is used for both flash versions.
So, please make sure you flash the correct ath79 image when upgrading.

This has been device-tested on a GL.iNet 6416.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-01-29 18:56:04 +01:00
Adrian Schmutzler 07ce940b77 ath79: fix SUPPORTED_DEVICES not matching ar71xx board names
Based on a script for comparison, this fixes (hopefully) all errors
in SUPPORTED_DEVICES for ar71xx->ath79 upgrade.

Devices where old string is removed as the device does not exist
in ar71xx:
- dlink_dir-859-a1
- tplink_archer-a7-v5
- tplink_cpe510-v3

Devices where string is changed because it did not match the board
name in ar71xx:
- tplink_tl-mr3220-v1
- tplink_tl-mr3420-v1
- tplink_tl-wr2543-v1
- tplink_tl-wr741nd-v4
- tplink_tl-wr841-v7
- ubnt_unifiac-mesh
- ubnt_unifiac-mesh-pro
- ubnt_unifiac-pro

For this device, the correct string could not be found, but we could
not determine the correct one. Thus, the string is removed for now:
- tplink_tl-wr740n-v4

The script for checking this is quite simple (note that newer
entries, i.e. ath79->ath79 upgrade, are displayed as missing):

  newpath=target/linux/ath79/image/
  oldpath=target/linux/ar71xx/base-files/lib/ar71xx.sh

  for s in $(grep -roh "SUPPORTED_DEVICES.*" $newpath | sed 's/SUPPORTED_DEVICES *.= *//'); do
    found="Missing"
    grep -q -r "\"$s\"" $oldpath && found="Found"
    echo "$s: $found."
  done

The errors might be filtered by appending 'grep "Missing"' to the script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-01-23 16:09:58 +01:00
Roger Pueyo Centelles 6aaa5ce2c5 ath79: add support for MikroTik RouterBOARD wAP G-5HacT2HnD
This commit adds support for the MikroTik RouterBOARD wAP G-5HacT2HnD
(wAP AC), a small weatherproof dual band, dual-radio 802.11ac
wireless AP with integrated omnidirectional anntennae and one
10/100/1000 Mbps Ethernet port.

See https://mikrotik.com/product/RBwAPG-5HacT2HnD for more info.

Specifications:
 - SoC: Qualcomm Atheros QCA9556
 - RAM: 64 MB
 - Storage: 16 MB NOR
 - Wireless:
   · Atheros AR9550 (SoC) 802.11b/g/n 2x2:2, 2 dBi antennae
   · Qualcomm QCA9880 802.11a/n/ac 3x3:3, 2 dBi antennae
 - Ethernet: Atheros AG71xx (SoC, AR8033), 1x 1000/100/10 port,
   passive PoE in

Working:
 - Board/system detection
 - Sysupgrade
 - Serial console
 - Ethernet
 - 2.4 GHz radio
 - 5 GHz radio and LED
 - Reset button

Not working/Unsupported:
 - 2.4 GHz LED
 - AP/CAP LED
 - ZT2046Q SPI temperature and voltage sensor

This adds the basic features for supporting MikroTik devices:
 - a common recipe for mikrotik images in common-mikrotik.mk
 - support for minor (MikroTik NOR) split firmware (only for
   generic subtarget so far)

Acknowledgments: Robert Marko <robimarko@gmail.com>
                 Andrew Cameron <apcameron@softhome.net>
                 Koen Vandeputte <koen.vandeputte@ncentric.com>
                 Chuanhong Guo <gch981213@gmail.com>

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
Co-developed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2020-01-23 15:28:03 +01:00
David Bauer c9ac7b1729 ath79: add support for D-Link DIR-505
This commit adds support for the D-Link DIR-505, previously supported in
ar71xx.

Hardware
--------
SoC:   Atheros AR9330
FLASH: 8M SPI-NOR
RAM:   64M
WIFI:  1T1R 1SS Atheros AR9330
LED:   Power green, Status red
BTN:   WPS, Reset

Installation
------------
Currently, installation is only possible by sysupgrading from an earlier
OpenWrt version, U-Boot TFTP or a modded U-Boot. I do not have the
original bootloader from D-Link on my device anymore, so i cannot test
the factory image.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-01-15 20:38:46 +01:00
Tomasz Maciej Nowak 2248df303d ath79: wlr-7100: use ath10k-ct smallbuffers package variant
The memory hacks got removed from ath10k with 1e27bef ("mac80211: remove
ath10k_pci memory hacks"). As this device has low amount of RAM, switch
to ath-10k-ct small buffers variant, to avoid the OOM Reaper.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
2020-01-15 19:53:49 +01:00
Paul Fertser db992e7b53 ath79: use ath10k-ct-smallbuffers for 64 MiB devices
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2019-12-24 00:57:56 +01:00
Adrian Schmutzler 95030ac0b6 ath79: rename ATH_SOC to SOC
This replaces ATH_SOC by the newly introduced common SOC device
variable.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-12-20 01:12:42 +01:00
Adrian Schmutzler 0757f7fedc ath79: harmonize line breaks in image Makefiles
This harmonizes the line wrapping in image Makefile device
definitions, as those are frequently copy-pasted and are a common
subject of review comments. Having the treatment unifying should
reduce the cases where adjustment is necessary afterwards.

Harmonization is achieved by consistently (read "strictly")
applying certain rules:
- Never put more than 80 characters into one line
- Fill lines up (do not break after 40 chars because of ...)
- Use one tab for indent after wrapping by "\"
- Only break after pipe "|" for IMAGE variables

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-12-20 00:29:05 +01:00
Piotr Dymacz e5d4c09667 ath79: add support for YunCore XD4200 and A782
YunCore XD4200 ('XD4200_W6.0' marking on PCB) is Qualcomm/Atheros based
(QCA9563, QCA9886, QCA8334) dual-band, Wave-2 AC1200 ceiling AP with PoE
(802.3at) support. A782 model ('T750_V5.1' marking on PCB) is a smaller
version of the XD4200, with similar specification but lower TX power.

Specification:

- QCA9563 (775 MHz)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 2x 10/100/1000 Mbps Ethernet (QCA8334), with 802.3at PoE support (WAN)
- Wi-Fi 2.4 GHz:
  - XD4200: 2T2R (QCA9563), with ext. PA (SKY65174-21) and LNA
  - A782: 2T2R (QCA9563), with ext. FEM (SKY85329-11)
- Wi-Fi 5 GHz:
  - XD4200: 2T2R (QCA9886), with ext. FEM (SKY85728-11)
  - A782: 2T2R (QCA9886), with ext. FEM (SKY85735-11)
- LEDs:
  - XD4200: 5x (2x driven by SOC, 1x driven by AC radio, 2x Ethernet)
  - A782: 3x (1x RGB, driven by SOC and radio, 2x Ethernet)
- 1x button (reset)
- 1x UART (4-pin, 2.54 mm pitch) header on PCB
- 1x DC jack (12 V)

Flash instructions:

If your device comes with generic QSDK based firmware, you can login
over telnet (login: root, empty password, default IP: 192.168.188.253),
issue first (important!) 'fw_setenv' command and then perform regular
upgrade, using 'sysupgrade -n -F ...' (you can use 'wget' to download
image to the device, SSH server is not available):

  fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000"
  sysupgrade -n -F openwrt-...-yuncore_...-squashfs-sysupgrade.bin

In case your device runs firmware with YunCore custom GUI, you can use
U-Boot recovery mode:

1. Set a static IP 192.168.0.141/24 on PC and start TFTP server with
   'tftp' image renamed to 'upgrade.bin'
2. Power the device with reset button pressed and release it after 5-7
   seconds, recovery mode should start downloading image from server
   (unfortunately, there is no visible indication that recovery got
   enabled - in case of problems check TFTP server logs)

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2019-11-25 17:32:46 +01:00
Vincent Wiemann 8016f64864 ath79: add support for YunCore TFTP image generation
YunCore QCA9k based devices released in 2019 require a custom TFTP image
for U-Boot built-in recovery mode (triggered with reset button). Image
has to be prepended with 'YUNCORE' keyword followed by U-Boot CLI
commands which will be executed later. Images without the custom header
will be ignored by U-Boot.

To be able to support both the vendor firmware (QSDK) and OpenWrt flash
layouts, used here commands change the 'bootcmd' before flashing image.

This commit adds generic helper script for YunCore devices with 16 MB of
flash and enables TFTP image generation for A770 model.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
[pepe2k@gmail.com: commit description reworded, recipe renamed]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2019-11-25 17:32:46 +01:00
Adrian Schmutzler fc44a8481c ath79: fix sysupgrade from ar71xx for WNDR3700 V2 and WNDR3800(CH)
ar71xx has just one board name "wndr3700" for WNDR3700 V1/V2,
WNDR3800 and WNDR3800CH, whereas ath79 provides separate images for
the boards. So, update SUPPORTED_DEVICES to store the correct
ar71xx board names.

Fixes: FS#2510

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2019-11-14 23:14:35 +01:00
Jeff Kletsky b496a2294c ath79: GL-AR750S: provide NAND support; increase kernel to 4 MB
The GL.iNet GL-AR750S has been supported by the ar71xx and ath79
platforms with access to its 16 MB NOR flash, but not its 128 MB
SPI NAND flash.

This commit provides support for the NAND through the upstream
SPI-NAND framework.

At this time, the OEM U-Boot appears to only support loading the
kernel from NOR. This configuration is preserved as this time,
with the glinet,gl-ar750s-nand name reserved for a potential,
future, NAND-only boot.

The family of GL-AR750S devices on the ath79 platform now includes:

  * glinet,gl-ar750m-nor-nand   "nand" target
  * glinet,gl-ar750m-nor        "nand" target (NAND-aware)

NB: This commit increases the kernel size from 2 MB to 4 MB

"Force-less" sysupgrade is presently supported from the current
versions of following NOR-based firmwre images to the version of
glinet,gl-ar750s-nor firmware produced by this commit:

  * glinet,gl-ar750s     -- OpenWrt 19.07 ar71xx
  * glinet,gl-ar750s     -- OpenWrt 19.07 ath79

Users who have sucessfully upgraded to glinet,gl-ar750m-nor may then
flash glinet,gl-ar750m-nor-nand with sysupgrade to transtion to the
NAND-based variant.

Other upgrades to these images, including directly to the NAND-based
glinet,gl-ar750s-nor-nand firmware, can be accomplished through U-Boot.

NB: See "ath79: restrict GL-AR750S kernel build-size to 2 MB" which
enables flashing of NAND factory.img with the current GL-iNet U-Boot,
"U-Boot 1.1.4-gcf378d80-dirty (Aug 16 2018 - 07:51:15)"

The GL-AR750S OEM U-Boot allows upload and flashing of either NOR
firmware (sysupgrade.bin) or NAND firmware (factory.img) through its
HTTP-based GUI. Serial connectivity is not required.

The glinet,gl-ar750s-nor and glinet,gl-ar750s-nor-nand images
generated after this commit flash each other directly.

This commit changes the control of the USB VBUS to gpio-hog from
regulator-fixed introduced by commit 0f6b944c92. This reduces the
compressed kernel size by ~14 kB, with no apparent loss of
functionality. No other ath79-nand boards are using regulator-fixed
at this time.

Note: mtd_get_mac_binary art 0x5006 does not return the proper MAC
and the GL.iNet source indicates that only the 0x0 offset is valid

The ar71xx targets are unmodified.

Cc: Alexander Wördekemper <alexwoerde@web.de>

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
2019-11-14 14:38:58 +08:00
Jeff Kletsky b591cabd39 ath79: add GL.iNet GL-AR300M16 as NOR-only board
The GL.iNet GL-AR300M series of devices includes variants without NAND
and only the 16 MB NOR flash. These include the GL-AR300M16 and the
GL-AR300M-Lite (already with its own board name).

This board-name addition provides disambiguation from the NAND-bearing
GL-AR300M devices, both for OpenWrt code and for end users.

Kernel and firmware support for NAND and UBI will add ~320 kB to the
overall firmware size at this time. This NOR-only option continues to
provide more compact firmware for both the GL-AR300M16 as well as
those who wish to use it as an alternate or primary, NOR-resident
firmware on the GL-AR300M.

The ar71xx targets are unmodified.

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

Install through OEM U-Boot (HTTP-based) or `sysupgrade --force` when
booted from NOR and running OEM or OpenWrt, NOR-based firmware.

As one of the intentions is disambiguation from NAND-bearing units,
users who have flashed this firmware onto a device with NAND would
need to use U-Boot or `sysupgrade --force` to flash firmware that
again supports NAND.

There are no additional SUPPORTED_DEVICES as it is not possible to
determine if a device does or does not have NAND based on
either the OEM's or OpenWrt's board names prior to this patch.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
2019-11-14 14:38:58 +08:00
Jeff Kletsky 55e6c903ae ath79: GL-AR300M: provide NAND support; increase to 4 MB kernel
The GL.iNet GL-AR300M has been supported by the ar71xx and ath79
platforms with access to its 16 MB NOR flash, but not its 128 MB
SPI NAND flash.

This commit provides support for the NAND through the upstream
SPI-NAND framework. Devices with both NOR and NAND flash can support
independent firmware on each, with U-Boot able to boot from either.
The OEM U-Boot will fall back to the NOR firmware after three
"unsuccessful" boots.

The family of GL-AR300M devices on the ath79 platform now includes:

  * glinet,gl-ar300m-lite       "generic" target, NOR-only board
  * glinet,gl-ar300m-nand       "nand" target
  * glinet,gl-ar300m-nor        "nand" target (NAND-aware)

NB: This commit increases the kernel size from 2 MB to 4 MB

"Force-less" sysupgrade is presently supported from the current
versions of following NOR-based firmwre images to the version of
glinet,gl-ar300m-nor firmware produced by this commit:

  * gl-ar300m            -- OEM v3 NOR    ar71xx (openwrt-ar300m16-*.bin)
  * gl-ar300m            -- OpenWrt 18.06 ar71xx
  * gl-ar300m            -- OpenWrt 19.07 ar71xx

Other upgrades to these images should be performed through U-Boot.

The GL-AR300M OEM U-Boot allows upload and flashing of either NOR
firmware (sysupgrade.bin) or NAND firmware (factory.img) through its
HTTP-based GUI. Serial connectivity is not required.

The glinet,gl-ar300m-nand and glinet,gl-ar300m-nor images generated
after this commit should safely flash each other using sysupgrade.

The boot counter is implemented by the OEM using u-boot-env. At this
time, it does not appear that the switch on the side of the unit can
be used to select NOR vs. NAND boot and the fail-over is only from
NAND to NOR. To save flash wear, it is only reset when running the
glinet,gl-ar300m-nand firmware.

NAND-specific base-files are used to remove impact on existing
generic and tiny targets.

As there is now no "generic" build appropriate for the GL-AR300M16,
(or for users of the GL-AR300M that do not need access to NAND)
it will be introduced in a subsequent commit.

Note: `mtd_get_mac_binary art 0x6` does not return the proper MAC
and the GL.iNet source indicates that only the 0x0 offset is valid

The ar71xx targets are unmodified.

Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
2019-11-14 14:38:58 +08:00