From b78b424a70d6b5e66da5f1fd39ab62b2279602ce Mon Sep 17 00:00:00 2001 From: David Bauer Date: Wed, 20 Dec 2023 15:01:29 +0100 Subject: [PATCH] ramips: add support for Allnet ALL-PR4014P 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 --- .../ramips/dts/mt7621_allnet_all-pr4014p.dts | 149 ++++++++++++++++++ target/linux/ramips/image/mt7621.mk | 9 ++ 2 files changed, 158 insertions(+) create mode 100644 target/linux/ramips/dts/mt7621_allnet_all-pr4014p.dts 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 index 0000000000..e414ce6e1b --- /dev/null +++ b/target/linux/ramips/dts/mt7621_allnet_all-pr4014p.dts @@ -0,0 +1,149 @@ +#include "mt7621.dtsi" + +#include +#include + +/ { + 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 = ; + }; + }; +}; + +&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"; +}; diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk index 2c25b1ab28..51e5484dda 100644 --- a/target/linux/ramips/image/mt7621.mk +++ b/target/linux/ramips/image/mt7621.mk @@ -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 -- 2.30.2