diff options
-rw-r--r-- | target/linux/ath79/dts/qca9531_alfa-network_n2q.dts | 120 | ||||
-rw-r--r-- | target/linux/ath79/dts/qca9531_alfa-network_r36a.dts | 135 | ||||
-rw-r--r-- | target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi | 126 | ||||
-rwxr-xr-x | target/linux/ath79/generic/base-files/etc/board.d/01_leds | 8 | ||||
-rwxr-xr-x | target/linux/ath79/generic/base-files/etc/board.d/02_network | 12 | ||||
-rw-r--r-- | target/linux/ath79/image/generic.mk | 10 |
6 files changed, 283 insertions, 128 deletions
diff --git a/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts new file mode 100644 index 0000000000..8dd91ab38b --- /dev/null +++ b/target/linux/ath79/dts/qca9531_alfa-network_n2q.dts @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca9531_alfa-network_r36a.dtsi" + +/ { + model = "ALFA Network N2Q"; + compatible = "alfa-network,n2q", "qca,qca9531"; + + aliases { + led-boot = &led_usb; + led-failsafe = &led_usb; + led-upgrade = &led_usb; + }; + + gpio-export-pcf8574 { + compatible = "gpio-export"; + #size-cells = <0>; + + poe-passthrough { + gpio-export,name = "poe-passthrough"; + gpio-export,output = <1>; + gpios = <&pcf8574 0 GPIO_ACTIVE_LOW>; + }; + + usb-power { + gpio-export,name = "usb-power"; + gpio-export,output = <0>; + gpios = <&pcf8574 2 GPIO_ACTIVE_LOW>; + }; + }; + + i2c { + compatible = "i2c-gpio"; + #address-cells = <1>; + #size-cells = <0>; + + sda-gpios = <&gpio 11 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + scl-gpios = <&gpio 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; + + pcf8574: pcf8574@20 { + compatible = "nxp,pcf8574"; + reg = <0x20>; + gpio-controller; + #gpio-cells = <2>; + }; + }; + + leds { + compatible = "gpio-leds"; + + pinctrl-names = "default"; + pinctrl-0 = <&enable_gpio4 &enable_gpio16>; + + lan1 { + label = "n2q:orange:lan1"; + gpios = <&gpio 16 GPIO_ACTIVE_LOW>; + }; + + lan2 { + label = "n2q:orange:lan2"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + }; + + led_usb: usb { + label = "n2q:green:usb"; + gpios = <&gpio 14 GPIO_ACTIVE_LOW>; + linux,default-trigger = "usbport"; + trigger-sources = <&hub_port0>; + }; + + minipcie { + label = "n2q:green:minipcie"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "n2q:green:wlan"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + }; + + leds-pcf8574 { + compatible = "gpio-leds"; + + poe-passthrough { + label = "n2q:green:poe-passthrough"; + gpios = <&pcf8574 1 GPIO_ACTIVE_LOW>; + }; + + signal1 { + label = "n2q:red:signal1"; + gpios = <&pcf8574 3 GPIO_ACTIVE_LOW>; + }; + + signal2 { + label = "n2q:orange:signal2"; + gpios = <&pcf8574 4 GPIO_ACTIVE_LOW>; + }; + + signal3 { + label = "n2q:green:signal3"; + gpios = <&pcf8574 5 GPIO_ACTIVE_LOW>; + }; + }; +}; + +ð0 { + mtd-mac-address = <&art 0x1002>; + mtd-mac-address-increment = <(-2)>; +}; + +ð1 { + mtd-mac-address = <&art 0x1002>; + mtd-mac-address-increment = <(-1)>; +}; + +&pcie0 { + status = "okay"; +}; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts index 18aaa85f5c..0405e40839 100644 --- a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dts @@ -1,57 +1,18 @@ // SPDX-License-Identifier: GPL-2.0-or-later OR MIT -#include "qca953x.dtsi" - -#include <dt-bindings/gpio/gpio.h> -#include <dt-bindings/input/input.h> +#include "qca9531_alfa-network_r36a.dtsi" / { model = "ALFA Network R36A"; compatible = "alfa-network,r36a", "qca,qca9531"; aliases { - label-mac-device = &wmac; led-boot = &led_status; led-failsafe = &led_status; led-running = &led_status; led-upgrade = &led_status; }; - gpio-export { - compatible = "gpio-export"; - #size-cells = <0>; - - usb-power { - gpio-export,name = "usb-power"; - gpio-export,output = <1>; - gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; - }; - - watchdog-enable { - gpio-export,name = "watchdog-enable"; - gpio-export,output = <1>; - gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; - }; - }; - - keys { - compatible = "gpio-keys"; - - reset { - label = "reset"; - linux,code = <KEY_RESTART>; - gpios = <&gpio 2 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - - rfkill { - label = "rfkill"; - linux,code = <KEY_RFKILL>; - gpios = <&gpio 17 GPIO_ACTIVE_LOW>; - debounce-interval = <60>; - }; - }; - leds { compatible = "gpio-leds"; @@ -86,20 +47,9 @@ linux,default-trigger = "phy0tpt"; }; }; - - watchdog { - compatible = "linux,wdt-gpio"; - gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; - hw_algo = "toggle"; - hw_margin_ms = <25000>; - always-running; - }; }; ð0 { - status = "okay"; - - phy-handle = <&swphy4>; mtd-mac-address = <&art 0x0>; }; @@ -111,80 +61,19 @@ mtd-mac-address = <&art 0x6>; }; -&pinmux { - enable_gpio4: pinmux_enable_gpio4 { - pinctrl-single,bits = <0x04 0x0 0xff>; - }; - - enable_gpio16: pinmux_enable_gpio16 { - pinctrl-single,bits = <0x10 0x0 0xff>; - }; -}; - -&spi { - status = "okay"; - - num-cs = <1>; - - flash@0 { - compatible = "jedec,spi-nor"; - reg = <0>; - spi-max-frequency = <50000000>; - m25p,fast-read; - - partitions { - compatible = "fixed-partitions"; - #address-cells = <1>; - #size-cells = <1>; - - partition@0 { - label = "u-boot"; - reg = <0x000000 0x060000>; - read-only; - }; - - partition@60000 { - label = "u-boot-env"; - reg = <0x060000 0x010000>; - }; - - art: partition@70000 { - label = "art"; - reg = <0x070000 0x010000>; - read-only; - }; - - partition@80000 { - compatible = "denx,uimage"; - label = "firmware"; - reg = <0x080000 0xf80000>; - }; - }; +&gpio_export { + usb-power { + gpio-export,name = "usb-power"; + gpio-export,output = <1>; + gpios = <&gpio 3 GPIO_ACTIVE_HIGH>; }; }; -&uart { - status = "okay"; -}; - -&usb0 { - status = "okay"; - - #address-cells = <1>; - #size-cells = <0>; - - hub_port0: port@1 { - reg = <1>; - #trigger-source-cells = <0>; +&keys { + rfkill { + label = "rfkill"; + linux,code = <KEY_RFKILL>; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; }; }; - -&usb_phy { - status = "okay"; -}; - -&wmac { - status = "okay"; - - mtd-cal-data = <&art 0x1000>; -}; diff --git a/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi new file mode 100644 index 0000000000..697b20e999 --- /dev/null +++ b/target/linux/ath79/dts/qca9531_alfa-network_r36a.dtsi @@ -0,0 +1,126 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca953x.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +/ { + aliases { + label-mac-device = &wmac; + }; + + gpio_export: gpio-export { + compatible = "gpio-export"; + #size-cells = <0>; + + watchdog-enable { + gpio-export,name = "watchdog-enable"; + gpio-export,output = <1>; + gpios = <&gpio 1 GPIO_ACTIVE_HIGH>; + }; + }; + + keys: keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = <KEY_RESTART>; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; + + watchdog { + compatible = "linux,wdt-gpio"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + hw_algo = "toggle"; + hw_margin_ms = <25000>; + always-running; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; +}; + +&pinmux { + enable_gpio4: pinmux_enable_gpio4 { + pinctrl-single,bits = <0x04 0x0 0xff>; + }; + + enable_gpio16: pinmux_enable_gpio16 { + pinctrl-single,bits = <0x10 0x0 0xff>; + }; +}; + +&spi { + status = "okay"; + + num-cs = <1>; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <50000000>; + m25p,fast-read; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x000000 0x060000>; + read-only; + }; + + partition@60000 { + label = "u-boot-env"; + reg = <0x060000 0x010000>; + }; + + art: partition@70000 { + label = "art"; + reg = <0x070000 0x010000>; + read-only; + }; + + partition@80000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x080000 0xf80000>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb0 { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + hub_port0: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/generic/base-files/etc/board.d/01_leds b/target/linux/ath79/generic/base-files/etc/board.d/01_leds index 6e488949e4..0b522910ee 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -17,6 +17,14 @@ alfa-network,ap121fe|\ avm,fritz450e) ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" ;; +alfa-network,n2q) + ucidef_set_led_netdev "lan2" "LAN2" "$boardname:orange:lan2" "eth1" + ucidef_set_led_switch "lan1" "LAN1" "$boardname:orange:lan1" "switch0" "0x10" + ucidef_set_rssimon "wlan0" "200000" "1" + ucidef_set_led_rssi "signal1" "SIGNAL1" "$boardname:red:signal1" "wlan0" "1" "100" + ucidef_set_led_rssi "signal2" "SIGNAL2" "$boardname:orange:signal2" "wlan0" "33" "100" + ucidef_set_led_rssi "signal3" "SIGNAL3" "$boardname:green:signal3" "wlan0" "66" "100" + ;; alfa-network,r36a) ucidef_set_led_netdev "lan" "LAN" "$boardname:blue:lan" "eth0" ucidef_set_led_switch "wan" "WAN" "$boardname:blue:wan" "switch0" "0x10" diff --git a/target/linux/ath79/generic/base-files/etc/board.d/02_network b/target/linux/ath79/generic/base-files/etc/board.d/02_network index d13d714f88..160eea523c 100755 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -78,6 +78,12 @@ ath79_setup_interfaces() alfa-network,ap121fe) ucidef_set_interface_lan "eth0 usb0" ;; + alfa-network,n2q|\ + devolo,dvl1200e|\ + devolo,dvl1750e|\ + ocedo,ursus) + ucidef_set_interface_lan "eth0 eth1" + ;; avm,fritz4020|\ pcs,cr3000|\ tplink,archer-c58-v1|\ @@ -147,11 +153,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "3:lan" "2:wan" ;; - devolo,dvl1200e|\ - devolo,dvl1750e|\ - ocedo,ursus) - ucidef_set_interface_lan "eth0 eth1" - ;; devolo,magic-2-wifi) ucidef_add_switch "switch0" \ "0@eth0" "2:wan" "3:lan" "4:lan" @@ -402,6 +403,7 @@ ath79_setup_macs() ;; alfa-network,ap121f|\ alfa-network,ap121fe|\ + alfa-network,n2q|\ alfa-network,r36a|\ engenius,ens202ext-v1) label_mac=$(mtd_get_mac_binary art 0x1002) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 605f66f77f..920e2e5cee 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -237,6 +237,16 @@ define Device/alfa-network_ap121fe endef TARGET_DEVICES += alfa-network_ap121fe +define Device/alfa-network_n2q + SOC := qca9531 + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := N2Q + DEVICE_PACKAGES := kmod-i2c-gpio kmod-gpio-pcf857x kmod-usb2 \ + kmod-usb-ledtrig-usbport rssileds + IMAGE_SIZE := 15872k +endef +TARGET_DEVICES += alfa-network_n2q + define Device/alfa-network_r36a SOC := qca9531 DEVICE_VENDOR := ALFA Network |