From b7d4936042a8d8b0fe2de7a13259d9199315e0da Mon Sep 17 00:00:00 2001 From: libinanshu <44538423+libinanshu@users.noreply.github.com> Date: Thu, 8 Jul 2021 10:55:13 +0800 Subject: [PATCH] add Pisen_WPR003N (#7307) * Update arpbind.po * Update sfe.po * Update flowoffload.po * add Pisen_WPR003N --- .../linux/ath79/dts/ar9341_pisen_wpr003n.dts | 106 ++++++++++++++++++ .../generic/base-files/etc/board.d/01_leds | 3 + .../generic/base-files/etc/board.d/02_network | 5 + target/linux/ath79/image/generic.mk | 10 ++ 4 files changed, 124 insertions(+) create mode 100644 target/linux/ath79/dts/ar9341_pisen_wpr003n.dts diff --git a/target/linux/ath79/dts/ar9341_pisen_wpr003n.dts b/target/linux/ath79/dts/ar9341_pisen_wpr003n.dts new file mode 100644 index 000000000..5473c5408 --- /dev/null +++ b/target/linux/ath79/dts/ar9341_pisen_wpr003n.dts @@ -0,0 +1,106 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9341.dtsi" + +#include +#include + +/ { + model = "PISEN WPR003N"; + compatible = "pisen,wpr003n", "qca,ar9341"; + + aliases { + led-boot = &led_power; + led-failsafe = &led_power; + led-running = &led_power; + led-upgrade = &led_power; + label-mac-device = &wmac; + }; + + leds { + compatible = "gpio-leds"; + + led_power: power { + label = "blue:power"; + gpios = <&gpio 4 GPIO_ACTIVE_HIGH>; + default-state = "on"; + }; + + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + 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>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "tplink,firmware"; + label = "firmware"; + reg = <0x020000 0xfd0000>; + }; + + art: partition@ff0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + }; + }; + }; +}; + +ð0 { + status = "okay"; + + phy-handle = <&swphy4>; + + mtd-mac-address = <&uboot 0x1fc00>; + mtd-mac-address-increment = <(-1)>; +}; + +ð1 { + mtd-mac-address = <&uboot 0x1fc00>; + + gmac-config { + device = <&gmac>; + switch-phy-only_mode = <0>; + }; +}; + +&usb { + status = "okay"; +}; + +&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 5d67d1468..8d169285a 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 @@ -22,6 +22,9 @@ tplink,cpe610-v1|\ tplink,cpe610-v2) ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0" ;; +pisen,wpr003n) + ucidef_set_led_netdev "wan" "WAN" "blue:power" "eth1" "tx rx" + ;; alfa-network,n2q) ucidef_set_led_netdev "lan2" "LAN2" "orange:lan2" "eth1" ucidef_set_led_switch "lan1" "LAN1" "orange:lan1" "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 833a1d42b..2afdc3d88 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 @@ -404,6 +404,11 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "1:lan:4" "2:lan:1" "3:lan:2" "4:lan:3" ;; + pisen,wpr003n) + ucidef_set_interface_wan "eth1" + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan" + ;; tplink,tl-wr1043nd-v1) ucidef_add_switch "switch0" \ "1:lan" "2:lan" "3:lan" "4:lan" "0:wan" "5@eth0" diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 3c80707b7..674e6e6b7 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -1902,6 +1902,16 @@ define Device/pisen_wmm003n endef TARGET_DEVICES += pisen_wmm003n +define Device/pisen_wpr003n + $(Device/tplink-16mlzma) + SOC := ar9341 + DEVICE_VENDOR := PISEN + DEVICE_MODEL := WPR003N + DEVICE_PACKAGES := kmod-usb-core kmod-usb2 + TPLINK_HWID := 0x08410008 +endef +TARGET_DEVICES += pisen_wpr003n + define Device/plasmacloud_pa300-common SOC := qca9533 DEVICE_VENDOR := Plasma Cloud