Commit Graph

198 Commits (9601d94138de66e4fc9f55a08dfb348cdfcc3181)

Author SHA1 Message Date
Mathias Kresin 374e646724 ath79: fix PQI Air Pen support
Use the correct dts filename. It has to be <soc>_<manufacturer>_<device>.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
YuheiOKAWA 27eae6597e ath79: add support for PQI Air Pen
SoC: AR9330 (or AR9331 revision?)
Ethernet x1, Wireless 2.4G, uSD card slot x1.
USB Power, include Li-Po Battery.

Flash 8MiB. (factory is dual image)
1. write image is use half 4MiB size from factory.
  write initramfs image to mtd6 and mtd7.
2. change next boot setting. next is mtd6 boot.
  echo -ne "\x01" | dd of=/dev/mtdblock8 conv=notrunc bs=1 count=1 seek=0

3. rewrite sysupgrade image.
  change next boot setting. next is mtd4.
  echo -ne "\x00" | dd of=/dev/mtdblock8 conv=notrunc bs=1 count=1 seek=0

OEM mtd.
dev:    size   erasesize  name
mtd0: 00040000 00010000 "u-boot"
mtd1: 00010000 00010000 "u-boot-env"
mtd2: 00010000 00010000 "ART"
mtd3: 00010000 00010000 "NVRAM"
mtd4: 00140000 00010000 "uImage"
mtd5: 00280000 00010000 "rootfs"
mtd6: 00140000 00010000 "uImage2"
mtd7: 00280000 00010000 "rootfs2"
mtd8: 00010000 00010000 "CONF"

Signed-off-by: YuheiOKAWA <tochiro.srchack@gmail.com>
6 years ago
Roger Pueyo Centelles 23f9b2d9a9 ath79: Add support for Ubiquiti LiteAP ac (LAP-120)
This commit adds support for the Ubiquiti LiteAP ac (LAP-120), an outdoor
5 GHz AC access point with an integrated 120° 16 dBi antenna. The device
was previously known as LiteBeam AP ac but was later rebranded.

CPU:    Atheros AR9342 SoC
RAM:    64 MB DDR2
Flash:  16 MB NOR SPI
Ports:  1 GbE port (PoE in)
WLAN:   5 GHz QCA899X (PCI)

The integrated QCA899X is a Ubiquiti branded part with modified vendor
and product id (0777:11ac9). It is very similar to the NanoStation loco
AC, except for the 2.4 GHz management radio (missing here).

Installation procedure is the same as the NanoStation [loco] AC:

1. Connect to serial header on device
2. Power on device and enter uboot console
3. Set up tftp server serving an openwrt initramfs build
4. Load initramfs build using the command tftpboot in the uboot cli
5. Boot the loaded image using the command bootm
6. Copy squashfs openwrt sysupgrade build to the booted device
7. Use mtd to write sysupgrade to partition "firmware"
8. Reboot and enjoy

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
6 years ago
David Bauer 5815bb2e41 ath79: add support for TP-Link TL-WA901ND v2
This commit adds support for the TP-Link TL-WR901ND v2 access point.

CPU:   Atheros AR9132 400MHz
RAM:   32MB
FLASH: 4MiB
WiFi:  Atheros AR9103 3x3:2 bgn
LED:   Power (static on)
       LAN (controlled by PHY)
       SYS, WiFi, QSS toggleable
BTN:   Reset, QSS

Installation:
Upload the factory image via the vendor-GUI.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
INAGAKI Hiroshi 6d1abbcab4 ath79: add support for Buffalo WZR-HP-G302H A1A0
Buffalo WZR-HP-G302H is a 2T2R 2.4 GHz 11n router, based on Atheros
AR7242.

It is Japanese market model of WZR-HP-G300NH2, but there are some
diffrences. This commit is based on WZR-HP-G300NH2 in ar71xx.
And, G302H has several hardware versions and hardware is different
dependent on the versions. This commit adds support for "A1A0"
version.

Specification:

- Atheros AR7242
- 64 MB of RAM (DDR2)
- 32 MB of Flash
  - 2x 16 MB SPI-NOR flash
- 2.4 GHz 2T2R wifi
  - Atheros AR9283
- 5x 10/100/1000 Mbps Ethernet
  - Atheros AR8316
- 7x LEDs, 5x keys
  - LED: 1x gpio-leds, 6x ath9k-leds
  - key: 3x buttons, 2x slide switches
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Flash instruction using factory image:

1. Boot WZR-HP-G302H normaly and connect the computer to its LAN port
2. Access to "http://192.168.11.1/" and move to firmware update page
("ファーム更新")
3. Select the OpenWrt factory image and click update ("更新実行")
button to perform firmware update
4. Wait ~200 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Robert Marko adbd9d1f1f ath79: Add support for TP-Link TL-WR842N-v2
This PR adds support for TP-Link TL-WR842N-v2 router which is supported by ar71xx to ath79.

This is a low cost model with following specs:

CPU: Atheros AR9341 SoC
RAM: 32 MB DDR1
Flash: 8 MB NOR SPI
Switch: Internal AR9341 5 port 10/100 Mbit
Ports:  5x 10/100 Mbit(1x WAN, 4x LAN)
USB: 1x USB2.0
WLAN: 2.4 GHZ AR9341

Installation:

Simply flash the factory image through stock firmware WEB UI.

Signed-off-by: Robert Marko <robimarko@gmail.com>
6 years ago
Tobias Schramm fa3c2676ab ath79: Add support for Ubiquiti Nanostation AC
5 GHz AC wireless outdoor PoE CPE with internal 2.4 GHz management radio

CPU:    Atheros AR9342 SoC
RAM:    64 MB DDR2
Flash:  16 MB NOR SPI
Switch: QCA8334
Ports:  2 GbE ports (1x PoE in, 1x PoE passthrough)
WLAN:   5 GHz QCA899X (PCI) and 2.4 GHZ AR9342

Successor to the old NanoStation M5 with AC wireless.

The integrated QCA899X is a Ubiquiti branded part with modified vendor and
product id (0777:11ac9).

Serial

Serial settings: 115200, 8N1

* = plated through hole
0 = nylon screw

      [Top of device]
+--------------------------+
|    [label]               |
|  0                       |
|                    0     |
|         [ubnt]           |
|         [logo]  3V3  *   |
|                  TX  *   |
|                  RX  *   |
|                 GND  *   |
|                          |
|                      *   |
|                      *   |
|                      *   |
|                      *   |
|    0                     |
|                 0        |
|                          |
|                          |

Installation

1. Connect to serial header on device
2. Power on device and enter uboot console
3. Set up tftp server serving an openwrt initramfs build
4. Load initramfs build using the command tftpboot in the uboot cli
5. Boot the loaded image using the command bootm
6. Copy squashfs openwrt sysupgrade build to the booted device
7. Use mtd to write sysupgrade to partition "firmware"
8. Reboot and enjoy

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
Tobias Schramm 5736af8024 ath79: Add support for Ubiquiti NanoStation AC loco
Atheros AR9342, 16 MB flash, 64 MB RAM

Successor to the old NanoStation M5 loco with AC wireless.

