ath79: add support for AVM FRITZ!WLAN Repeater 450E
authorDavid Bauer <mail@david-bauer.net>
Tue, 14 Apr 2020 01:58:37 +0000 (03:58 +0200)
committerDavid Bauer <mail@david-bauer.net>
Sun, 19 Apr 2020 14:45:40 +0000 (16:45 +0200)
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>
target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi [new file with mode: 0644]
target/linux/ath79/dts/qca9556_avm_fritz1750e.dts
target/linux/ath79/dts/qca9556_avm_fritz450e.dts [new file with mode: 0644]
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom
target/linux/ath79/generic/base-files/lib/preinit/10_fix_eth_mac.sh
target/linux/ath79/image/generic.mk

diff --git a/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi b/target/linux/ath79/dts/qca9556_avm_fritz-repeater.dtsi
new file mode 100644 (file)
index 0000000..b1f5f1b
--- /dev/null
@@ -0,0 +1,93 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca9557.dtsi"
+
+/ {
+       chosen {
+               bootargs = "console=ttyS0,115200n8";
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               wps {
+                       label = "wps";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
+               };
+       };
+};
+
+&uart {
+       status = "okay";
+};
+
+&spi {
+       status = "okay";
+       num-cs = <1>;
+
+       flash@0 {
+               compatible = "jedec,spi-nor";
+               reg = <0>;
+               spi-max-frequency = <25000000>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       partition@0 {
+                               label = "urlader";
+                               reg = <0x0 0x20000>;
+                               read-only;
+                       };
+
+                       partition@20000 {
+                               compatible = "avm,eva-firmware";
+                               label = "firmware";
+                               reg = <0x20000 0xee0000>;
+                       };
+
+                       partition@f00000 {
+                               label = "tffs (1)";
+                               reg = <0xf00000 0x80000>;
+                               read-only;
+                       };
+
+                       partition@f80000 {
+                               label = "tffs (2)";
+                               reg = <0xf80000 0x80000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&wmac {
+       status = "okay";
+       qca,no-eeprom;
+};
+
+&eth1 {
+       status = "okay";
+
+       phy-handle = <&phy0>;
+       pll-data = <0x3000000 0x101 0x1313>;
+
+       gmac-config {
+               device = <&gmac>;
+               ge0-sgmii = <0>;
+       };
+};
+
+&mdio1 {
+       status = "okay";
+
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+       };
+};
index f50af5b22860df6a49282c31ba90d28324ea3f83..25d3ae8da45c9ce775318b5911d24d1769132a40 100644 (file)
@@ -1,19 +1,13 @@
 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-/dts-v1/;
 
 #include <dt-bindings/gpio/gpio.h>
-#include <dt-bindings/input/input.h>
 
-#include "qca9557.dtsi"
+#include "qca9556_avm_fritz-repeater.dtsi"
 
 / {
        compatible = "avm,fritz1750e", "qca,qca9557";
        model = "AVM FRITZ!WLAN Repeater 1750E";
 
-       chosen {
-               bootargs = "console=ttyS0,115200n8";
-       };
-
        aliases {
                led-boot = &led_power;
                led-failsafe = &led_power;
                        gpios = <&spi_gpio 4 GPIO_ACTIVE_HIGH>;
                };
        };
-
-       keys {
-               compatible = "gpio-keys";
-
-               wps {
-                       label = "wps";
-                       linux,code = <KEY_WPS_BUTTON>;
-                       gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
-               };
-       };
 };
 
 &pcie0 {
        status = "okay";
 };
 
-&uart {
-       status = "okay";
-};
-
-&spi {
-       status = "okay";
-       num-cs = <1>;
-
-       flash@0 {
-               compatible = "jedec,spi-nor";
-               reg = <0>;
-               spi-max-frequency = <25000000>;
-
-               partitions {
-                       compatible = "fixed-partitions";
-                       #address-cells = <1>;
-                       #size-cells = <1>;
-
-                       partition@0 {
-                               label = "urlader";
-                               reg = <0x0 0x20000>;
-                               read-only;
-                       };
-
-                       partition@20000 {
-                               compatible = "avm,eva-firmware";
-                               label = "firmware";
-                               reg = <0x20000 0xee0000>;
-                       };
-
-                       partition@f00000 {
-                               label = "tffs (1)";
-                               reg = <0xf00000 0x80000>;
-                               read-only;
-                       };
-
-                       partition@f80000 {
-                               label = "tffs (2)";
-                               reg = <0xf80000 0x80000>;
-                               read-only;
-                       };
-               };
-       };
+&phy0 {
+       reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
 };
 
 &gpio {
                line-name = "PCIE Bus reset";
        };
 };
-
-&wmac {
-       status = "okay";
-       qca,no-eeprom;
-};
-
-&eth1 {
-       status = "okay";
-
-       phy-handle = <&phy0>;
-       pll-data = <0x3000000 0x101 0x1313>;
-
-       gmac-config {
-               device = <&gmac>;
-               ge0-sgmii = <0>;
-       };
-};
-
-&mdio1 {
-       status = "okay";
-
-       phy0: ethernet-phy@0 {
-               reg = <0>;
-               reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
-       };
-};
diff --git a/target/linux/ath79/dts/qca9556_avm_fritz450e.dts b/target/linux/ath79/dts/qca9556_avm_fritz450e.dts
new file mode 100644 (file)
index 0000000..60685bd
--- /dev/null
@@ -0,0 +1,76 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include <dt-bindings/gpio/gpio.h>
+
+#include "qca9556_avm_fritz-repeater.dtsi"
+
+/ {
+       compatible = "avm,fritz450e", "qca,qca9557";
+       model = "AVM FRITZ!WLAN Repeater 450E";
+
+       aliases {
+               led-boot = &led_power;
+               led-failsafe = &led_power;
+               led-running = &led_power;
+               led-upgrade = &led_power;
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_power: power {
+                       label = "fritz450e:green:power";
+                       gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+               };
+
+               wlan {
+                       label = "fritz450e:green:wlan";
+                       gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy0tpt";
+               };
+
+               lan {
+                       label = "fritz450e:green:lan";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi2 {
+                       label = "fritz450e:green:rssi2";
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi3 {
+                       label = "fritz450e:green:rssi3";
+                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+               };
+
+               rssi4 {
+                       label = "fritz450e:green:rssi4";
+                       gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&gpio {
+       /*
+        * Wondered why rssi0 and rssi1 are missing?
+        *
+        * AVM seems to have run low on usable GPIO pins, so
+        * instead of adding a shift register like they did for
+        * the 1750E they figured out "Why not use the LEDs on
+        * the AR8033?".
+        *
+        * EVA configures the PHY in a way it does not display
+        * the link-state using it's LEDs. When we reset the PHY
+        * using the reset-mechanism of the PHY subsystem, this
+        * setting is cleared.
+        *
+        * We avoid this by keeping the reset line high.
+        */
+       phy-reset {
+               gpio-hog;
+               gpios = <11 GPIO_ACTIVE_HIGH>;
+               output-high;
+               line-name = "phy-reset";
+       };
+};
index b57f4cdd8e8a4d18f891cb0ae24f4ccafc17e119..ca4bb3dd33d42b6d472048dbfcf7eb35d2d3958d 100755 (executable)
@@ -12,7 +12,8 @@ case "$board" in
        ucidef_set_led_netdev "lan" "LAN" "$boardname:orange:eth0" "eth0"
        ucidef_set_led_switch "wan" "WAN" "$boardname:orange:eth1" "switch0" "0x04"
        ;;
-alfa-network,ap121f)
+alfa-network,ap121f|\
+avm,fritz450e)
        ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
        ;;
 avm,fritz1750e)
index 96800d771f11f589928f3206a2e142bc826de721..543543ad548e4a91fc88efefc668ef37ea8827b4 100755 (executable)
@@ -338,7 +338,8 @@ ath79_setup_macs()
        alfa-network,ap121f)
                label_mac=$(mtd_get_mac_binary art 0x1002)
                ;;
-       avm,fritz1750e)
+       avm,fritz1750e|\
+       avm,fritz450e)
                label_mac=$(fritz_tffs -n macwlan -i $(find_mtd_part "tffs (1)"))
                ;;
        avm,fritz300e)
