diff options
Diffstat (limited to 'target/linux')
5 files changed, 196 insertions, 5 deletions
diff --git a/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts b/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts new file mode 100644 index 0000000000..90aac30d7f --- /dev/null +++ b/target/linux/ath79/dts/qca9561_nec_wf1200cr.dts @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "qca956x.dtsi" + +#include <dt-bindings/gpio/gpio.h> +#include <dt-bindings/input/input.h> + +/ { + model = "NEC Aterm WF1200CR"; + compatible = "nec,wf1200cr", "qca,qca9561"; + + aliases { + led-boot = &led_power_green; + led-failsafe = &led_power_red; + led-running = &led_power_green; + led-upgrade = &led_power_green; + }; + + leds { + compatible = "gpio-leds"; + /* other LEDs are connected to ath10k (QCA9888) gpiochip */ + + led_power_green: power_green { + label = "green:power"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + }; + + led_power_red: power_red { + label = "red:power"; + gpios = <&gpio 21 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&gpio 1 GPIO_ACTIVE_LOW>; + linux,code = <KEY_RESTART>; + debounce-interval = <60>; + }; + + router { + label = "rt"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + linux,code = <BTN_0>; + linux,input-type = <EV_SW>; + debounce-interval = <60>; + }; + + wps { + label = "wps"; + gpios = <&gpio 22 GPIO_ACTIVE_LOW>; + linux,code = <KEY_WPS_BUTTON>; + debounce-interval = <60>; + }; + }; +}; + +&spi { + status = "okay"; + + 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 = "u-boot"; + reg = <0x000000 0x040000>; + read-only; + }; + + partition@40000 { + label = "devdata"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + label = "devconf"; + reg = <0x050000 0x010000>; + read-only; + }; + + partition@60000 { + label = "misc"; + reg = <0x060000 0x010000>; + read-only; + }; + + partition@70000 { + compatible = "seama"; + label = "firmware"; + reg = <0x070000 0x780000>; + }; + + partition@7f0000 { + label = "art"; + reg = <0x7f0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + pll-data = <0x03000101 0x00000101 0x00001919>; + + phy-handle = <&swphy0>; + + gmac-config { + device = <&gmac>; + + switch-phy-swap = <1>; + switch-phy-addr-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&pinmux_swled_enable_pins>; +}; + +&gpio { + switch_leds { + gpio-hog; + gpios = <14 GPIO_ACTIVE_HIGH>, /* WAN */ + <19 GPIO_ACTIVE_HIGH>; /* LAN */ + output-high; + line-name = "led:wan-lan"; + }; +}; + +&pinmux { + pinmux_swled_enable_pins: swled_enable_pins { + pinctrl-single,bits = + <0xc 0x240000 0xff0000>, /* WAN */ + <0x10 0x10000000 0xff000000>; /* LAN */ + }; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + }; +}; + +&wmac { + status = "okay"; + + qca,no-eeprom; +}; 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 ffafe7db20..f07c086977 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 @@ -300,6 +300,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "5:lan:4" "1:wan" ;; + nec,wf1200cr) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" + ;; nec,wg1200cr|\ qxwlan,e1700ac-v2-8m|\ qxwlan,e1700ac-v2-16m|\ @@ -599,6 +604,7 @@ ath79_setup_macs() base_mac=$(mtd_get_mac_binary u-boot 0x1fc00) wan_mac=$(macaddr_add "$base_mac" 1) ;; + nec,wf1200cr|\ nec,wg1200cr) lan_mac=$(mtd_get_mac_ascii devdata "lanmac") wan_mac=$(mtd_get_mac_ascii devdata "wanmac") diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 62f2f1e8b4..388f477856 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -32,6 +32,7 @@ case "$FIRMWARE" in dlink,dir-842-c2|\ dlink,dir-842-c3|\ dlink,dir-859-a1|\ + nec,wf1200cr|\ nec,wg1200cr|\ wd,mynet-n750) caldata_extract "art" 0x1000 0x440 diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata index b2392c2c64..feb9a5186e 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/11-ath10k-caldata @@ -201,6 +201,7 @@ case "$FIRMWARE" in ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \ /lib/firmware/ath10k/QCA9888/hw2.0/board.bin ;; + nec,wf1200cr|\ nec,wg1200cr) caldata_extract "art" 0x5000 0x2f20 ath10k_patch_mac $(mtd_get_mac_ascii devdata wlan5mac) diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index b459136ef5..9d0be2b86b 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1417,20 +1417,37 @@ define Device/mercury_mw4530r-v1 endef TARGET_DEVICES += mercury_mw4530r-v1 +define Device/nec_wx1200cr + DEVICE_VENDOR := NEC + IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs + IMAGE/sysupgrade.bin := $$(IMAGE/default) | seama | pad-rootfs | \ + append-metadata | check-size + DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct +endef + +define Device/nec_wf1200cr + $(Device/nec_wx1200cr) + SOC := qca9561 + DEVICE_MODEL := Aterm WF1200CR + IMAGE_SIZE := 7680k + SEAMA_MTDBLOCK := 5 + SEAMA_SIGNATURE := wrgac62_necpf.2016gui_wf1200cr + IMAGES += factory.bin + IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \ + seama-seal | nec-enc ryztfyutcrqqo69d | check-size +endef +TARGET_DEVICES += nec_wf1200cr + define Device/nec_wg1200cr + $(Device/nec_wx1200cr) SOC := qca9563 - DEVICE_VENDOR := NEC DEVICE_MODEL := Aterm WG1200CR IMAGE_SIZE := 7616k SEAMA_MTDBLOCK := 6 SEAMA_SIGNATURE := wrgac72_necpf.2016gui_wg1200cr IMAGES += factory.bin - IMAGE/default := append-kernel | pad-offset $$$$(BLOCKSIZE) 64 | append-rootfs - IMAGE/sysupgrade.bin := $$(IMAGE/default) | seama | pad-rootfs | \ - append-metadata | check-size IMAGE/factory.bin := $$(IMAGE/default) | pad-rootfs -x 64 | seama | \ seama-seal | nec-enc 9gsiy9nzep452pad | check-size - DEVICE_PACKAGES := kmod-ath10k-ct ath10k-firmware-qca9888-ct endef TARGET_DEVICES += nec_wg1200cr |