--- /dev/null
+#include "mt7621.dtsi"
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ model = "Allnet ALL-PR4014P";
+ compatible = "allnet,all-4014p", "mediatek,mt7621-soc";
+
+ aliases {
+ label-mac-device = &gmac0;
+ };
+
+ i2c-gpio {
+ compatible = "i2c-gpio";
+
+ sda-gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
+ scl-gpios = <&gpio 4 GPIO_ACTIVE_HIGH>;
+
+ i2c-gpio,delay-us = <50>;
+
+ /* Microsemi PD69104B1 PSE controller at 0x20*/
+ };
+
+ chosen {
+ bootargs-override = "console=ttyS0,57600";
+ };
+
+ keys {
+ compatible = "gpio-keys";
+
+ reset {
+ label = "reset";
+ gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
+ linux,code = <KEY_RESTART>;
+ };
+ };
+};
+
+&gmac0 {
+ label = "dsa";
+
+ nvmem-cells = <&macaddr_lan>;
+ nvmem-cell-names = "mac-address";
+};
+
+&gmac1 {
+ status = "okay";
+ label = "wan";
+ phy-handle = <ðphy4>;
+
+ nvmem-cells = <&macaddr_wan>;
+ nvmem-cell-names = "mac-address";
+};
+
+&mdio {
+ ethphy4: ethernet-phy@4 {
+ reg = <4>;
+ };
+};
+
+&switch0 {
+ ports {
+ port@0 {
+ status = "okay";
+ label = "lan4";
+ };
+
+ port@1 {
+ status = "okay";
+ label = "lan3";
+ };
+
+ port@2 {
+ status = "okay";
+ label = "lan2";
+ };
+
+ port@3 {
+ status = "okay";
+ label = "lan1";
+ };
+ };
+};
+
+&state_default {
+ gpio {
+ groups = "i2c", "wdt";
+ function = "gpio";
+ };
+};
+
+&spi0 {
+ status = "okay";
+
+ flash@0 {
+ compatible = "jedec,spi-nor";
+ reg = <0>;
+ spi-max-frequency = <30000000>;
+
+ partitions {
+ compatible = "fixed-partitions";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ partition@0 {
+ label = "u-boot";
+ reg = <0x0 0x30000>;
+ read-only;
+ };
+
+ partition@30000 {
+ label = "config";
+ reg = <0x30000 0x10000>;
+ read-only;
+ };
+
+ partition@40000 {
+ label = "factory";
+ reg = <0x40000 0x10000>;
+ read-only;
+
+ nvmem-layout {
+ compatible = "fixed-layout";
+ #address-cells = <1>;
+ #size-cells = <1>;
+
+ macaddr_lan: macaddr@e000 {
+ reg = <0xe000 0x6>;
+ };
+
+ macaddr_wan: macaddr@e006 {
+ reg = <0xe006 0x6>;
+ };
+ };
+ };
+
+ partition@50000 {
+ compatible = "denx,uimage";
+ label = "firmware";
+ reg = <0x50000 0x7b0000>;
+ };
+ };
+ };
+};
+
+&xhci {
+ status = "disabled";
+};
endef
TARGET_DEVICES += alfa-network_quad-e4g
+define Device/allnet_all-pr4014p
+ $(Device/dsa-migration)
+ DEVICE_VENDOR := Allnet
+ DEVICE_MODEL := ALL-PR4014P
+ DEVICE_PACKAGES += -uboot-envtools kmod-i2c-ralink
+ IMAGE_SIZE := 7872k
+endef
+TARGET_DEVICES += allnet_all-pr4014p
+
define Device/ampedwireless_ally_common
$(Device/nand)
DEVICE_VENDOR := Amped Wireless