Includes a mac80211 patch for ath10k_pci because Ubiquiti uses a Ubiquiti
branded and customized QCA988X with vendor id 0777 and device id 11ac for
AC wireless.

Installation

1. Connect to serial header on device (8N1 115200)
2. Power on device and enter uboot console
3. Set up tftp server serving an openwrt initramfs build
4. Load initramfs build using the command tftpboot in the uboot cli
5. Boot the loaded image using the command bootm
6. Copy squashfs openwrt sysupgrade build to the booted device
7. Use mtd to write sysupgrade to partition "firmware"
8. Reboot and enjoy

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
Tobias Schramm bc5761f90b ath79: Add generic device tree for Ubiquiti WA boards
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
INAGAKI Hiroshi 4b9882eb92 ath79: fix MAC address for Buffalo BHR-4GRV
I added mtd-mac-address for WZR-HP-G450H and BHR-4GRV in
1df1ea4d7e, but that address in ART is
incorrect for BHR-4GRV.

WZR-HP-G450H has wlan eeprom and MAC address in ART, but BHR-4GRV
has only MAC address in ART.

- WZR-HP-G450H
  - eeprom: 0x1000
  - MAC:    0x1002

- BHR-4GRV
  - MAC:    0x0

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
INAGAKI Hiroshi 81f7bdcb8d ath79: add support for Buffalo BHR-4GRV
Buffalo BHR-4GRV is a wired router, based on Atheros AR7242.

Specification:

- Atheros AR7242
- 64 MB of RAM
- 32 MB of Flash
  - 2x 16 MB SPI-NOR flash
- 5x 10/100/1000 Mbps Ethernet
- 3x LEDs, 2x keys
- 1x USB 2.0 Type-A
- UART header on PCB
  - JP1: Vcc, GND, TX, RX from reset button side

Flash instruction using factory image:

1. Boot the BHR-4GRV normaly and connect the computer to its LAN port
2. Access to
"http://192.168.11.1/cgi-bin/cgi?req=frm&frm=py-db/firmup.html"
with user "bufpy" and password "otdpopy"
3. Select the OpenWrt factory image and click "OK" button to perform
firmware upgrade
4. Wait ~200 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
INAGAKI Hiroshi 1df1ea4d7e ath79: fix support for Buffalo WZR-HP-G450H and split to dts/dtsi
There are many parts that are incorrect or missing in the current
code for Buffalo WZR-HP-G450H in ath79, so its support is broken.

I fixed that issues and split to dts/dtsi files to add support for
Buffalo BHR-4GRV.

And WZR-450HP has the same hardware as WZR-HP-G450H, so I change the
device name to "WZR-HP-G450H/WZR-450HP".

Specification:

- Atheros AR7242
- 64 MB of RAM
- 32 MB of Flash
  - 2x 16 MB SPI-NOR flash
- 3T3R 2.4 GHz wifi
  - SoC internal
- 5x 10/100/1000 Mbps Ethernet
- 6x LEDs, 5x keys
- 1x USB 2.0 Type-A
- UART header on PCB
  - JP1: Vcc, GND, TX, RX from reset button side

Flash instruction using factory image:

1. Boot the WZR-HP-G450H (or WZR-450HP) normaly and connect the computer
to its LAN port
2. Access to
"http://192.168.11.1/cgi-bin/cgi?req=frm&frm=py-db/firmup.html"
with user "bufpy" and password "otdpopy"
3. Select the OpenWrt factory image and click "OK" button to perform
firmware update
4. Wait ~200 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
INAGAKI Hiroshi b6e6785c88 ath79: fix wrong pll-data value for I-O DATA WN-AC-DGR devices
The pll-data value "0x56000000" is wrong for I-O DATA WN-AC1600DGR2
and WN-AC1167DGR, so there was a problem of slowing down the speed of
ethernet.

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Robert Marko b9ba32b2e3 ath79: Fix GL-AR300M USB trigger
Correct a typo preventing USB trigger to work on AR300M.

Signed-off-by: Robert Marko <robimarko@gmail.com>
6 years ago
David Bauer c6ecb83db4 ath79: flag FritzBox 4020 buttons as active low
Buttons of AVM FritzBox 4020 are incorrectly flagged as active high.

This was an oversight as RFKill button was working as expected even
with incorrectly flagged GPIO.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Bernhard Frauendienst 480bf28273 ath79: add support for Buffalo WZR-HP-AG300H
Buffalo WZR-HP-AG300H is a dual band router based on
Qualcom Atheros AR7161 rev 2

Specification:
- 680 MHz CPU (Qualcomm Atheros AR7161)
- 128 MiB RAM (2x Samsung K4H511638G-LCCC)
- 32 MiB Flash (2x Winbond 25Q128BVFG)
- WiFi 5 GHz a/n (Atheros AR9220)
- WiFi 2.4 GHz b/g/n (Atheros AR9223)
- 1000Base-T WAN (Atheros AR7161)
- 4x 1000Base-T Switch (Atheros AR8316)
- 1x USB 2.0
- 3 Buttons (AOSS/WPS, Reset, USB Eject)
- 2 Slide switches (Router (on/off/auto), Movie Engine (on/off))
- 9 LEDs (Power green, WLAN 2GHz green, WLAN 2GHz amber,
    WLAN 5GHz green, WLAN 5GHz LED amber, Router green,
    Diag red, Movie Engine blue, USB green)

It is already supported by the ar71xx target.

For more information on the device visit the wiki:
<https://openwrt.org/toh/buffalo/wzr-hp-ag300h>

Serial console:
- The UART Header is next to Movie Engine Switch.
- Pinout is RX - TX - GND - 3.3V (Square Pad is 3.3V)
- The Serial setting is 115200-8-N-1.

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

