ath79: add support for Qualcomm AP143 reference board
authorZoltan HERPAI <wigyori@uid0.hu>
Mon, 3 Aug 2020 21:07:21 +0000 (23:07 +0200)
committerZoltan HERPAI <wigyori@uid0.hu>
Mon, 7 Sep 2020 16:48:09 +0000 (18:48 +0200)
Specifications:

SoC:    QCA9533
DRAM:   32Mb DDR1
Flash:  8 or 16Mb SPI-NOR
LAN:    4x 10/100Mbps via AR8229 switch (integrated into SoC)
        on GMII
WAN:    1x 10/100Mbps via MII
WLAN:   QCA9530
USB:    1x 2.0
UART:   standard QCA UART header
JTAG:   yes
Button: 1x WPS, 1x reset
LEDs:   8x LEDs

A version with 4Mb flash is also available, but due to lack of
enough space it's not supported.

Installation:
TBD, depending on pepe2k's u-boot mod.

Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
target/linux/ath79/dts/qca9533_qca_ap143.dts [new file with mode: 0644]
target/linux/ath79/generic/base-files/etc/board.d/01_leds
target/linux/ath79/generic/base-files/etc/board.d/02_network
target/linux/ath79/image/generic.mk

diff --git a/target/linux/ath79/dts/qca9533_qca_ap143.dts b/target/linux/ath79/dts/qca9533_qca_ap143.dts
new file mode 100644 (file)
index 0000000..0e354e6
--- /dev/null
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/dts-v1/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+#include "qca953x.dtsi"
+
+/ {
+       compatible = "qca,ap143", "qca,qca9533";
+       model = "Qualcomm Atheros AP143 reference board";
+
+       aliases {
+               label-mac-device = &wmac;
+               led-boot = &led_wps;
+               led-failsafe = &led_wps;
+               led-running = &led_wps;
+               led-upgrade = &led_wps;
+       };
+
+       leds: leds {
+               compatible = "gpio-leds";
+
+               wan {
+                       label = "ap143:green:wan";
+                       gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+               };
+
+               wlan {
+                       label = "ap143:green:wlan";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+
+               lan1 {
+                       label = "ap143:green:lan1";
+                       gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
+               };
+
+               lan2 {
+                       label = "ap143:green:lan2";
+                       gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               };
+
+               lan3 {
+                       label = "ap143:green:lan3";
+                       gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
+               };
+
+               lan4 {
+                       label = "ap143:green:lan4";
+                       gpios = <&gpio 11 GPIO_ACTIVE_LOW>;
+               };
+
+               led_wps: wps {
+                       label = "ap143:green:wps";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               wps {
+                       label = "WPS button";
+                       linux,code = <KEY_WPS_BUTTON>;
+                       gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <60>;
+               };
+       };
+};
+
+&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 0x040000>;
+                               read-only;
+                       };
+
+                       partition@40000 {
+                               label = "u-boot-env";
+                               reg = <0x040000 0x010000>;
+                               read-only;
+                       };
+
+                       partition@50000 {
+                               compatible = "denx,uimage";
+                               label = "firmware";
+                               reg = <0x050000 0x7a0000>;
+                       };
+
+                       art: partition@ff0000 {
+                               label = "art";
+                               reg = <0x7f0000 0x010000>;
+                               read-only;
+                       };
+               };
+       };
+};
+
+&uart {
+       status = "okay";
+};
+
+&eth0 {
+       status = "okay";
+       mtd-mac-address = <&art 0x0>;
+       phy-handle = <&swphy4>;
+};
+
+&eth1 {
+       status = "okay";
+       mtd-mac-address = <&art 0x6>;
+
+       gmac-config {
+               device = <&gmac>;
+       };
+};
+
+&wmac {
+       status = "okay";
+       mtd-cal-data = <&art 0x1000>;
+};
+
+&usb0 {
+//     #address-cells = <1>;
+//     #size-cells = <0>;
+
+       status = "okay";
+};
+
+&usb_phy {
+       status = "okay";
+};
index decbb350963d54020983197a9c2ff0d2121c15e5..9567156c543002720c83311abe340f095ee46c30 100755 (executable)
@@ -208,6 +208,14 @@ pcs,cr3000)
        ucidef_set_led_switch "lan3" "LAN3" "pcs:blue:lan3" "switch0" "0x10"
        ucidef_set_led_switch "lan4" "LAN4" "pcs:blue:lan4" "switch0" "0x02"
        ;;
+qca,ap143)
+       ucidef_set_led_switch "lan1" "LAN1" "$boardname:green:lan1" "switch0" "0x02"
+       ucidef_set_led_switch "lan2" "LAN2" "$boardname:green:lan2" "switch0" "0x04"
+       ucidef_set_led_switch "lan3" "LAN3" "$boardname:green:lan3" "switch0" "0x08"
+       ucidef_set_led_switch "lan4" "LAN4" "$boardname:green:lan4" "switch0" "0x10"
+       ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
+       ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth1"
+       ;;
 qihoo,c301)
        ucidef_set_led_wlan "wlan" "WLAN" "$boardname:green:wlan" "phy0tpt"
        ;;
index 34dd975e19365e54fb71fc05bcdc83fd8650bbc8..7330a6ee3a4551f8acfd735711ea9cc13bf1bc51 100755 (executable)
@@ -258,6 +258,11 @@ ath79_setup_interfaces()
                ucidef_add_switch "switch0" \
                        "0@eth0" "3:lan:1" "5:lan:2" "4:wan"
                ;;
+       qca,ap143)
+               ucidef_set_interface_wan "eth1"
+               ucidef_add_switch "switch0" \
+                       "0@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
+               ;;
        qihoo,c301)
                ucidef_set_interface_wan "eth1"
                ucidef_add_switch "switch0" \
index 5dd1dacae472fe71f6a588a89de2eaf053771e57..d3afbb04f88dccf630134cd25bafc5163779cc57 100644 (file)
@@ -1380,6 +1380,16 @@ define Device/pisen_wmm003n
 endef
 TARGET_DEVICES += pisen_wmm003n
 
+define Device/qca_ap143
+  SOC := qca9533
+  DEVICE_VENDOR := Qualcomm Atheros
+  DEVICE_MODEL := AP143
+  DEVICE_PACKAGES := kmod-usb2 kmod-usb-storage
+  IMAGE_SIZE := 7808k
+  SUPPORTED_DEVICES += ap143
+endef
+TARGET_DEVICES += qca_ap143
+
 define Device/qihoo_c301
   $(Device/seama)
   SOC := ar9344