ath79: port TP-Link EAP120 dev/ath79-eap120
authorSander Vanheule <sander@svanheule.net>
Sun, 19 Mar 2023 09:14:40 +0000 (10:14 +0100)
committerSander Vanheule <sander@svanheule.net>
Sun, 19 Mar 2023 10:03:45 +0000 (11:03 +0100)
target/linux/ath79/dts/ar9344_tplink_eap120-v1.dts [new file with mode: 0644]
target/linux/ath79/image/generic-tp-link.mk

diff --git a/target/linux/ath79/dts/ar9344_tplink_eap120-v1.dts b/target/linux/ath79/dts/ar9344_tplink_eap120-v1.dts
new file mode 100644 (file)
index 0000000..86ef7b8
--- /dev/null
@@ -0,0 +1,144 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "ar9344.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+       compatible = "tplink,eap120-v1", "qca,ar9344";
+       model = "TP-Link EAP120 v1.0";
+
+       aliases {
+               label-mac-device = &wmac;
+               led-boot = &status_green;
+               led-failsafe = &status_amber;
+               led-running = &status_green;
+               led-upgrade = &status_amber;
+       };
+
+       keys {
+               compatible = "gpio-keys";
+
+               reset {
+                       linux,code = <KEY_RESTART>;
+                       gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
+                       debounce-interval = <60>;
+               };
+       };
+
+       leds {
+               compatible = "gpio-leds";
+
+               status_amber: status-amber {
+                       label = "amber:status";
+                       gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
+               };
+
+               status_green: status-green {
+                       label = "green:status";
+                       gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
+               };
+
+               status_red: status-red {
+                       label = "red:status";
+                       gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
+               };
+       };
+};
+
+&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>;
+
+                       partition@0 {
+                               label = "u-boot";
+                               reg = <0x000000 0x020000>;
+                               read-only;
+                       };
+
+                       partition@20000 {
+                               label = "partition-table";
+                               reg = <0x020000 0x010000>;
+                               read-only;
+                       };
+
+                       partition@30000 {
+                               label = "info";
+                               reg = <0x030000 0x010000>;
+                               read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               macaddr: macaddr@8 {
+                                       reg = <0x8 0x6>;
+                               };
+                       };
+
+                       /* FIXME ELF image and size */
+                       partition@40000 {
+                               label = "firmware";
+                               reg = <0x040000 0xf80000>;
+                       };
+
+                       partition@fc0000 {
+                               label = "config";
+                               reg = <0xfc0000 0x030000>;
+                               read-only;
+                       };
+
+                       partition@ff0000 {
+                               label = "art";
+                               reg = <0xff0000 0x010000>;
+                               read-only;
+
+                               compatible = "nvmem-cells";
+                               #address-cells = <1>;
+                               #size-cells = <1>;
+
+                               calibration: calibration@1000 {
+                                       reg = <0x1000 0x440>;
+                               };
+                       };
+               };
+       };
+};
+
+&wmac {
+       status = "okay";
+
+       nvmem-cells = <&macaddr>, <&calibration>;
+       nvmem-cell-names = "mac-address", "calibration";
+};
+
+/* FIXME gpio mdio? */
+/* FIXME eth0 on MII addr 4 */
+&swphy4 {
+       phy-mode = "rgmii";
+};
+
+&eth0 {
+       status = "okay";
+
+       pll-data = <0x0e000000 0x00000101 0x00001313>;
+
+       phy-handle = <&swphy4>;
+
+       nvmem-cells = <&macaddr>;
+       nvmem-cell-names = "mac-address";
+};
index 83361892937a303aab8656804aba16e9e6ecb84f..487cbda3ee44bcf5b14fb16b1aa2649a92a2fb9f 100644 (file)
@@ -400,6 +400,16 @@ define Device/tplink-eap2x5
        pad-extra 128
 endef
 
+define Device/tplink_eap120-v1
+  $(Device/tplink-eap2x5)
+  SOC := ar9344
+  IMAGE_SIZE := 15872k
+  DEVICE_MODEL := EAP120
+  DEVICE_VARIANT := v1
+  TPLINK_BOARD_ID := EAP120
+endef
+TARGET_DEVICES += tplink_eap120-v1
+
 define Device/tplink_eap225-outdoor-v1
   $(Device/tplink-eap2x5)
   SOC := qca9563