lantiq: add support for AVM Fritzbox 5490/5491
authorDaniel Kestrel <kestrel1974@t-online.de>
Mon, 14 Feb 2022 20:55:19 +0000 (21:55 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 2 Feb 2024 14:07:07 +0000 (15:07 +0100)
This adds support for the Fritzbox 5490/5491 devices. They contain
two SoCs, one Lantiq without WiFi and one QCA9558 with 2.4GHz
and 5 GHz WiFi. Only the Lantiq has access to the flash memory,
the Atheros runs fully from RAM and is booted by using a remoteproc
kernel module which is not supported with this commit.
Both devices have fiber WAN ports.
The devices were manufactured with varying NAND chips which
requires Micron and non-Micron versions of the images.

Specifications:
 - SoC: Lantiq 500 MHz
 - RAM: 256 MB
 - Storage: 512 MB NAND, 1MB FLASH
 - Wireless, separate SOC QCA9558 with 128MB RAM (not supported yet):
   · Qualcomm-QCA9558 w/ 3×3 MIMO for 2.4GHz 802.11b/g/n
   · Qualcomm-QCA9880 w/ 3×3 MIMO for 5GHz 802.11a/ac
   · AG71xx ethernet
 - Ethernet: Built-in AR 803x, 7 port Lantiq gswip switch,
   4x 1000/100/10 port (additional qca8334 switch for 2 ports), Port 5 is
   fixed and connected to the Wireless SOC
 - Renesas µPD720202 USB3 PCIe, requires firmware binary on the device
 - AT 8033 based AON fiber port (5490) or GPON fiber port (5491)

Unsupported:
 - DECT and ISDN telephony
 - Two ethernet ports (on extra switch) and fiber port not working

Installation:
Check which NAND the device has by using the following procedure with
stock firmware:
Go to to http://<fritzbox_ip>/support.lua, download the support data
file and search for string "NAND device" to get the manufacturer kernel
output.
Use Micron image if Micron is displayed otherwise the non-Micron image.
Use the eva_ramboot.py script to boot the initramfs image. Follow the
procedure to interrupt booting by ftp into 192.168.178.1 within
5 seconds after poweron.
Then transfer the sysupgrade image to the device and run sysupgrade to
flash it to the NAND.
For making USB work, an renesas xhci firmware file (e.g. v2026) is
needed and it should be copied to /lib/firmware/ (file name
renesas_usb_fw.mem).

Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490-micron.dts [new file with mode: 0644]
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dts [new file with mode: 0644]
target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dtsi [new file with mode: 0644]
target/linux/lantiq/image/vr9.mk
target/linux/lantiq/xrx200/base-files/etc/board.d/01_leds
target/linux/lantiq/xrx200/base-files/etc/board.d/02_network
target/linux/lantiq/xrx200/base-files/lib/upgrade/platform.sh

diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490-micron.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490-micron.dts
new file mode 100644 (file)
index 0000000..18bb81d
--- /dev/null
@@ -0,0 +1,12 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "vr9_avm_fritz5490.dtsi"
+
+/ {
+       compatible = "avm,fritz5490-micron", "lantiq,xway", "lantiq,vr9";
+       model = "AVM FRITZ!Box 5490/5491 (Micron NAND)";
+};
+
+&nand1 {
+       nand-ecc-engine = <&nand1>;
+};
diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dts b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dts
new file mode 100644 (file)
index 0000000..631e839
--- /dev/null
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "vr9_avm_fritz5490.dtsi"
+
+/ {
+       compatible = "avm,fritz5490", "lantiq,xway", "lantiq,vr9";
+       model = "AVM FRITZ!Box 5490/5491";
+};
diff --git a/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dtsi b/target/linux/lantiq/files/arch/mips/boot/dts/lantiq/vr9_avm_fritz5490.dtsi
new file mode 100644 (file)
index 0000000..2aadd8e
--- /dev/null
@@ -0,0 +1,69 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "vr9_avm_fritzxx90.dtsi"
+
+/ {
+       compatible = "avm,fritz5490", "lantiq,xway", "lantiq,vr9";
+       model = "AVM FRITZ!Box 5490/5491";
+};
+
+&aliases {
+       led-dsl = &led_info_green;
+       led-internet = &led_internet;
+       led-wifi = &led_wifi;
+};
+
+&leds {
+       led_fiber: fiber {
+               label = "green:fiber";
+               gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
+       };
+
+       led_wifi: wifi {
+               label = "green:wlan";
+               gpios = <&gpio 36 GPIO_ACTIVE_LOW>;
+       };
+
+       led_internet: internet {
+               label = "green:internet";
+               gpios = <&gpio 35 GPIO_ACTIVE_LOW>;
+       };
+};
+
+&gswip_mdio {
+       phy5: ethernet-phy@5 {
+               reg = <0x05>;
+       };
+
+       phy6: ethernet-phy@6 {
+               reg = <0x06>;
+               reset-gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
+       };
+
+       phy9: ethernet-phy@9 {
+               reg = <0x09>;
+       };
+};
+
+&gswip_ports {
+       port@0 {
+               reg = <0>;
+               label = "wan";
+               phy-mode = "rgmii";
+               phy-handle = <&phy6>;
+       };
+
+       port@2 {
+               reg = <2>;
+               label = "lan2";
+               phy-mode = "internal";
+               phy-handle = <&phy5>;
+       };
+
+       port@4 {
+               reg = <4>;
+               label = "lan1";
+               phy-mode = "internal";
+               phy-handle = <&phy9>;
+       };
+};
index 6df679dad953bc0d10f0bcedb30d741877bf9cf7..81aa5d97b143968981cc97eaddc00c57349aa042 100644 (file)
@@ -149,6 +149,42 @@ define Device/avm_fritz3390
 endef
 TARGET_DEVICES += avm_fritz3390
 
+define Device/avm_fritz5490
+  $(Device/dsa-migration)
+  $(Device/AVM)
+  $(Device/NAND)
+  DEVICE_MODEL := FRITZ!Box 5490
+  DEVICE_ALT0_VENDOR := AVM
+  DEVICE_ALT0_MODEL := FRITZ!Box 5491
+  DEVICE_VARIANT := Other NAND
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 49152k
+  DEVICE_PACKAGES := kmod-usb3 fritz-tffs \
+       -ltq-vdsl-vr9-vectoring-fw-installer -kmod-ltq-vdsl-vr9-mei \
+       -kmod-ltq-vdsl-vr9 -kmod-ltq-atm-vr9 -kmod-ltq-ptm-vr9 \
+       -ltq-vdsl-vr9-app -kmod-owl-loader \
+       -dsl-vrx200-firmware-xdsl-a -dsl-vrx200-firmware-xdsl-b-patch
+endef
+TARGET_DEVICES += avm_fritz5490
+
+define Device/avm_fritz5490-micron
+  $(Device/dsa-migration)
+  $(Device/AVM)
+  $(Device/NAND)
+  DEVICE_MODEL := FRITZ!Box 5490
+  DEVICE_ALT0_VENDOR := AVM
+  DEVICE_ALT0_MODEL := FRITZ!Box 5491
+  DEVICE_VARIANT := Micron NAND
+  KERNEL_SIZE := 4096k
+  IMAGE_SIZE := 49152k
+  DEVICE_PACKAGES := kmod-usb3 fritz-tffs \
+       -ltq-vdsl-vr9-vectoring-fw-installer -kmod-ltq-vdsl-vr9-mei \
+       -kmod-ltq-vdsl-vr9 -kmod-ltq-atm-vr9 -kmod-ltq-ptm-vr9 \
+       -ltq-vdsl-vr9-app -kmod-owl-loader \
+       -dsl-vrx200-firmware-xdsl-a -dsl-vrx200-firmware-xdsl-b-patch
+endef
+TARGET_DEVICES += avm_fritz5490-micron
+
 define Device/avm_fritz7360sl
   $(Device/dsa-migration)
   $(Device/AVM)
index d1b50172de3c611fdfdca7d3d19976ad923e435e..f165805f0aad7839d51275354b5e1094bf31a262 100644 (file)
@@ -42,6 +42,8 @@ arcadyan,vgv7519-brn)
 avm,fritz3370-rev2-hynix|\
 avm,fritz3370-rev2-micron|\
 avm,fritz3390|\