index 782e003911a45a56df5333a192b7e067b5ca08c5..428b502d81a8d6b495097435e04fc3836d21ca26 100644 (file)
@@ -10,7 +10,8 @@ case "$FIRMWARE" in
 "ath9k-eeprom-ahb-18100000.wmac.bin")
        case $board in
        avm,fritz1750e|\
-       avm,fritz4020)
+       avm,fritz4020|\
+       avm,fritz450e)
                caldata_extract_reverse "urlader" 0x1541 0x440
                ;;
        dlink,dir-505|\
index 371efd6a8376573d2e4878e5898e152104bc4be3..b3c3de298e69445d4445a2352bd7dc9f7976a83d 100644 (file)
@@ -4,7 +4,8 @@
 
 preinit_set_mac_address() {
        case $(board_name) in
-       avm,fritz1750e)
+       avm,fritz1750e|\
+       avm,fritz450e)
                ip link set dev eth0 address $(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
                ;;
        siemens,ws-ap3610)
index 3acbeb2859979dc61b84cb0ead8444f1076e145f..b449832ad2886a7787a786f8e429954395a5c9b5 100644 (file)
@@ -201,6 +201,15 @@ define Device/avm_fritz4020
 endef
 TARGET_DEVICES += avm_fritz4020
 
+define Device/avm_fritz450e
+  $(Device/avm)
+  SOC := qca9556
+  IMAGE_SIZE := 15232k
+  DEVICE_MODEL := FRITZ!WLAN Repeater 450E
+  SUPPORTED_DEVICES += fritz450e
+endef
+TARGET_DEVICES += avm_fritz450e
+
 define Device/buffalo_bhr-4grv
   SOC := ar7242
   DEVICE_VENDOR := Buffalo