ath79: add support for FRITZ!WLAN Repeater 450E
authorDavid Bauer <[email protected]>
Sat, 28 Mar 2020 09:56:51 +0000 (10:56 +0100)
committerDavid Bauer <[email protected]>
Sat, 28 Mar 2020 09:56:57 +0000 (10:56 +0100)
Signed-off-by: David Bauer <[email protected]>
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

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..f8b1ee9
--- /dev/null
@@ -0,0 +1,155 @@
+// 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"
+
+/ {
+       compatible = "avm,fritz450e", "qca,qca9556";
+       model = "AVM FRITZ!WLAN Repeater 450E";
+
+       aliases {
+               led-boot = &led_power_green;
+               led-failsafe = &led_power_green;
+               led-running = &led_power_green;
+               led-upgrade = &led_power_green;
+
+               label-mac-device = &eth0;
+       };
+
+       chosen {
+               bootargs = "console=ttyS0,115200n8";
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       label = "WPS";
+                       linux,code = <KEY_WPS>;
+                       gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
+                       debounce-interval = <60>;
+               };
+       };lna0
+
+       leds {
+               compatible = "gpio-leds";
+
+               led_power_green: power_green {
+                       label = "fritz450e:green:power";
+                       gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
+               };
+
+               lan {
+                       label = "fritz450e:green:lan";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+                       linux,default-trigger = "phy0tpt";
+               };
+
+               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>;
+               };
+       };
+};
+
+&eth0 {
+       status = "okay";
+
+       phy-mode = "sgmii";
+       phy-handle = <&phy0>;
+
+       pll-data = <0x03000000 0x00000101 0x00001313>;
+};
+
+&eth1 {
+       compatible = "syscon", "simple-mfd";
+};
+
+&mdio1 {
+       phy0: ethernet-phy@0 {
+               reg = <0>;
+
+               reset-gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&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 = <0x000000 0x020000>;
+                               read-only;
+                       };
+
+                       partition@1 {
+                               compatible = "avm,eva-firmware";
+                               label = "firmware";
+                               reg = <0x020000 0xee0000>;
+                       };
+
+                       partition@2 {
+                               label = "tffs (1)";
+                               reg = <0xf00000 0x080000>;
+                               read-only;
+                       };
+
+                       partition@3 {
+                               label = "tffs (2)";
+                               reg = <0xf80000 0x080000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&uart {
+       status = "okay";
+};
+
+&gpio {
+       mdc {
+               gpio-hog;
+               gpios = <12 0>;
+               output-high;
+               line-name = "fritz450e:pullup:mdc";
+       };
+
+       mdio {
+               gpio-hog;
+               gpios = <19 0>;
+               output-high;
+               line-name = "fritz450e:pullup:mdio";
+       };
+};
+
+&wmac {
+       status = "okay";
+
+       qca,no-eeprom;
+};
index 046339aa0ae00018c81116cfc86335959b82d602..9f3adc658b497886862501a116f6f6bdf371a88a 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|\
+fritz,450e)
        ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0"
        ;;
 avm,fritz300e)
index 9db21caad800468851ea190b31dc95b80d4cc92f..831606e0f5d741a193e319077466d3fc6b451835 100755 (executable)
@@ -14,6 +14,7 @@ ath79_setup_interfaces()
        alfa-network,ap121f|\
        aruba,ap-105|\
        avm,fritz300e|\
+       avm,fritz450e|\
        devolo,dvl1200i|\
        devolo,dvl1750c|\
        devolo,dvl1750i|\
index a96b44b1c9a40e58b7a42d260b9fff868b13b319..3372dbd301af4c96f1b24a38f7edc53bdecb2dca 100644 (file)
@@ -9,6 +9,7 @@ board=$(board_name)
 case "$FIRMWARE" in
 "ath9k-eeprom-ahb-18100000.wmac.bin")
        case $board in
+       avm,fritz450e|\
        avm,fritz4020)
                caldata_extract_reverse "urlader" 0x1541 0x440
                ;;
index a0fb9fc7174c6f44ccc733bbf995cd941816b8ea..dde6086289107404e55540e0dbb5ca7ce8e78985 100644 (file)
@@ -4,6 +4,9 @@
 
 preinit_set_mac_address() {
        case $(board_name) in
+       avm,fritz450e)
+               ip link set dev eth0 address $(fritz_tffs -n maca -i $(find_mtd_part "tffs (1)"))
+               ;;
        siemens,ws-ap3610)
                ip link set dev eth0 address $(mtd_get_mac_ascii cfg1 ethaddr)
                ;;