diff --git a/target/linux/ath79/dts/ar9344_nec_wf1200.dtsi b/target/linux/ath79/dts/ar9344_nec_wf1200.dtsi new file mode 100644 index 0000000000..576e5aba4b --- /dev/null +++ b/target/linux/ath79/dts/ar9344_nec_wf1200.dtsi @@ -0,0 +1,177 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include +#include +#include + +#include "ar9344.dtsi" + +/ { + aliases { + label-mac-device = ð0; + }; + + chosen { + /* + * don't specify bootargs property in DeviceTree to + * enable a console with a default baudrate (9600) + * or passed console= parameter from the bootloader + */ + /delete-property/ bootargs; + stdout-path = &uart; + }; + + keys { + compatible = "gpio-keys"; + + button-wps { + label = "wps"; + gpios = <&gpio 4 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + switch-bridge { + label = "br"; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + switch-coverter { + label = "cnv"; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + + button-reset { + label = "reset"; + gpios = <&gpio 15 GPIO_ACTIVE_LOW>; + linux,code = ; + debounce-interval = <60>; + }; + }; + + /* all LEDs are connected to ath10k chip (QCA9882) */ +}; + +&ref { + clock-frequency = <40000000>; +}; + +&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>; + + /* + * since the OEM bootloader requires unknown + * filesystem on firmware area, needs to be + * replaced to u-boot before OpenWrt installation + */ + partition@0 { + label = "bootloader"; + reg = <0x000000 0x020000>; + }; + + /* not compatible with u-boot */ + partition@20000 { + label = "config"; + reg = <0x020000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_config_0: mac-address@0 { + reg = <0x0 0x6>; + }; + + macaddr_config_6: mac-address@6 { + reg = <0x6 0x6>; + }; + + macaddr_config_c: mac-address@c { + reg = <0xc 0x6>; + }; + + macaddr_config_12: mac-address@12 { + reg = <0x12 0x6>; + }; + }; + }; + + partition@30000 { + label = "art"; + reg = <0x030000 0x010000>; + read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + cal_art_5000: calibration@5000 { + reg = <0x5000 0x844>; + }; + }; + }; + + partition@40000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x040000 0x7c0000>; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + nvmem-cells = <&macaddr_config_c>; + nvmem-cell-names = "mac-address"; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_config_6>; + nvmem-cell-names = "mac-address"; +}; + +&pcie { + status = "okay"; + + wifi@0,0 { + compatible = "qcom,ath10k"; + reg = <0x0000 0 0 0 0>; + + nvmem-cells = <&cal_art_5000>, <&macaddr_config_12>; + nvmem-cell-names = "calibration", "mac-address"; + }; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&cal_art_1000>, <&macaddr_config_0>; + nvmem-cell-names = "calibration", "mac-address"; +}; diff --git a/target/linux/ath79/dts/ar9344_nec_wf1200hp.dts b/target/linux/ath79/dts/ar9344_nec_wf1200hp.dts new file mode 100644 index 0000000000..2cf739f98c --- /dev/null +++ b/target/linux/ath79/dts/ar9344_nec_wf1200hp.dts @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344_nec_wf1200.dtsi" + +/ { + compatible = "nec,wf1200hp", "qca,ar9344"; + model = "NEC Aterm WF1200HP"; +}; diff --git a/target/linux/ath79/image/lzma-loader/src/board.c b/target/linux/ath79/image/lzma-loader/src/board.c index 7ed414aa90..5fbb4bb821 100644 --- a/target/linux/ath79/image/lzma-loader/src/board.c +++ b/target/linux/ath79/image/lzma-loader/src/board.c @@ -219,7 +219,8 @@ static inline void huawei_ap_init(void) static inline void huawei_ap_init(void) {} #endif -#if defined(CONFIG_BOARD_NEC_WG1400HP) || \ +#if defined(CONFIG_BOARD_NEC_WF1200HP) || \ + defined(CONFIG_BOARD_NEC_WG1400HP) || \ defined(CONFIG_BOARD_NEC_WG1800HP) || \ defined(CONFIG_BOARD_NEC_WG1800HP2) || \ defined(CONFIG_BOARD_NEC_WG2200HP) || \ @@ -262,7 +263,8 @@ static inline void nec_aterm_reset_common(void) } #endif -#if defined(CONFIG_BOARD_NEC_WG600HP) || \ +#if defined(CONFIG_BOARD_NEC_WF1200HP) || \ + defined(CONFIG_BOARD_NEC_WG600HP) || \ defined(CONFIG_BOARD_NEC_WR8750N) || \ defined(CONFIG_BOARD_NEC_WR9500N) diff --git a/target/linux/ath79/image/tiny.mk b/target/linux/ath79/image/tiny.mk index 53111119d8..d8e127d20b 100644 --- a/target/linux/ath79/image/tiny.mk +++ b/target/linux/ath79/image/tiny.mk @@ -121,6 +121,19 @@ define Device/engenius_enh202-v1 endef TARGET_DEVICES += engenius_enh202-v1 +define Device/nec_wf1200hp + DEVICE_MODEL := Aterm WF1200HP + SOC := ar9344 + BLOCKSIZE := 4k + IMAGE_SIZE := 7936k + NEC_FW_TYPE := H047 + $(Device/nec-netbsd-aterm) + DEVICE_PACKAGES := kmod-ath10k-ct-smallbuffers ath10k-firmware-qca988x-ct \ + -uboot-envtools + UBOOT_PATH := $$(STAGING_DIR_IMAGE)/$$(SOC)_nec_aterm_fe-u-boot.bin +endef +TARGET_DEVICES += nec_wf1200hp + define Device/nec_wg600hp DEVICE_MODEL := Aterm WG600HP SOC := ar9344 diff --git a/target/linux/ath79/tiny/base-files/etc/board.d/02_network b/target/linux/ath79/tiny/base-files/etc/board.d/02_network index 7bd55986d5..991d39daee 100644 --- a/target/linux/ath79/tiny/base-files/etc/board.d/02_network +++ b/target/linux/ath79/tiny/base-files/etc/board.d/02_network @@ -72,6 +72,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth1" "4:lan:1" ;; + nec,wf1200hp) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "2:lan:3" "3:lan:2" "4:lan:1" + ;; nec,wg600hp|\ nec,wr8750n|\ nec,wr9500n|\ diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh index 8fc0efcfbd..5829c84c05 100644 --- a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh +++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh @@ -12,6 +12,7 @@ platform_check_image() { local board=$(board_name) case "$board" in + nec,wf1200hp|\ nec,wg600hp|\ nec,wr8750n|\ nec,wr9500n)