Tested:
- Ethernet (LAN, WAN)
- WiFi
- Installation
  - via TFTP rescue
  - via factory image
    - on firmware v1.77 (28-05-2012)
    - on pro firmware v24SP2 r30356 (26-03-2018)
  - via sysupgrade from ar71xx
    (wlan devices don't work because of new names)
  - via sysupgrade from itself
- Buttons
- LEDS
- USB (Power control and device recognition)

Signed-off-by: Bernhard Frauendienst <openwrt@nospam.obeliks.de>
6 years ago
INAGAKI Hiroshi 7768f11534 ath79: add support for ELECOM WRC-300GHBK2-I
ELECOM WRC-300GHBK2-I is a 2.4 GHz wireless router, based on Qualcomm
Atheros QCA9563.

Specification:

- Qualcomm Atheros QCA9563
- 64 MB of RAM (DDR2)
- 8 MB of Flash (SPI-NOR)
- 2T2R 2.4 GHz wifi
  - SoC internal
- 5x 10/100/1000 Mbps Ethernet
- 3x LEDs, 4x keys(connected to GPIO: 3x)
- UART header on PCB
  - TX, GND, RX, Vcc from ethernet port side
  - 115200n8

Flash instruction using factory image:

1. Boot the WRC-300GHBK2-I normaly and connect the computer to its
LAN port
2. Access to "http://192.168.2.1/" and open firmware update page
("ファームウェア更新 手動更新(アップデート)")
3. Select the OpenWrt factory image and click apply ("適用") button
to perform firmware update
4. On the (initramfs) factory image, execute "mtd erase firmware" to
erase stock firmware and execute sysupgrade with squashfs-sysupgrade
image for WRC-300GHBK2-I
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Christian Lamparter 745dee11ac ath79: add support for WD My Net Wi-Fi Range Extender
This patch ports over support for the device from ar71xx.

SOC:	AR7370 (Wasp - AR9344 rev2 0001974c)
RAM:	Winbond W9725G6KB-25 32MiB
FLASH:	Winbond 25Q64FVSIG 8MiB
WLAN:	AR9380 Dual-Band 802.11abgn 3x3:3
INPUT:	WPS, RESET button (hardware on/off toggle button)
LED:    Power, LAN, WiFi, 3 RSSI-Leds (low, medium, high)
Serial: Header Next to the winbond flash chip (labeld JP1)
	Pinout is GND - NC - RX - TX - 3V3 (JP1)
	The Serial setting is 115200-8-N-1.

- Installation via uboot's upgrade command
  0. attach serial cable
  1. interrupt uboot and enter "upgrade code.bin" into
      the u-boot prompt
	ar7240> upgrade code.bin

  2. rename openwrt...sysupgrade.bin to code.bin on PC
  3. run a tftp-client on the PC
	 (shell)$ tftp 192.168.1.230
	 binary
	 put code.bin
  4. wait for the device to finish

	[...]
	Copy buff to Flash from 0x9f040000 length 0x79f000
	Copy to Flash... write addr: 9f040000
	done

  5.  enter "go" in the u-boot prompt
	ar7240> go

- TFTP ramdisk image boot from the uboot prompt
  (tftp server defaults to serverip 192.168.1.254)
	=> tftpboot 81000000 initramfs.bin
	=> bootm

Tested and working:
	- LEDs
	- Buttons
	- Ethernet
	- Wi-Fi
	- OpenWRT sysupgrade

For flashing and debricking information see:
<https://openwrt.org/toh/wd/rext>

Users coming from ar71xx can use sysupgrade too. But I highly
advise to no save the old configuration and start from a clean
state.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
Matt Merhar b672550b32 ath79: add syscon compatible property to ar7100 ethernet nodes
This adds "syscon" to the compatible properties for the eth0/eth1 nodes
in ar7100.dtsi.

Without this, a kernel panic is encountered on boot with some ar7100
boards. This for some reason wasn't an issue for the WNDR3800, which
uses a Realtek switch chipset, but the panic was encountered on the
RouterStation Pro (using an AR8216 switch) and some other boards that
haven't yet been merged.

The panic message mentions an unaligned access and happens in
ag71xx_mdio_probe in drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c.

Even if the unaligned access is fixed, the ag71xx_mdio probe still fails
without the "syscon" property.

This was already being worked around in
ar7161_ubnt_routerstation-pro.dts by overriding the compatible property,
so this commit removes that as well.

All of the other ath79 .dtsi already have this property, so no changes
are needed elsewhere.

Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
6 years ago
Dmitry Tunin 8132e06247 ath79: fix ar7100 PCI IRQ handling
Currently all PCI devices get the same IRQ that affects performance badly.

This commit adresses this problem and cleans the code.

ar7100 has a special PCI interrupt controller@18060018 that works exactly
the same way as misc interrupt controller.

This patch does the following:

1. Defines pci-intc interrupt controller@18060018 in dtsi.
2. Removes interrupt-controller property from PCI node.
3. Sets a correct interrupt mask for PCI devices.
4. Removes all IRQ handling code from the PCI driver.

"qca,ar7100-misc-intc" should be used as the compatible property, becuase on ar7100
the controlled status register is read-only and the ack method used in
"qca,ar7240-misc-intc" won't work properly.

There are two very minor downsides of this patch that don't affect perormance:

1. We allocate an IRQ domain of 32 IRQ, whan we need only 5. But ar7100 aren't tiny un terms of RAM
and that is not very important and can be tuned if we implement "nr-interrupts" property".

2. It reuses the same irg chip name "MISC" for both controllers.

Run tested on DIR-825 B1.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
6 years ago
Chuanhong Guo 028daa9974 ath79: ag71xx: apply interface mode to MII0/1_CTRL on ar71xx/ar913x
We currently don't have any code configuring interface mode in ath79,
meaning that we relies on bootloader to set the correct interface mode.

This patch added code to set interface correctly so that everything works
even if bootloader configures it wrong.(e.g. on WNDR3800 u-boot set
the second GMAC mode to RMII but it should be RGMII.)

Introduced "qca,mac-idx" for the difference in MII_CTRL register value.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Matt Merhar d03c89838e ath79: initial support for Ubiquiti RouterStation and RouterStation Pro
This adds a shared ar7161_ubnt_routerstation.dtsi as well as two other
.dts files that utilize it, ar7161_ubnt_routerstation.dts and
ar7161_ubnt_routerstation-pro.dts.

The modifications to generic-ubnt.mk, config-default, and base-files
necessary for image generation, parsing RedBoot FIS partitions, network
configuration, and sysupgrade are also included.

This reintroduces vital bits from platform_do_upgrade_combined() and its
supporting functions to /lib/upgrade/platform.sh, which were previously
removed from ath79 in 3e9d9f6225 "ath79:
sysupgrade: drop unused platform checks". The new function is called
"routerstation_do_upgrade" and will *only* work for the RouterStation
series of boards. It does however retain the ability to downgrade (e.g.
from master -> 17.01.x using sysupgrade -F).

All hardware is functional including the AR8216 switch (for the Pro),
wireless via ath5k/ath9k using the miniPCI slots, flash, USB, button,
and LED.

Switch and LAN/WAN configuration is the same as it is with the
equivalent ar71xx targets. MAC addresses are assigned based upon the
content stored in the RedBoot config partition.

Flashing via both sysupgrade and TFTP has been confirmed to work. Also,
the initramfs images are now raw .bin files instead of being wrapped in
a uImage (as they currently are in ar71xx), which makes them bootable
with RedBoot.

One notable difference to ar71xx is the inclusion of the RedBoot
"fconfig" utility (analogous to U-Boot’s fw_printenv/fw_setenv) in
DEVICE_PACKAGES. The FIS partitions are probed using the RedBoot MTD
parser’s DT binding, whose proper usage is mutually exclusive to
defining a separate fixed-partitions node for "RedBoot config". This
config partition contains the board's base MAC address. The lack of a
hard-coded flash location means that the mtd-mac-address property cannot
be used in the .dts, so instead fconfig is used to read the MAC
addresses from flash in userspace during first boot.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
6 years ago
Paul Wassi e348ccc4e6 treewide: fix some cosmetic glitches in dts files
- fix single spaces hidden by a tab
- replace indentation with spaces by tabs
- make empty lines empty
- drop trailing whitespace
- drop unnecessary blank lines

Signed-off-by: Mathias Kresin <dev@kresin.me>
Signed-off-by: Paul Wassi <p.wassi@gmx.at>
6 years ago
Felix Fietkau d45b5a061d ath79: fix mac address increment for embedded wireless Dorin
Use mtd-mac-address-increment-byte to match ar71xx behavior

Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Lech Perczak d40956a74c ath79: ubnt-xm: hijack LED4 as booting/failsafe
Create aliases for led-booting and led-failsafe pointing at
ubnt:green:link4 LED, forUbiquiti XM series, so visual feedback
on device status becomes available, in order to enter failsafe mode
via button. led-running and led-upgrade aliases are omitted to avoid
conflicting with RSSI LEDs when in normal operation.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
6 years ago
INAGAKI Hiroshi 30b4f78193 ath79: add support for I-O DATA ETG3-R
I-O DATA ETG3-R is a wired router, based on Atheros AR9342.

Specification:

- Atheros AR9342
- 64 MB of RAM
- 8 MB of Flash
- 5x 10/100/1000 Ethernet
  - AR8327N
- 2x LEDs, 1x key
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Flash instruction using initramfs image:

1. Connect serial cable to UART header on ETG3-R
2. Rename OpenWrt initramfs image to "1500A8C0.img" and place it in
the TFTP directory
3. Set IP address of the computer to 192.168.0.10, connect to the
LAN port of ETG3-R, and start the TFTP server on the computer
4. Connect power cable to ETG3-R and turn on the router
5. Press "Enter" key when the "Hit any key to stop autoboot:" message
is displayed on the console and enter the u-boot cli
6. execute following commands to change kernel address for u-boot
  setenv bootsf 1
  setenv mtd_kernel1 "bootm 0x9f050000"
  saveenv
7. execute "tftpboot; bootm" command to download the initramfs image from
TFTP server and boot with it
8. On the initramfs image, execute "mtd erase firmware" to erase stock
firmware and execute sysupgrade with sysupgrade image for ETG3-R
9. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
David Bauer 3f8c5d5476 ath79: add support for Fritz!Box 4020
This commit adds support for the AVM Fritz!Box 4020 WiFi-router.

SoC:   Qualcomm Atheros QCA9561 (Dragonfly) 750MHz
RAM:   Winbond W971GG6KB-25
FLASH: Macronix MX25L12835F
WiFi:  QCA9561 b/g/n 3x3 450Mbit/s
USB:   1x USB 2.0
IN:    WPS button, WiFi button
OUT:   Power LED green, Internet LED green, WLAN LED green,
       LAN LED green, INFO LED green, INFO LED red
UART:  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 (LAN + WAN)
 - WiFi (correct MAC)
 - Installation via EVA bootloader
 - OpenWRT sysupgrade
 - Buttons
 - LEDs

The USB port doesn't work. Both Root Hubs are detected as having 0 Ports:

[    3.670807] kmodloader: loading kernel modules from /etc/modules-boot.d/*
[    3.723267] usbcore: registered new interface driver usbfs
[    3.729058] usbcore: registered new interface driver hub
[    3.734616] usbcore: registered new device driver usb
[    3.744181] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    3.758357] SCSI subsystem initialized
[    3.766026] ehci-platform: EHCI generic platform driver
[    3.771548] ehci-platform ehci-platform.0: EHCI Host Controller
[    3.777708] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1
[    3.788169] ehci-platform ehci-platform.0: irq 48, io mem 0x1b000000
[    3.816647] ehci-platform ehci-platform.0: USB 2.0 started, EHCI 0.00
[    3.824001] hub 1-0:1.0: USB hub found
[    3.828219] hub 1-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    3.835825] ehci-platform ehci-platform.1: EHCI Host Controller
[    3.842009] ehci-platform ehci-platform.1: new USB bus registered, assigned bus number 2
[    3.852481] ehci-platform ehci-platform.1: irq 49, io mem 0x1b400000
[    3.886631] ehci-platform ehci-platform.1: USB 2.0 started, EHCI 0.00
[    3.894011] hub 2-0:1.0: USB hub found
[    3.898190] hub 2-0:1.0: config failed, hub doesn't have any ports! (err -19)
[    3.908928] usbcore: registered new interface driver usb-storage
[    3.915634] kmodloader: done loading kernel modules from /etc/modules-boot.d/*

A few words about the shift-register:

AVM used a trick to control the shift-register for the LEDs with only 2
pins, SERCLK and MOSI. Q7S, normally used for daisy-chaining multiple
shift-registers, pulls the latch, moving the shift register-state to
the storage register. It also pulls down MR (normally pulled up) to
clear the storage register, so the latch gets released and will not be
pulled by the remaining bits in the shift-register. Shift register is
all-zero after this.

For that we need to make sure output 7 is set to high on driver probe.
We accomplish this by using gpio-hogging.

Installation via EVA:
In the first seconds after Power is connected, the bootloader will
listen for FTP connections on 169.254.157.1 (Might also be 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. After transfer is
complete you need to powercycle the device to boot OpenWRT.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Christian Lamparter 1c6e0f57a7 ath79: add support for TP-Link Archer C7 v1
TP-Link Archer C7 v1 is a dual band router
based on Qualcomm/Atheros QCA9558 + QCA9880.

Specification:

 - 720 MHz CPU
 - 128 MB of RAM (Various chips)
 - 8 MB of FLASH (Various chips)
 - SoC QCA9558 integrated 3T3R 2.4 GHz Wi-Fi
 - minipcie slot with 3T3R 5 GHz QCA9880-AR1A (unsupported by ath10k!)
 - 5x 10/100/1000 Mbps Ethernet (AR8327N Switch)
 - 10x LEDs, 2x software buttons

For further informwation on the device, visit the wiki:
<https://openwrt.org/toh/tp-link/archer-c7-1750>

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
6 years ago
INAGAKI Hiroshi ff4bc483fc ath79: add support for I-O DATA WN-AC1167DGR
I-O DATA WN-AC1167DGR is a 2.4/5 GHz band 11ac router, based on
Qualcomm Atheros QCA9557.

Specification:

- Qualcomm Atheros QCA9557
- 128 MB of RAM (DDR2)
- 16 MB of Flash (SPI)
- 2T2R 2.4/5 GHz wifi
  - 2.4 GHz: SoC internal
  - 5 GHz: QCA988x
- 5x 10/100/1000 Mbps Ethernet
- 6x LEDs, 6x keys (4x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of WN-AC1167DGR
2. Connect power cable to WN-AC1167DGR and turn on it
3. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
4. Select the OpenWrt factory image and click update ("更新") button
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Dmitry Tunin 0c5a532553 ath79: add support for TP-Link MR-3040 v2
Add support for the ar71xx supported TP-Link MR-3040 v2.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
6 years ago
INAGAKI Hiroshi 9e6f22e309 ath79: add support for Buffalo WHR-G301N
Buffalo WHR-G301N is a 2.4 GHz 11n router, based on Atheros AR7240.
Ported from ar71xx target.

Specification:

- Atheros AR7240
- 32 MB of RAM
- 4 MB of Flash
- 2.4 GHz 2T2R wifi
- 5x 10/100 Mbps Ethernet
- 9x LEDs, 4x keys
  - LED: 8x gpio-leds, 1x ath9k-leds
  - key: 2x buttons, 1x slide switch
- UART header on PCB
  - Vcc, GND, TX, RX from LEDs side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of WHR-G301N
2. Connect power cable to WHR-G301N and turn on it
3. Access to "http://192.168.11.1/" and open firmware update page
("ファーム更新")
4. Select the OpenWrt factory image and click execute ("実行") button
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[fix the SUPPORTED_DEVICES to be compatible with the ar71xx image]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Dmitry Tunin ae9c3105a3 ath79: use both WNDR3x00 power leds for boot status indication
Use the orange led by default to match the bootloader/stock firmware
behaviour. Turn on the green power led after boot to indicate a
finished boot and the orange one off.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
[reword commit message, keep orange power led enabled during early
kernel boot]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Dmitry Tunin 3d9610aa13 ath79: use both DIR-825 B1 power leds for boot status indication
Use the orange led by default to match the bootloader/stock firmware
behaviour. Turn on the blue power led after boot to indicate a finished
boot and the orange one off.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
[reword commit message, keep orange power led enabled during early
kernel boot]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Dmitry Tunin 7a873974f7 ath79: add support for indicating the boot state using multiple leds
Use diag.sh version used for apm821xx, ipq40xx and ipq806x, which
supports different leds for the different boot states.

The existing led sequences should be the same as before.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
[reword commit message]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Chuanhong Guo 1213504750 ath79: add support for TP-Link TL-WR941N/ND v2/v3
Specification:
- SoC: Atheros AR9132
- Flash: 4 MB
- RAM: 32 MB
- Ethernet: Marvell 88E6060 with 5 FE ports.

Flash instruction:
  Upload the generated factory firmware on web interface.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Johann Neuhauser 8db6522531 ath79: add support for TP-Link WR841N/ND v11
Specification:
- SoC: Atheros AR9533
- Flash: 4 MB
- RAM: 32 MB
- Ethernet: 4x LAN (100M) / 1x WAN (100M)
- WiFi: 2.4G 300M

Flash instruction:
  Flash factory image from stock WebUI.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
6 years ago
Johann Neuhauser 18f738d3c4 ath79: move TP-Link WR841v9 aliases node from dtsi to dts
Move the alias node of the TP-Link WR841v9 and rename the phandle of
the qss led to qss_led in preparation for adding the very similar
TP-Link WR841v11.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
6 years ago
Johann Neuhauser cc35c91f56 ath79: fix sysupgrade TP-Link WR841v9
Remove SUPPORTED_DEVICES from wr841-v9 because it´s not needed and
for consistency rename everything to tl-wr841-v9.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
6 years ago
Hannu Nyman 437e35f8a3 ath79: Add wifi to WNDR3700, WNDR3700v2 and WNDR3800
Add ath9k wifi capabilities to WNDR3700 family.

* use kmod-owl-loader to load firmware from "art"
* add wifi to DTS
* add wifi LEDs

Avoid using the same MAC for eth0 LAN and wlan0 by
toggling the eth0 MAC into a locally administered MAC.
That is currently done by in user-space by adding a
uci config item into /etc/config/network
(More elegant solution might be setting it already in
preinit phase.)

Known issues:

* wifi firmware file may not get created on the first boot
  after flashing on time to bring wifi normally up. Likely
  the overlay jffs2 is not yet ready for creating the
  firmware file. "wifi up" may still bring wifi up.
  Wifi will work normally at subsequent boots.

* phy0 and phy1 may get assigned mixed, so that phy0 may
  be the 5GHz radio instead of the normal 2.4GHz, and vice
  versa for phy1. Does not happen always, but may happen.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
[fix the wifi unit address in the dts]
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Icenowy Zheng b2a33d5463 ath79: add support for Pisen WMM003N (Cloud Easy Power)
Pisen WMM003N (sold under the name of Cloud Easy Power) is an
AR9331-based router and power bank combo device. The device uses a
stock firmware modified from OpenWRT for TP-Link TL-WR703N; however
some GPIO definition is different on this device with TL-WR703N. An
AXP202 PMIC (connected to a 5000mAh battery) and a SD slot are also
added, and the stock Flash/RAM configuration is 8MiB/64MiB.

The stock firmware is an old and heavily modified OpenWRT-based
firmware, which has telnetd defaultly open, and the root password is
"ifconfig" (quotation marks not included). The factory image format is
not known yet, however the stock firmware ships the OpenWRT's sysupgrade
command, and it can be used to install a newer firmware.

Due to the lack of the access to the STM8 embedded controller, the SD
slot is currently not usable (because it's muxed with the on-board USB
port) and the AXP PMIC cannot be monitored.

Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
6 years ago
Peter Lundkvist 3337f202d6 ath79: drop tl prefix for TP-Link RE450 v2
This router is called RE450 and the tl prefix was used to identify it
as a TP-Link device. Drop the tl prefix since we now have tplink in
dts and device name.

Signed-off-by: Peter Lundkvist <peter.lundkvist@gmail.com>
6 years ago
David Bauer 7d1b742b4d ath79: add QCA956x GMAC config
This commit adds the ability to configure the GMAC of the QCA956x.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Chuanhong Guo cf50f72069 ath79: ar913x: fix eth pll register
PLL for eth0 internal clock on ar913x is at 0x18050014
and AR913X_ETH0_PLL_SHIFT is 20 instead of 17

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Hannu Nyman 4dc7cb792a ath79: add WNDR3700 and WNDR3700v2
Add support for WNDR3700 and WNDR3700v2.

They share most things with WNDR3800.
Only device IDs and partition structure needs to be set.

Note: WNDR3700 (v1) has no NETGEAR_HW_ID, but has
      also the NA version of the factory image.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Hannu Nyman b58df9919e ath79: create WNDR3700 series .dtsi and adjust WNDR3800
Prepare for addition of WNDR3700 and WNDR3700v2 by
separating the common parts into wndr3700.dtsi and
leaving just the device-specific things into wndr3800.dts

The three routers are identical except
  * device IDs
  * WNDR3700 (v1) has only 8 MB flash, while others have 16 MB.
    Partition structure needs to be defined for each device.
  * (WNDR3800 has 128 MB RAM, but RAM size is not in DTS)

Also separate the common parts of the image recipe.
(Drop also the initramfs recipe.)

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Chuanhong Guo 8e4e545ecb ath79: fix eth pll for ar913x
PLL node is missing syscon in compatible string.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
INAGAKI Hiroshi a6369206fe ath79: add support for I-O DATA WN-AC1600DGR2
I-O DATA WN-AC1600DGR2 is a 2.4/5 GHz band 11ac router, based on
Qualcomm Atheros QCA9557.

Specification:

- Qualcomm Atheros QCA9557
- 128 MB of RAM
- 16 MB of Flash
- 2.4/5 GHz wifi
  - 2.4 GHz: 2T2R (SoC internal)
  - 5 GHz: 3T3R (QCA9880)
- 5x 10/100/1000 Mbps Ethernet
- 6x LEDs, 6x keys (4x buttons, 1x slide switch)
- UART header on PCB
  - Vcc, GND, TX, RX from ethernet port side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of WN-AC1600DGR2
2. Connect power cable to WN-AC1600DGR2 and turn on it
3. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
4. Select the OpenWrt factory image and click update ("更新") button
5. Wait ~150 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Dmitry Tunin 97de133368 ath79: add support of D-Link DIR-825 B1
Add support for the ar71xx supported D-Link DIR-825 B1 to ath79.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
6 years ago
Chuanhong Guo d4e3a31f6c ath79: add support for TP-Link TL-WDR4900 v2
Specification:
- SoC: Qualcomm Atheros QCA9558
- Flash: 8 MB
- RAM: 128 MB
- Ethernet: AR8327N with 5 GE ports.
- Wireless radio: QCA9558 for 2.4G and AR9580 for 5G.

Flash instruction:
  Upload the generated factory firmware on web interface.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
David Bauer c4931713df ath79: add support for OCEDO Koala
This commit adds support for the OCEDO Koala

SOC:	Qualcomm QCA9558 (Scorpion)
RAM:    128MB
FLASH:  16MiB
WLAN1:  QCA9558 2.4 GHz 802.11bgn 3x3
WLAN2:  QCA9880 5 GHz 802.11nac 3x3
INPUT:  RESET button
LED:    Power, LAN, WiFi 2.4, WiFi 5, SYS
Serial: Header Next to Black metal shield
        Pinout is 3.3V - GND - TX - RX (Arrow Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

Tested and working:
 - Ethernet
 - 2.4 GHz WiFi
 - 5 GHz WiFi
 - TFTP boot from ramdisk image
 - Installation via ramdisk image
 - OpenWRT sysupgrade
 - Buttons
 - LEDs

Installation seems to be possible only through booting an OpenWRT
ramdisk image.

Hold down the reset button while powering on the device. It will load a
ramdisk image named 'koala-uImage-initramfs-lzma.bin' from 192.168.100.8.

Note: depending on the present software, the device might also try to
pull a file called 'koala-uimage-factory'. Only the name differs, it
is still used as a ramdisk image.

Wait for the ramdisk image to boot. OpenWRT can be written to the flash
via sysupgrade or mtd.

Due to the flip-flop bootloader which we not (yet) support, you need to
set the partition the bootloader is selecting. It is possible from the
initramfs image with

 > fw_setenv bootcmd run bootcmd_1

Afterwards you can reboot the device.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Chuanhong Guo 387736af41 ath79: ag71xx: remove PHY reset
Bit 8/12 of reset controller which is marked as PHY_RESET/SWITCH_RESET
in datasheets will trigger either a reset for builtin switch or assert
an external ETH0_RESET_L/ETH1_RESET_L pin, which are usually connected
to external PHY/switch. None of them should be triggered every time an
interface is brought up in ethernet driver.

Remove PHY reset support from ag71xx and definition for them in dtsi.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
INAGAKI Hiroshi 23519edbca ath79: add support for Buffalo BHR-4GRV2
Buffalo BHR-4GRV2 is a wired router, based on Qualcomm Atheros
QCA9558.
Ported from ar71xx target.

Specification:

- Qualcomm Atheros QCA9558
- 64 MB of RAM
- 16 MB of Flash
- 5x 10/100/1000 Ethernet
  - QCA8337N
- 4x LEDs, 2x keys
- UART header on PCB
  - Vcc, TX, RX, GND from LED side
  - 115200n8

Flash instruction using factory image:

1. Connect the computer to the LAN port of BHR-4GRV2
2. Connect power cable to BHR-4GRV2 and turn on it
3. Access to "http://192.168.12.1/" and open firmware update
page ("ファームウェア更新")
4. Select the OpenWrt factory image and click update ("更新実行")
button
5. Wait ~120 seconds to complete flashing

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
David Bauer 6555612783 ath79: fix PLL settings for QCA955x
This adds PLL settings for the ethernet ports of the TP-Link TL-WR1043
v2/v3 and the Openmesh OM5P-AC-v2.

We also change the PLL-settings in the qca9557.dtsi to match the ones
used as default on the ar71xx target.

As of 4b9680f138 those devices have broken ethernet ports as the default
PLL settings defined in the QCA9557.dtsi are applied which are off for
those devices.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Kevin Darbyshire-Bryant 995a1ba841 ath79: add pll for archer c7
commit 4b9680f fixed pll settings and the correct pll set
by bootloader is overrided by value in qca9557.dtsi which
is incorrect for Archer C7 and breaks ethernet. Add pll
values for archer c7 to fix ethernet connection.

This individual pll tweak has been cherry picked from github pr 1260
which changes a couple of things in a single commit and should be
ideally split.  This commit get archer v7 back and working.

Tested: archer c7 v2

Original combined commit authored by:
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
c7 fix only split out by:
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
David Bauer 4b9680f138 ath79: fix QCA9557 eth PLL settings
The QCA9557 dtsi is currently missing pll-handle and pll-regs for both
eth0 and eth1, therefore PLL settings won't be applied. This commit
fixes this behavior.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Chuanhong Guo 1edba538a9 ath79: Fix led nodes for TL-WR740N v2 and add its clones
This patch did the following things:
1. Separate ath9k-leds out of gpio leds so that all other leds will work
   before ath9k loded (e.g. during preinit/init stage).
2. Rename wps led to qss since that's how TP-Link mark it.
3. Rename LED prefix to tp-link because that dts is shared by many devices.
4. Rename to wr740n-v1 because v1 is the first and v2 just use the fw of v1.
   (This will require a forced sysupgrade if you comes from
   the previous wr740n v2 image.)
5. Remove SUPPORTED_DEVICES.
   (tl-wr740n-v2 doesn't exist anywhere so it's useless.)
6. Add all WR741ND v1 clones found in ar71xx.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Mathias Kresin 55ff2951ea ath79: fix dts warnings
Fix all issues found by the devicetree compiler like wrong address/size
cells as well as wrong/missing/superfluous unit addresses.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin bf078fcab6 ath79: fix node names
Use the standardized node names from the devicetree specification.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin a8ad7b6efa ath79: fix compatible strings
Use only the jedec,spi-nor compatible string. Everything else either
never worked or is only support to keep compatibility.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Mathias Kresin 7b42247182 ath79: fix whitespace issue in dts files
Fixes spaces vs. tabs issues and remove indentation on blank lines.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Chuanhong Guo 18a2595315 ath79: rename tl-archer-c7 to archer-c7
This router is called Archer C7 and the tl was used to identify
TP-LINK. Since we have added tplink in dts/board name, the tl
prefix is useless now.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 8288af1e18 ath79: rename dts/image using manufacturer_board scheme
This helps getting rid of SUPPORTED_DEVICES which can be
auto-generated in image/Makefile.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 690c55e8cc ath79: fix support for TL-WR740N/WR741N v4
1. Swap eth0/eth1
 Both devices are using AR9331, the builtin switch on AR9331 is
 connected to gmac1 and gmac1 is named as eth1 in ath79.
 PS: gmac1 is eth0 and gmac0 is eth1 in ar71xx because of the
 reversed initialization order.
2. Fix the incorrect compatible string in dts

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 115e993adc ath79: remove useless phy-handle nodes
phy-handle is used to poll link status. They are useless when
we need fixed-link on these interfaces.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Mathias Kresin 1d18a14a90 ath79: really fix TP-Link Archer C7 v2 MAC address
Revert 290c54473e ("ath79: fix TP-Link Archer C7 v2 wlan1 MAC address")
which obviously aims to have a distinct MAC address per interface.

Unfortunally it doesn't match what is used by the stock firmware and we
shouldn'z use MAC Adresses not reserverd for/assigned to a particular
board.

The correct MAC adress increments for this board are:

wlan0 (5GHz) : -1
wlan1 (2.4GHz) : 0
eth1 (LAN) : 0
eth0 (WAN) : 1

Fixes: FS#408

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Daniel F. Dickinson 60cf71ede7 ath79: Forward port support for CR3000
The PowerCloud Systems CR3000 was a cloud-managed CPE for a now defunct
NaaS offering.  It was previously supported under the ar71xx branch and
this forward ports that support with some notable differences:

1) Since reverting to stock firmware is now irrelevant there is is only
a single openwrt image generated which uses the entire flash rather than
preserving PowerCloud-specific partitions that are unneeded to openwrt--
those partitions will be erased and used by the openwrt image.

2) Rather than use a non-standard probe order for the ethernet devices,
this image uses a set of 'ip link set ethX name ethY' commands very early
in preinit (before the network is used at all), in order to have the the
switch and Wan use the same ethernet names as in previous images.

3) /etc/config/wireless will need to be regenerated as the path to the
wireless device has changed due to differences in ath79 DT for ar93x
compared to ar71xx images.

4) eth0 is wan and eth1 is lan (switch)

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
Lucian Cristian accb67e582 ath79: add support for tl-wr841n-v9
Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Chuanhong Guo 7a07b4cff0 ath79: Add switch reset definition in dts
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo a5fa6b3825 ath79: ar724x: Fix reset definition for gmac0/gmac1
reset bit 8 is for builtin switch and bit 12 is marked 'reserved' on datasheet.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 4e5ba50760 ath79: ar7240: Update dts for current ag71xx driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 85189e4c00 ath79: ag71xx: Rework mdio clock settings
Allow specifying desired mdio clock frequency in dts.
Use default frequency around 5MHz for builtin switch and 2MHz for other mdio bus.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo bb7fac4369 ath79: ar7242: Update dts for current ag71xx driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 113b4cf90f ath79: ar7241: Update dts for current ag71xx driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo b6c8e5deae ath79: Fix support for TP-LINK Archer C7 v2
Remove mdio1 and phy1 handle. AR8327N is controlled through mdio0.
Add gmac-config for Archer C7.
Remove ucidef_set_interfaces_lan_wan. They can be determined by config_generate automatically.

The following are for adding support for WDR4900 v2/Archer C7 v1 and other
devices that shared the same machine file in ar71xx:
Move mtd partitions to archer-c7-v2.dts. Only Archer C7 v2 has 16M flash.
Flash on Archer C7 v1/TL-WDR4900 v2 is 8M.
Add label for wlan leds. The default trigger for archer c7/wdr4900 is different.
Move wlan5g led to archer-c7-v2.dts. 5G led on WDR4900 is connected to ar9380.
Move rfkill definition to archer-c7-v2.dts. There is no such a button on wdr4900 v2.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 18db385eb7 ath79: qca955x: Update dts for current ag71xx driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo b7a10772d1 ath79: qca956x: Update dts for current ag71xx driver
enable mdio1 by default because mdio1 node is a subnode of eth1
and eth1 node is a "simple-mfd", which makes mdio1 disabled when
eth1 isn't enabled.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo fc1f55ebf4 ath79: qca953x: Add chosen node and specify console in bootargs
Most qca devices use 115200n8 as it's default uart baudrate.
Add 'chosen' node for qca953x like other SoCs in ath79 target.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo e8245c5b3f ath79: qca953x: Update dts for current ag71xx driver
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Lucian Cristian e6417390e0 ath79: update qca9533 to new irq driver
Commit c7efc93 renamed controller name
to qca,ar9340-intc and added some functions but qca9533.dtsi was overlooked.
Correct the dtsi and adust it to the new format

Add gmac and correct reset for cascaded irq and build-in switch
Also add the reference clock to soc dtsi so we don't have to have it in every dts

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>

Remove switch reset definition
Fix gmac compatible string (We only need SW_PHY_SWAP and SW_PHY_ADDR_SWAP on qca953x so use ar9330-gmac instead of ar9340-gmac.)

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo c7c807cb8c ath79: ar933x: Update dts for current ag71xx driver
gmac0 is always connected to switch phy4 and mdio1 is always needed.
So add phy handle for eth0 and enable mdio1 by default.
Move fixed-link for gmac1 from device dts to ar9331.dtsi because gmac1 is always connected to builtin switch.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo f6c99241ba ath79: ar934x: Update dts for current ag71xx driver
Enable mdio1 by default because mdio1 is needed when eth1 is enabled.

PS: If a ar9341 device has only one port and you only want to use gmac0,
change compatible of gmac1 to "syscon", "simple-mfd" in dts.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo 2d081addb5 ath79: ag71xx: Split gmac config into separated file and add support for ar934x/qca955x.
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Chuanhong Guo b346c37588 ath79: Fix mac reset and gmac compatible in ar934x.dtsi
Also add phy-mode and fixed-link as gmac1 is always connected
to the builtin switch.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago
Daniel F. Dickinson 915966d861 ath79: Port PowerCloud Systems CAP324 support
The CAP324 was an AP for a NaaS offering that is now defunct.  While
previously supported in the ar71xx arch, there were some errata (to
be fixed shortly).

Notable differences from ar71xx support:

1) The method of getting the ath9k firmware for the PCIe 2ghz wifi has
changed (due to changes in how the arch handles this), since this device
doesn't use the EEPROM except to get the MAC address of the wifi.

2) /etc/config/wireless will need to be regenerated as the path(s) to
the wireless device(s) have changed.

3) ath79 OpenWrt firmware no longer supports build an image that allows
reverting to stock firmware (as the cloud service no longer exists, the
stock firmware is useless), instead using all of the flash for image and
overlay (less u-boot/env and art).

4) Initial network config treats the ethernet port as a Lan port with
the standard default address (192.168.1.1 unless changed in .config
--e.g. via menuconfig) instead of using DHCP (this was the default for
the stock firmware, however for openwrt use this is rather confusion and
counter-productive as the user has a harder time finding the device on
the network.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
Daniel F. Dickinson 4b93cbd172 ath79: Port PowerCloud Systems CR5000 support
Add ath79 arch support for PowerCloud Systems CR5000.  Previously
supported under ar71xx (however there are some errors in that support;
to be fixed shortly).

Info:

* This board is based on the Atheros DB120 reference design, but doesn't
  use the on-board switch.  Instead it attachs GMAC0 to an AR8327 switch.
* It only uses GMAC0 and the WAN is simply a VLAN in the stock firmware.
* It has 64MB RAM and 8MB flash.
* In the dts version we get rid of using 'open-drain' for the AR8327
  LED controls.
* As with the platform data version we disable JTAG as this conflicts
  with one of the pair of GPIO's required for the power/status LED
  (GPIO2 and GPIO4 are used for this LED).
* The pcie card wifi has an EEPROM but gets it's MAC address from
  the ART partition.
* The SoC wifi (2.4 GHz) is all from the ART.
* The USB is support comes from the SoC.

NB. This is actually an AR9342 rather than AR9344 but we use the 9344
definitions because there are no relevant differences for this board.

NB: Building only images that don't support reverting to the old
cloud-based firmware as the Skydog cloud service for the CR5000 no
longer exists.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
6 years ago
David Bauer 5409dcffbd ath79: fix OCEDO Raccoon
The OCEDO Raccoon only has one ethernet port, but currently uci sections
for WAN and LAN are created.

Additionally, newer versions of the devices U-Boot (units with SteelWRT)
set the kernel-cmdline and therefore overwrite the partition-layout.
We fix this by overwriting the cmdline supplied by the bootloader.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Aleksandr V. Piskunov 290c54473e ath79: fix TP-Link Archer C7 v2 wlan1 MAC address
The mac address for the 2.4 wireless need to be decremented by one.

Correct MAC adress increments for this board are:
wlan0 (5GHz)   : -2
wlan1 (2.4GHz) : -1
eth1  (LAN)    :  0
eth0  (WAN)    :  1

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
6 years ago
David Bauer 6476148034 ath79: add support for OCEDO Raccoon
This commit adds support for the OCEDO Raccoon

SOC:	Atheros AR9344
RAM:    128MB
FLASH:  16MiB
WLAN1:  AR9344 2.4 GHz 802.11bgn 2x2
WLAN2:  AR9382 5 GHz 802.11an 2x2
INPUT:  RESET button
LED:    Power, LAN, WiFi 2.4, WiFi 5
Serial: Header Next to Black metal shield
        Pinout is 3.3V - GND - TX - RX (Arrow Pad is 3.3V)
        The Serial setting is 115200-8-N-1.

	NOTE: The U-Boot won't boot with the serial attached.
	Boot the device without serial attached and attach it
	after 3 seconds.

Tested and working:
 - Ethernet
 - 2.4 GHz WiFi
 - 5 GHz WiFi
 - TFTP boot from ramdisk image
 - Installation via ramdisk image
 - OpenWRT sysupgrade
 - Buttons
 - LEDs

Installation seems to be possible only through booting an OpenWRT
ramdisk image.

Hold down the reset button while powering on the device. It will load a
ramdisk image named 'raccoon-uImage-initramfs-lzma.bin' from 192.168.100.8.

Note: depending on the present software, the device might also try to
pull a file called 'raccoon-uimage-factory'. Only the name differs, it
is still used as a ramdisk image.

Wait for the ramdisk image to boot. OpenWRT can be written to the flash
via sysupgrade or mtd.

Due to the flip-flop bootloader which we not (yet) support, you need to
set the partition the bootloader is selecting. It is possible from the
initramfs image with

 > fw_setenv bootcmd run bootcmd_1

Afterwards you can reboot the device.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Christoph Krapp e420b7b5c5 ath79: add support for UniFi AC-Mesh Pro
The Unifi AC-Mesh Pro has identical hardware to the Unifi AC-Pro except
USB support.
Furthermore for setting parameters like antenna gain it is helpful to
know the exact device variant.

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
6 years ago
Christoph Krapp 8722c52b41 ath79: remove bs-partition ro-flag for UniFi AC devices
This removes the read-only flag from the bs (bootselect) partition
on UniFi AC devices. This allows to correct the indicator from which
partition the device is booting its kernel from.

See also:
 - freifunk-gluon/gluon#1301
 - https://bugs.lede-project.org/index.php?do=details&task_id=662

Signed-off-by: Christoph Krapp <achterin@googlemail.com>
6 years ago
Aleksandr V. Piskunov 63c9081c77 ath79: swap TP-Link Archer C7 v2 USB port LED and GPIO names
TP-Link Archer C7 v2 USB port LED and GPIO names are in incorrect order,
i.e. in order to match actual user visible labels, usb1 should be usb2,
and vice versa.
This patch swaps LED and GPIO power control node names.

Signed-off-by: Aleksandr V. Piskunov <aleksandr.v.piskunov@gmail.com>
6 years ago
Peter Lundkvist 781ad46206 ath79: add support for TP-Link RE450 v2
TP-Link RE450 v2 is a dual band router/range-extender
based on Qualcomm/Atheros QCA9563 + QCA9880.

Specification:

- 775 MHz CPU
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 3T3R 5 GHz
- 1x 10/100/1000 Mbps Ethernet (AR8033 PHY)
- 7x LED, 4x button
- UART header on PCB (needs unmounted R64 & R69 0201 resistors/jumpers)

Flash instruction:
Apply factory image in OEM firmware web-gui.

U-Boot does not seem to have any recovery functions, so
debricking requires connection via UART.

Signed-off-by: Peter Lundkvist <peter.lundkvist@gmail.com>
6 years ago
Rocco Folino 4ff019722c ath79: port TP-Link TL-WR741ND v4 and TL-WR740ND v4
This patch ports the TP-Link TL-WR741ND v4 and TL-WR740ND v4 to the
ath79 target.

Because the two devices share the same hw layout, this patch adds a common
.dtsi which is included by the two .dts.

Signed-off-by: Rocco Folino <rocco@folino.io>
6 years ago
Rocco Folino 9b575288eb ath79: add pinmux to ar9330
This patch adds the pinmux support to the ar9330 used to disable the
JTAG or to enable switch LEDs

Signed-off-by: Rocco Folino <rocco@folino.io>
6 years ago
Adrian Schmutzler 4456dd4660 ath79: add support for Unifi AC Mesh
The Unifi AC Mesh is equivalent to the Unifi AC Lite. However,
for setting certain parameters with the flashed device it is
helpful that the devices know their variant (e.g. automatically
setting antenna gain for the different antennas in Lite and Mesh).

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
6 years ago
Dmytro Smyrnov 40218a2632 ath79: add support for more AR7241 TP-Link boards
Its common AP99(AR7241) platform with following devices:

  TP-Link TL-WR841N/ND v7 (SoC AR7241 / Wifi AR9287 / without USB)
  TP-Link TL-MR3220 v1 (SoC AR7241 / Wifi AR9285 / USB support)
  TP-Link TL-MR3420 v1 (SoC AR7241 / Wifi AR9287 / USB support)

Signed-off-by: Dmytro Smyrnov <dioptimizer@hotmail.com>
Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Lucian Cristian 25070f7106 ath79: small wr1043nd-v4 fixes
- fix sysupgrade check
- move usb to v4 dts because v5 doesn't have it
- make wan mac address behave like ar71xx target
- add orange wan led support, it can be userspace activated like:

  on:
  echo default-on > /sys/class/leds/tp-link\:orange\:wan/trigger

  off:
  echo none > /sys/class/leds/tp-link\:orange\:wan/trigger

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Lucian Cristian 7dd3d7e1d3 ath79: add support for Ubiquiti UniFi AC-Pro
rework the dts to a common unifi-ac dtsi
pro network is connected via phy0 and has usb ports
lite network is connected via phy4 without usb ports

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Adrian Schmutzler 56fddc2577 ath79: sync naming of Ubiquiti devices
Use a Unifi AC Lite board-/image name consistent with other Ubiquiti
devices.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
6 years ago
Chuanhong Guo c463320812 ath79: Remove all memory nodes defined in dts
This target can automatically detect the correct memory size and we've
been using it for long in ar71xx.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
6 years ago