--- /dev/null
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+/ {
+ compatible = "asiarf,ap7621-004-v3", "mediatek,mt7621-soc";
+ model = "AsiaRF AP7621-004 v3";
+
+ keys {
+ compatible = "gpio-keys";
+
+ wps {
+ label = "wps";
+ gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_WPS_BUTTON>;
+ };
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+&sdhci {
+ status = "okay";
+ non-removable;
+};
+
+&spi0 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <40000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "u-boot-env";
+ reg = <0x30000 0x10000>;
+ };
+
+ partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_factory_e000: macaddr@e000 {
+ reg = <0xe000 0x6>;
+ };
+
+ macaddr_factory_e006: macaddr@e006 {
+ reg = <0xe006 0x6>;
+ };
+ };
+ };
+
+ partition@50000 {
+ label = "firmware";
+ reg = <0x50000 0xfb0000>;
+ compatible = "denx,uimage";
+ };
+ };
+ };
+};
+
+&pcie {
+ status = "okay";
+};
+
+ðernet {
+ pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
+};
+
+&gmac0 {
+ status = "okay";
+
+ nvmem-cell-names = "mac-address";
+ nvmem-cells = <&macaddr_factory_e000>;
+};
+
+&switch0 {
+ ports {
+ port@0 {
+ status = "okay";
+ label = "wan";
+ nvmem-cell-names = "mac-address";
+ nvmem-cells = <&macaddr_factory_e006>;
+ };
+
+ port@1 {
+ status = "okay";
+ label = "lan1";
+ };
+
+ port@2 {
+ status = "okay";
+ label = "lan2";
+ };
+
+ port@3 {
+ status = "okay";
+ label = "lan3";
+ };
+
+ port@4 {
+ status = "okay";
+ label = "lan4";
+ };
+ };
+
+};
+
+&state_default {
+ gpio {
+ groups = "wdt", "jtag";
+ function = "gpio";
+ };
+};
endef
TARGET_DEVICES += asiarf_ap7621-001
+define Device/asiarf_ap7621-004-v3
+ $(Device/dsa-migration)
+ $(Device/uimage-lzma-loader)
+ DEVICE_VENDOR := AsiaRF
+ DEVICE_MODEL := AP7621-004
+ DEVICE_VARIANT := v3
+ IMAGE_SIZE := 16000k
+ DEVICE_PACKAGES := kmod-mmc-mtk kmod-usb3
+endef
+TARGET_DEVICES += asiarf_ap7621-004-v3
+
define Device/asiarf_ap7621-nv1
$(Device/dsa-migration)
$(Device/uimage-lzma-loader)