From: Roger Pueyo Centelles Date: Thu, 4 Jul 2019 12:08:10 +0000 (+0200) Subject: ath79: add support for ALFA Network AP121F X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=334bbc5198;p=openwrt%2Fstaging%2Fthess.git ath79: add support for ALFA Network AP121F This commit ports support for the ALFA Network AP121F, a pocket-size router with 1 Ethernet and 2.4 GHz WiFi based on the AR9331 SoC, to the ath79 target (it was already supported in ar71xx; see commit 0c6165d2 for more details). Signed-off-by: Roger Pueyo Centelles [pepe2k@gmail.com: fixed GPIO polarity, included USB support, changed DTS nodes order, moved WLAN LED trigger define to DTS, made U-Boot env partition writable] Signed-off-by: Piotr Dymacz --- diff --git a/target/linux/ath79/base-files/etc/board.d/01_leds b/target/linux/ath79/base-files/etc/board.d/01_leds index f3bf43a247..d68c1ee9ef 100755 --- a/target/linux/ath79/base-files/etc/board.d/01_leds +++ b/target/linux/ath79/base-files/etc/board.d/01_leds @@ -12,6 +12,9 @@ case "$board" in ucidef_set_led_netdev "lan" "LAN" "$boardname:orange:eth0" "eth0" ucidef_set_led_switch "wan" "WAN" "$boardname:orange:eth1" "switch0" "0x04" ;; +alfa-network,ap121f) + ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" + ;; avm,fritz300e) ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth0" ucidef_set_rssimon "wlan0" "200000" "1" diff --git a/target/linux/ath79/base-files/etc/board.d/02_network b/target/linux/ath79/base-files/etc/board.d/02_network index 41ceb12ee5..beac4660d2 100755 --- a/target/linux/ath79/base-files/etc/board.d/02_network +++ b/target/linux/ath79/base-files/etc/board.d/02_network @@ -11,6 +11,7 @@ ath79_setup_interfaces() case "$board" in adtran,bsap1800-v2|\ adtran,bsap1840|\ + alfa-network,ap121f|\ aruba,ap-105|\ avm,fritz300e|\ devolo,dvl1200i|\ diff --git a/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts new file mode 100644 index 0000000000..82e6f74074 --- /dev/null +++ b/target/linux/ath79/dts/ar9331_alfa-network_ap121f.dts @@ -0,0 +1,134 @@ +// SPDX-License-Identifier: GPL-2.0-or-later OR MIT +/dts-v1/; + +#include +#include + +#include "ar9331.dtsi" + +/ { + model = "ALFA Network AP121F"; + compatible = "alfa-network,ap121f", "qca,ar9331"; + + aliases { + label-mac-device = &wmac; + led-boot = &vpn; + led-failsafe = &vpn; + led-upgrade = &vpn; + serial0 = &uart; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + linux,code = ; + gpios = <&gpio 12 GPIO_ACTIVE_LOW>; + }; + + switch { + label = "switch"; + linux,code = ; + gpios = <&gpio 21 GPIO_ACTIVE_HIGH>; + }; + }; + + leds { + compatible = "gpio-leds"; + + lan { + label = "ap121f:green:lan"; + gpios = <&gpio 17 GPIO_ACTIVE_LOW>; + }; + + vpn: vpn { + label = "ap121f:green:vpn"; + gpios = <&gpio 27 GPIO_ACTIVE_LOW>; + }; + + wlan { + label = "ap121f:green:wlan"; + gpios = <&gpio 0 GPIO_ACTIVE_HIGH>; + linux,default-trigger = "phy0tpt"; + }; + }; +}; + +ð0 { + status = "okay"; + mtd-mac-address = <&art 0x0>; + + gmac-config { + device = <&gmac>; + switch-phy-addr-swap = <0>; + switch-phy-swap = <0>; + }; +}; + +ð1 { + status = "okay"; + compatible = "syscon", "simple-mfd"; +}; + +&gpio { + status = "okay"; +}; + +&spi { + status = "okay"; + num-cs = <1>; + + 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 0x030000>; + read-only; + }; + + partition@30000 { + label = "u-boot-env"; + reg = <0x030000 0x010000>; + }; + + art: partition@40000 { + label = "art"; + reg = <0x040000 0x010000>; + read-only; + }; + + partition@50000 { + compatible = "denx,uimage"; + label = "firmware"; + reg = <0x050000 0xfb0000>; + }; + }; + }; +}; + +&uart { + status = "okay"; +}; + +&usb { + status = "okay"; + dr_mode = "host"; +}; + +&usb_phy { + status = "okay"; +}; + +&wmac { + status = "okay"; + mtd-cal-data = <&art 0x1000>; +}; diff --git a/target/linux/ath79/image/generic.mk b/target/linux/ath79/image/generic.mk index c5807f2c78..42e4271e0c 100644 --- a/target/linux/ath79/image/generic.mk +++ b/target/linux/ath79/image/generic.mk @@ -111,6 +111,16 @@ define Device/adtran_bsap1840 endef TARGET_DEVICES += adtran_bsap1840 +define Device/alfa-network_ap121f + ATH_SOC := ar9331 + DEVICE_VENDOR := ALFA Network + DEVICE_MODEL := AP121F + DEVICE_PACKAGES := kmod-usb2 kmod-usb-chipidea2 kmod-usb-storage -swconfig + IMAGE_SIZE := 16064k + SUPPORTED_DEVICES += ap121f +endef +TARGET_DEVICES += alfa-network_ap121f + define Device/aruba_ap-105 ATH_SOC := ar7161 DEVICE_VENDOR := Aruba