ramips: add support for Allnet ALL-PR4014P allnet-switch
authorDavid Bauer <mail@david-bauer.net>
Wed, 20 Dec 2023 14:01:29 +0000 (15:01 +0100)
committerDavid Bauer <mail@david-bauer.net>
Sat, 23 Dec 2023 19:17:49 +0000 (20:17 +0100)
Hardware
--------
CPU:     MediaTek MT7621
RAM:     128M DDR3 (NANYA NT5CC64M16GP-DI)
FLASH:   8MB SPI-NOR (Macronix MX25L6405D)
PoE-PSE: Microsemi PD69104B1
PoE-PD:  TI TPS2379
UART:    57600 8N1 3.3V
         Pinout is silkscreened next to header
         Don't connect VCC / 3.3V!

Installation
------------
Upload the OpenWrt sysupgrade image using the Update page in the
web-interface of the Router. Make sure you use the correct mask
(Firmware, not Bootloader!).

Be patient. This process is very slow and can take up to 5 minutes.

Signed-off-by: David Bauer <mail@david-bauer.net>
target/linux/ramips/dts/mt7621_allnet_all-pr4014p.dts [new file with mode: 0644]
target/linux/ramips/image/mt7621.mk

diff --git a/target/linux/ramips/dts/mt7621_allnet_all-pr4014p.dts b/target/linux/ramips/dts/mt7621_allnet_all-pr4014p.dts
new file mode 100644 (file)
index 0000000..e414ce6
--- /dev/null
@@ -0,0 +1,149 @@
+#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 = <&ethphy4>;
+
+       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";
+};
index 2c25b1ab28a0e659b1e69a5e8304f941267eaa8e..51e5484dda5e8b49257874081129475eef711b13 100644 (file)
@@ -240,6 +240,15 @@ define Device/alfa-network_quad-e4g
 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