From 0fda3b14c771c697f98daed39cbba08d69b06b96 Mon Sep 17 00:00:00 2001 From: Linus Walleij Date: Fri, 20 Dec 2024 00:59:50 +0100 Subject: [PATCH] ixp4xx: Add back support for Netgear WG302 v1 The WG302 v1 has 32MB of RAM so it can easily run OpenWrt, however it lacks much flash: only 8 MB. By just using the flash for rootfs and booting a kernel over TFTP it works just fine. Signed-off-by: Linus Walleij --- .../ixp4xx/base-files/etc/board.d/02_network | 3 +- target/linux/ixp4xx/image/Makefile | 15 +++++ ...7-ARM-dts-ixp4xx-Fix-up-PCI-on-WG302.patch | 40 +++++++++++++ ...ts-ixp4xx-Add-Netgear-WG302-v1-GPIOs.patch | 59 +++++++++++++++++++ 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 target/linux/ixp4xx/patches-6.6/0007-ARM-dts-ixp4xx-Fix-up-PCI-on-WG302.patch create mode 100644 target/linux/ixp4xx/patches-6.6/0008-ARM-dts-ixp4xx-Add-Netgear-WG302-v1-GPIOs.patch diff --git a/target/linux/ixp4xx/base-files/etc/board.d/02_network b/target/linux/ixp4xx/base-files/etc/board.d/02_network index 6a361d4f53..c321e3fb27 100644 --- a/target/linux/ixp4xx/base-files/etc/board.d/02_network +++ b/target/linux/ixp4xx/base-files/etc/board.d/02_network @@ -11,7 +11,8 @@ gateworks,gw2358) ;; dlink,dsm-g600-a|\ iom,nas-100d|\ -linksys,nslu2) +linksys,nslu2|\ +netgear,wg302v1) ucidef_set_interface_lan "eth0" "dhcp" ;; usr,usr8200) diff --git a/target/linux/ixp4xx/image/Makefile b/target/linux/ixp4xx/image/Makefile index ace533e50f..f1172ee123 100644 --- a/target/linux/ixp4xx/image/Makefile +++ b/target/linux/ixp4xx/image/Makefile @@ -124,6 +124,21 @@ define Device/linksys_nslu2 endef TARGET_DEVICES += linksys_nslu2 +define Device/netgear_wg302v1 + DEVICE_VENDOR := Netgear + DEVICE_MODEL := WG302 v1 + DEVICE_PACKAGES := ixp4xx-microcode-ethernet kmod-phy-amd kmod-ath5k \ + wpad-basic-mbedtls kmod-input-gpio-keys-polled + # Only 32 MB of RAM and small flash so not building by default + DEFAULT := n + DEVICE_DTS := intel-ixp42x-netgear-wg302v1 + KERNEL := kernel-bin | append-dtb + IMAGES := kernel.bin rootfs.bin + IMAGE/kernel.bin := append-kernel + IMAGE/rootfs.bin := append-rootfs | pad-rootfs | pad-to 128k +endef +TARGET_DEVICES += netgear_wg302v1 + define Device/usrobotics_usr8200 DEVICE_VENDOR := USRobotics DEVICE_MODEL := USR8200 diff --git a/target/linux/ixp4xx/patches-6.6/0007-ARM-dts-ixp4xx-Fix-up-PCI-on-WG302.patch b/target/linux/ixp4xx/patches-6.6/0007-ARM-dts-ixp4xx-Fix-up-PCI-on-WG302.patch new file mode 100644 index 0000000000..ca0df18071 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.6/0007-ARM-dts-ixp4xx-Fix-up-PCI-on-WG302.patch @@ -0,0 +1,40 @@ +From ed23e07bf7a1896b6eaa85b773bb43b1fad66d4b Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Sat, 21 Dec 2024 00:07:11 +0100 +Subject: [PATCH] ARM: dts: ixp4xx: Fix up PCI on WG302 + +Looking at the board file for WG302 v2 was not a good idea +because the GPIO IRQ for slot 2 differs, and v1 uses GPIO +10 instead of GPIO 9. Fix it up. + +Signed-off-by: Linus Walleij +--- + .../dts/intel/ixp/intel-ixp42x-netgear-wg302v1.dts | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-netgear-wg302v1.dts ++++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-netgear-wg302v1.dts +@@ -57,7 +57,7 @@ + status = "okay"; + + /* +- * Taken from WG302 v2 PCI boardfile (wg302v2-pci.c) ++ * Taken from WG302 v1 PCI boardfile (wg302v1-pci.c) + * We have slots (IDSEL) 1 and 2 with one assigned IRQ + * each handling all IRQs. + */ +@@ -70,10 +70,10 @@ + <0x0800 0 0 3 &gpio0 8 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 1 is irq 8 */ + <0x0800 0 0 4 &gpio0 8 IRQ_TYPE_LEVEL_LOW>, /* INT D on slot 1 is irq 8 */ + /* IDSEL 2 */ +- <0x1000 0 0 1 &gpio0 9 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 2 is irq 9 */ +- <0x1000 0 0 2 &gpio0 9 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 2 is irq 9 */ +- <0x1000 0 0 3 &gpio0 9 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 2 is irq 9 */ +- <0x1000 0 0 4 &gpio0 9 IRQ_TYPE_LEVEL_LOW>; /* INT D on slot 2 is irq 9 */ ++ <0x1000 0 0 1 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT A on slot 2 is irq 10 */ ++ <0x1000 0 0 2 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT B on slot 2 is irq 10 */ ++ <0x1000 0 0 3 &gpio0 10 IRQ_TYPE_LEVEL_LOW>, /* INT C on slot 2 is irq 10 */ ++ <0x1000 0 0 4 &gpio0 10 IRQ_TYPE_LEVEL_LOW>; /* INT D on slot 2 is irq 10 */ + }; + + ethernet@c8009000 { diff --git a/target/linux/ixp4xx/patches-6.6/0008-ARM-dts-ixp4xx-Add-Netgear-WG302-v1-GPIOs.patch b/target/linux/ixp4xx/patches-6.6/0008-ARM-dts-ixp4xx-Add-Netgear-WG302-v1-GPIOs.patch new file mode 100644 index 0000000000..ef4f21fa03 --- /dev/null +++ b/target/linux/ixp4xx/patches-6.6/0008-ARM-dts-ixp4xx-Add-Netgear-WG302-v1-GPIOs.patch @@ -0,0 +1,59 @@ +From 1d22f422fca8875f6d2cb297f735d41fd5830000 Mon Sep 17 00:00:00 2001 +From: Linus Walleij +Date: Mon, 23 Dec 2024 17:50:52 +0100 +Subject: [PATCH] ARM: dts: ixp4xx: Add Netgear WG302 v1 GPIOs + +This adds GPIO LED indicators, the reset GPIO RESET +button on the Netgear WG302 v1 to the device tree. + +Signed-off-by: Linus Walleij +--- + .../ixp/intel-ixp42x-netgear-wg302v1.dts | 30 +++++++++++++++++++ + 1 file changed, 30 insertions(+) + +--- a/arch/arm/boot/dts/intel/ixp/intel-ixp42x-netgear-wg302v1.dts ++++ b/arch/arm/boot/dts/intel/ixp/intel-ixp42x-netgear-wg302v1.dts +@@ -8,6 +8,7 @@ + + #include "intel-ixp42x.dtsi" + #include ++#include + + / { + model = "Netgear WG302 v1"; +@@ -32,6 +33,35 @@ + serial0 = &uart1; + }; + ++ leds { ++ compatible = "gpio-leds"; ++ test_led: led-test { ++ color = ; ++ function = "test"; ++ gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ }; ++ wlan_led: led-wlan { ++ color = ; ++ function = LED_FUNCTION_WLAN; ++ gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; ++ default-state = "off"; ++ linux,default-trigger = "phy0tx"; ++ }; ++ }; ++ ++ gpio_keys { ++ /* RESET is on GPIO13 which can't fire interrupts */ ++ compatible = "gpio-keys-polled"; ++ poll-interval = <100>; ++ ++ button-reset { ++ linux,code = ; ++ label = "reset"; ++ gpios = <&gpio0 13 GPIO_ACTIVE_LOW>; ++ }; ++ }; ++ + soc { + bus@c4000000 { + flash@0,0 { -- 2.30.2