+avm,fritz5490|\
+avm,fritz5490-micron|\
 avm,fritz7490|\
 avm,fritz7490-micron)
        ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x17"
index 4b5950c3471b401eed575271de5d3dfb0acdb669..655053ce269dbcbb830e3bfee136353cde83b782 100644 (file)
@@ -18,6 +18,10 @@ lantiq_setup_interfaces()
        arcadyan,arv7519rw22)
                ucidef_set_interface_lan "lan1 lan2 lan3 lan4 lan5"
                ;;
+       avm,fritz5490|\
+       avm,fritz5490-micron)
+               ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+               ;;
        arcadyan,vgv7510kw22-brn|\
        arcadyan,vgv7510kw22-nor|\
        arcadyan,vgv7519-brn|\
@@ -118,6 +122,8 @@ lantiq_setup_macs()
                wan_mac=$(macaddr_add "$(mtd_get_mac_binary urlader 0xa91)" 1)
                ;;
        avm,fritz3390|\
+       avm,fritz5490|\
+       avm,fritz5490-micron|\
        avm,fritz7362sl|\
        avm,fritz7490|\
        avm,fritz7490-micron)
index 0764c0554d299a58096052fa2820405978b91949..6142714acccd9fb8368b1a755abbf125d59d3143 100755 (executable)
@@ -12,6 +12,8 @@ platform_do_upgrade() {
        avm,fritz3370-rev2-hynix|\
        avm,fritz3370-rev2-micron|\
        avm,fritz3390|\
+       avm,fritz5490|\
+       avm,fritz5490-micron|\
        avm,fritz7362sl|\
        avm,fritz7412|\
        avm,fritz7430|\