diff --git a/target/linux/ath79/dts/ar9344_longdata_aps256.dts b/target/linux/ath79/dts/ar9344_longdata_aps256.dts new file mode 100644 index 00000000000..0e867bca400 --- /dev/null +++ b/target/linux/ath79/dts/ar9344_longdata_aps256.dts @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT + +#include "ar9344.dtsi" + +#include +#include +#include + +/ { + model = "LONGDATA APS256"; + compatible = "longdata,aps256", "qca,ar9344"; + + aliases { + led-boot = &led_system; + led-failsafe = &led_system; + led-running = &led_system; + led-upgrade = &led_system; + label-mac-device = &wmac; + }; + + leds: leds { + compatible = "gpio-leds"; + + wlan2g { + function = LED_FUNCTION_WLAN; + color = ; + gpios = <&gpio 13 GPIO_ACTIVE_LOW>; + linux,default-trigger = "phy0tpt"; + }; + + led_system: system { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + default-state = "on"; + }; + + internet { + function = LED_FUNCTION_WAN_ONLINE; + color = ; + gpios = <&gpio 11 GPIO_ACTIVE_LOW>; + }; + + wan { + function = LED_FUNCTION_WAN; + color = ; + gpios = <&gpio 18 GPIO_ACTIVE_LOW>; + }; + + lan1 { + function = LED_FUNCTION_LAN; + function-enumerator = <1>; + color = ; + gpios = <&gpio 19 GPIO_ACTIVE_LOW>; + }; + + lan2 { + function = LED_FUNCTION_LAN; + function-enumerator = <2>; + color = ; + gpios = <&gpio 20 GPIO_ACTIVE_LOW>; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "Reset button"; + linux,code = ; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + debounce-interval = <60>; + }; + }; +}; + +&ref { + clock-frequency = <40000000>; +}; + +&spi { + status = "okay"; + + flash@0 { + compatible = "jedec,spi-nor"; + reg = <0>; + spi-max-frequency = <33000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + uboot: partition@0 { + label = "u-boot"; + reg = <0x000000 0x020000>; + read-only; + }; + + partition@20000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x020000 0xfd0000>; + }; + + partition@7f0000 { + label = "art"; + reg = <0xff0000 0x010000>; + read-only; + + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + + macaddr_art_1002: macaddr@1002 { + compatible = "mac-base"; + reg = <0x1002 0x6>; + #nvmem-cell-cells = <1>; + }; + }; + }; + }; + }; +}; + +&pcie { + status = "okay"; +}; + +&wmac { + status = "okay"; + + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; +}; + +&gpio { + +}; + +&builtin_switch { + /delete-property/ qca,phy4-mii-enable; /* need to delete this to make all 5 FE ports work */ +}; + +&usb_phy { + status = "okay"; +}; + +&usb { + #address-cells = <1>; + #size-cells = <0>; + status = "okay"; + + hub_port: port@1 { + reg = <1>; + #trigger-source-cells = <0>; + }; +}; + +ð1 { + status = "okay"; + + nvmem-cells = <&macaddr_art_1002 0>; + nvmem-cell-names = "mac-address"; + + gmac-config { + device = <&gmac>; + switch-phy-swap = <0>; + switch-only-mode = <1>; + }; +}; + 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 b9142c8a079..4eddde1115b 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 @@ -298,6 +298,11 @@ kuwfi,c910) ucidef_set_led_switch "lan1" "LAN1" "white:lan1" "switch0" "0x10" ucidef_set_led_switch "lan2" "LAN2" "white:lan2" "switch0" "0x02" ;; +longdata,aps256) + ucidef_set_led_switch "wan" "WAN" "blue:wan" "switch0" "0x20" + ucidef_set_led_switch "lan1" "LAN1" "blue:lan-1" "switch0" "0x04" + ucidef_set_led_switch "lan2" "LAN2" "blue:lan-2" "switch0" "0x02" + ;; meraki,mr12|\ tplink,cpe210-v2|\ tplink,cpe210-v3) 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 c3de8bed7fc..b1e5818567d 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 @@ -419,6 +419,10 @@ ath79_setup_interfaces() ucidef_add_switch "switch0" \ "0@eth0" "5:wan" "6@eth1" "4:lan" ;; + longdata,aps256) + ucidef_add_switch "switch0" \ + "0@eth0" "1:lan:2" "2:lan:1" "5:wan" + ;; meraki,mr12) ucidef_set_interface_lan "eth0" ucidef_add_switch "switch0" \ diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index 7f0a7b43ded..9c749360533 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -2038,6 +2038,16 @@ define Device/librerouter_librerouter-v1 endef TARGET_DEVICES += librerouter_librerouter-v1 +define Device/longdata_aps256 + SOC := ar9344 + DEVICE_VENDOR := LONGDATA + DEVICE_MODEL := APS256 + DEVICE_PACKAGES := kmod-usb2 + IMAGE_SIZE := 16192k + SUPPORTED_DEVICES += aps256 +endef +TARGET_DEVICES += longdata_aps256 + define Device/meraki_mr12 SOC := ar7242 DEVICE_VENDOR := Meraki