diff options
6 files changed, 335 insertions, 5 deletions
diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh-rb.dts b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh-rb.dts new file mode 100644 index 0000000000..52b0c86d65 --- /dev/null +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh-rb.dts @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9132_buffalo_wzr-hp-g300nh.dtsi" + +/ { + compatible = "buffalo,wzr-hp-g300nh-rb", "qca,ar9132"; + model = "Buffalo WZR-HP-G300NH (rtl8366rb)"; +}; + +&switch { + status = "okay"; + + compatible = "realtek,rtl8366rb"; +}; + +ð0 { + status = "okay"; + + pll-data = <0x1f000000 0x13000a44 0x00441099>; +}; + +ð1 { + status = "okay"; + + pll-data = <0x100 0x13000a44 0x00441099>; +}; diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh-s.dts b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh-s.dts new file mode 100644 index 0000000000..1c4da1ed67 --- /dev/null +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh-s.dts @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9132_buffalo_wzr-hp-g300nh.dtsi" + +/ { + compatible = "buffalo,wzr-hp-g300nh-s", "qca,ar9132"; + model = "Buffalo WZR-HP-G300NH (rtl8366s)"; +}; + +&switch { + status = "okay"; + + compatible = "realtek,rtl8366s"; +}; + +ð0 { + status = "okay"; + + pll-data = <0x1e000100 0x13000a44 0x00441099>; +}; + +ð1 { + status = "okay"; + + pll-data = <0x1e000100 0x13000a44 0x00441099>; +}; diff --git a/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi new file mode 100644 index 0000000000..9bd4656d85 --- /dev/null +++ b/target/linux/ath79/dts/ar9132_buffalo_wzr-hp-g300nh.dtsi @@ -0,0 +1,249 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9132.dtsi" +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +/ { + aliases { + led-boot = &led_diag; + led-failsafe = &led_security; + led-upgrade = &led_diag; + }; + + clock40mhz: ref { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <40000000>; + }; + + gpio2: gpio-extender { + compatible = "nxp,74hc153-gpio"; + gpio-controller; + #gpio-cells = <2>; + + // GPIOs used by this node + gpio-s0 = <&gpio 9 GPIO_ACTIVE_HIGH>; + gpio-s1 = <&gpio 11 GPIO_ACTIVE_HIGH>; + gpio-1y = <&gpio 12 GPIO_ACTIVE_HIGH>; + gpio-2y = <&gpio 14 GPIO_ACTIVE_HIGH>; + }; + + keys { + compatible = "gpio-keys-polled"; + poll-interval = <20>; + + aoss { + label = "aoss"; + linux,code = <KEY_WPS_BUTTON>; + gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + reset { + label = "reset"; + linux,code = <KEY_RESTART>; + gpios = <&gpio2 1 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + router_on { + label = "router_on"; + linux,code = <BTN_5>; + gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + movie_off { + label = "movie_off"; + linux,code = <BTN_3>; + gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + usb { + label = "usb"; + linux,code = <BTN_2>; + gpios = <&gpio2 5 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + + router_auto { + label = "router_auto"; + linux,code = <BTN_6>; + gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + + movie_on { + label = "movie_on"; + linux,code = <BTN_4>; + gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>; + debounce-interval = <60>; + }; + }; + + flash@1e000000 { + compatible = "cfi-flash"; + reg = <0x1e000000 0x2000000>; + bank-width = <2>; + device-width = <2>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "u-boot"; + reg = <0x0000000 0x0040000>; + read-only; + }; + + partition@40000 { + label = "u-boot-env"; + reg = <0x0040000 0x0020000>; + read-only; + }; + + partition@60000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x0060000 0x1f60000>; + }; + + partition@1fc0000 { + label = "user_property"; + reg = <0x1fc0000 0x0020000>; + read-only; + }; + + art: partition@1fe0000 { + label = "art"; + reg = <0x1fe0000 0x020000>; + read-only; + }; + }; + }; + + leds { + compatible = "gpio-leds"; + + usb { + label = "blue:usb"; + gpios = <&gpio 0 GPIO_ACTIVE_LOW>; + trigger-sources = <&hub_port>; + linux,default-trigger = "usbport"; + }; + + led_diag: diag { + label = "red:diag"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + }; + + wireless { + label = "green:wireless"; + gpios = <&gpio 6 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_security: security { + label = "amber:security"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + router { + label = "green:router"; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + }; + + switch: switch { + status = "disabled"; + + gpio-sda = <&gpio 19 GPIO_ACTIVE_HIGH>; + gpio-sck = <&gpio 20 GPIO_ACTIVE_HIGH>; + mii-bus = <&mdio0>; + + mdio-bus { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + phy-mask = <0x10>; + + phy4: ethernet-phy@4 { + reg = <4>; + phy-mode = "rgmii"; + }; + }; + }; +}; + +&mdio0 { + status = "okay"; +}; + +ð0 { + status = "disabled"; + + phy-mode = "rgmii"; + mtd-mac-address = <&art 0x1120c>; + + fixed-link { + speed = <1000>; + full-duplex; + }; +}; + +&mdio1 { + status = "okay"; +}; + +ð1 { + status = "disabled"; + + compatible = "qca,ar9130-eth", "syscon"; + reg = <0x1a000000 0x200 + 0x18070004 0x4>; + + pll-reg = <0x4 0x18 22>; + pll-handle = <&pll>; + + phy-mode = "rgmii"; + phy-handle = <&phy4>; + resets = <&rst 13>; + reset-names = "mac"; + qca,mac-idx = <1>; + mtd-mac-address = <&art 0x1120c>; +}; + +&wmac { + status = "okay"; + + mtd-cal-data = <&art 0x11000>; +}; + +&uart { + status = "okay"; +}; + +&pll { + clocks = <&clock40mhz>; +}; + +&usb { + status = "okay"; + + #address-cells = <1>; + #size-cells = <0>; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +&usb_phy { + status = "okay"; +}; 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 31bc8f70df..783b55ec32 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/generic/base-files/etc/board.d/01_leds @@ -83,6 +83,10 @@ avm,fritzdvbc) ucidef_set_led_rssi "rssimediumhigh" "RSSIMEDIUMHIGH" "green:rssimediumhigh" "wlan1" "60" "100" ucidef_set_led_rssi "rssihigh" "RSSIHIGH" "green:rssihigh" "wlan1" "80" "100" ;; +buffalo,wzr-hp-g300nh-rb|\ +buffalo,wzr-hp-g300nh-s) + ucidef_set_led_netdev "router" "Router" "green:router" "eth1" + ;; comfast,cf-e110n-v2) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth1" ucidef_set_led_switch "wan" "WAN" "green:wan" "switch0" "0x02" 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 aa5a336c57..e0c4f31e9d 100644 --- a/target/linux/ath79/generic/base-files/etc/board.d/02_network +++ b/target/linux/ath79/generic/base-files/etc/board.d/02_network @@ -155,6 +155,13 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1" ;; + buffalo,wzr-hp-g300nh-rb|\ + buffalo,wzr-hp-g300nh-s|\ + dlink,dir-825-b1) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0" + ;; buffalo,wzr-hp-g302h-a1a0) ucidef_add_switch "switch0" \ "0@eth0" "1:lan:1" "3:lan:4" "4:lan:3" "5:lan:2" "2:wan" @@ -211,11 +218,6 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:2" "2:lan:1" ;; - dlink,dir-825-b1) - ucidef_set_interface_wan "eth1" - ucidef_add_switch "switch0" \ - "0:lan" "1:lan" "2:lan" "3:lan" "5@eth0" - ;; dlink,dir-825-c1|\ dlink,dir-835-a1|\ dlink,dir-842-c1|\ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index a746bcfb8e..f358d44064 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -453,6 +453,29 @@ define Device/buffalo_wzr-hp-ag300h endef TARGET_DEVICES += buffalo_wzr-hp-ag300h +define Device/buffalo_wzr-hp-g300nh + $(Device/buffalo_common) + SOC := ar9132 + BUFFALO_PRODUCT := WZR-HP-G300NH + BUFFALO_HWVER := 1 + DEVICE_PACKAGES := kmod-usb2 kmod-usb-ledtrig-usbport kmod-gpio-nxp-74hc153 + BLOCKSIZE := 128k + IMAGE_SIZE := 32128k + SUPPORTED_DEVICES += wzr-hp-g300nh +endef + +define Device/buffalo_wzr-hp-g300nh-rb + $(Device/buffalo_wzr-hp-g300nh) + DEVICE_MODEL := WZR-HP-G300NH (RTL8366RB switch) +endef +TARGET_DEVICES += buffalo_wzr-hp-g300nh-rb + +define Device/buffalo_wzr-hp-g300nh-s + $(Device/buffalo_wzr-hp-g300nh) + DEVICE_MODEL := WZR-HP-G300NH (RTL8366S switch) +endef +TARGET_DEVICES += buffalo_wzr-hp-g300nh-s + define Device/buffalo_wzr-hp-g302h-a1a0 $(Device/buffalo_common) SOC := ar7242 |