openwrt/target/linux/ramips/dts/mt7621_tplink_er605-v2.dts

178 lines
3.0 KiB
Plaintext
Raw Permalink Normal View History

ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
// SPDX-License-Identifier: GPL-2.0-or-later
#include "mt7621.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
/ {
model = "TP-Link ER605 v2";
compatible = "tplink,er605-v2", "mediatek,mt7621-soc";
chosen {
bootargs = "console=ttyS0,115200 noinitrd";
ramips: Fix root volume for tplink-er605-v2 This device has two sets of volumes: main ones (`kernel`, `rootfs`, etc) and 'backup' (`kernel.b`, `rootfs.b`, etc). Bootloader tries to determine which set of volumes to use by looking at contens of `extra-para` and `extra-para.b` volumes. These volumes contain JSON that looks like this: ``` { "dbootFlag": "1", "integerFlag": "1", "fwFlag": "GOOD", "score":1 } ``` It looks like the bootloader looks for `"fwFlag": "GOOD"` (as opposed to `BAD`) then it compares `score` field - whichever 'good' volume has bigger score wins. This determines which set of volumes to use to boot. So for example if `extra-para` is good and has bigger score then `kernel`, `rootfs`, etc volumes are used. This means bootloader needs to explain to the kernel which volume to use for the rootfs. After looking at bootloader code with disassembler I think it contains a bug. Relevant part of code looks something like this: ``` if (image_id == 0) { rootfs_volume_id = 8; rootfs_volume_name = "rootfs"; } else { rootfs_volume_id = 0xf; rootfs_volume_name = "rootfs.b"; } sprintf( &buffer, 0x800, "console=ttyS0,115200 noinitrd ubi.mtd=3,2048 ubi.block=0,%s root=/dev/ubiblock0_%d DKMGT_IMAGE_ID=%d DKMGT_IMAGE_TYPE=ubi", rootfs_volume_name, rootfs_volume_id, image_id ); ``` Where `image_id == 0` if 'normal' (not '*.b' set of volumes is used). However from device dumps we know that from the factory `rootfs.b` has id 8 and `rootfs` has id 15. So from above we can see that ids and names of rootfs volumes do not match. More over - they are hardcoded in the bootloader. Both things are problematic for OpwnWRT which completely removes volumes on update meaning that volume ids may actually change. So instead of relying on bootloader to provide the kernel with root device this patch forces kernel to determine root automatically - and it defaults to `rootfs` volume which is correct for our purposes. Overall this makes image boot fine from flash after sysupgrade from inirams. assuming `extra-para*` volumes make bootloader use non-'*.b' set of volumes. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2023-01-07 03:44:10 +00:00
// Override bootargs because u-boot passes wrong root parameter.
// Instead allow kernel determine root automatically by looking for rootfs volume
bootargs-override = "console=ttyS0,115200 noinitrd ubi.mtd=3,2048";
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
};
aliases {
led-boot = &led_system;
led-failsafe = &led_system;
led-running = &led_system;
led-upgrade = &led_system;
label-mac-device = &gmac0;
};
leds {
compatible = "gpio-leds";
led_usb: usb {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_USB;
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
};
led_power: power {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_POWER;
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
default-state = "on";
};
led_system: system {
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_STATUS;
gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
default-state = "keep";
};
};
keys {
compatible = "gpio-keys";
reset {
label = "reset button";
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_RESTART>;
};
};
reg_usb_vbus: regulator-usb {
compatible = "regulator-fixed";
regulator-name = "usb_vbus";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpios = <&gpio 10 GPIO_ACTIVE_HIGH>;
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
enable-active-high;
};
reg_3p3v: regulator-3p3v {
compatible = "regulator-fixed";
regulator-name = "fixed-3.3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
};
};
&gmac0 {
label = "dsa";
};
&gmac1 {
status = "okay";
ramips: rename interfaces for tplink er605v2 Currently eth1 (which is the first "lan" interface) doesn't work on this device. During boot the following can be seen in logs: ``` [ 2.252804] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.266060] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 19 [ 2.277889] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 19 ... [ 2.355157] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.390312] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode [ 2.398597] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 2.403872] mt7530-mdio mdio-bus:1f eth1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=21) [ 2.416988] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth1 [ 2.426973] mt7530-mdio mdio-bus:1f eth2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=22) [ 2.440996] mt7530-mdio mdio-bus:1f eth3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=23) [ 2.454405] mt7530-mdio mdio-bus:1f eth4 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7530 PHY] (irq=24) [ 2.467198] mtk_soc_eth 1e100000.ethernet eth0: entered promiscuous mode [ 2.474117] DSA: tree 0 setup ... [ 6.820998] mtk_soc_eth 1e100000.ethernet dsa: renamed from eth0 [ 6.919904] mtk_soc_eth 1e100000.ethernet wan: renamed from eth1 ``` So the problem seems to be the fact that built-in gmacs get default names (eth0/eth1) and are renamed after switch ports are initialized. This means that when switch port with name `eth1` is brought up this name is still used by gmac1 causing switch port's init to fail. This patch just renames the ports to avoid name collision. Note: this will break existing configs for this device because it renames all the ports. This should not be major problem because this device doesn't have a proper OEM image and is only flashable with serial access, meaning there should not be many users. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Link: https://github.com/openwrt/openwrt/pull/15865 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-04 03:21:52 +00:00
label = "wan1";
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
phy-handle = <&ethphy0>;
};
&switch0 {
ports {
port@0 {
status = "disabled";
};
port@1 {
status = "okay";
ramips: rename interfaces for tplink er605v2 Currently eth1 (which is the first "lan" interface) doesn't work on this device. During boot the following can be seen in logs: ``` [ 2.252804] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.266060] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 19 [ 2.277889] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 19 ... [ 2.355157] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.390312] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode [ 2.398597] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 2.403872] mt7530-mdio mdio-bus:1f eth1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=21) [ 2.416988] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth1 [ 2.426973] mt7530-mdio mdio-bus:1f eth2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=22) [ 2.440996] mt7530-mdio mdio-bus:1f eth3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=23) [ 2.454405] mt7530-mdio mdio-bus:1f eth4 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7530 PHY] (irq=24) [ 2.467198] mtk_soc_eth 1e100000.ethernet eth0: entered promiscuous mode [ 2.474117] DSA: tree 0 setup ... [ 6.820998] mtk_soc_eth 1e100000.ethernet dsa: renamed from eth0 [ 6.919904] mtk_soc_eth 1e100000.ethernet wan: renamed from eth1 ``` So the problem seems to be the fact that built-in gmacs get default names (eth0/eth1) and are renamed after switch ports are initialized. This means that when switch port with name `eth1` is brought up this name is still used by gmac1 causing switch port's init to fail. This patch just renames the ports to avoid name collision. Note: this will break existing configs for this device because it renames all the ports. This should not be major problem because this device doesn't have a proper OEM image and is only flashable with serial access, meaning there should not be many users. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Link: https://github.com/openwrt/openwrt/pull/15865 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-04 03:21:52 +00:00
label = "lan2";
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
};
port@2 {
status = "okay";
ramips: rename interfaces for tplink er605v2 Currently eth1 (which is the first "lan" interface) doesn't work on this device. During boot the following can be seen in logs: ``` [ 2.252804] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.266060] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 19 [ 2.277889] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 19 ... [ 2.355157] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.390312] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode [ 2.398597] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 2.403872] mt7530-mdio mdio-bus:1f eth1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=21) [ 2.416988] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth1 [ 2.426973] mt7530-mdio mdio-bus:1f eth2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=22) [ 2.440996] mt7530-mdio mdio-bus:1f eth3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=23) [ 2.454405] mt7530-mdio mdio-bus:1f eth4 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7530 PHY] (irq=24) [ 2.467198] mtk_soc_eth 1e100000.ethernet eth0: entered promiscuous mode [ 2.474117] DSA: tree 0 setup ... [ 6.820998] mtk_soc_eth 1e100000.ethernet dsa: renamed from eth0 [ 6.919904] mtk_soc_eth 1e100000.ethernet wan: renamed from eth1 ``` So the problem seems to be the fact that built-in gmacs get default names (eth0/eth1) and are renamed after switch ports are initialized. This means that when switch port with name `eth1` is brought up this name is still used by gmac1 causing switch port's init to fail. This patch just renames the ports to avoid name collision. Note: this will break existing configs for this device because it renames all the ports. This should not be major problem because this device doesn't have a proper OEM image and is only flashable with serial access, meaning there should not be many users. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Link: https://github.com/openwrt/openwrt/pull/15865 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-04 03:21:52 +00:00
label = "lan3";
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
};
port@3 {
status = "okay";
ramips: rename interfaces for tplink er605v2 Currently eth1 (which is the first "lan" interface) doesn't work on this device. During boot the following can be seen in logs: ``` [ 2.252804] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.266060] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 19 [ 2.277889] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 19 ... [ 2.355157] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.390312] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode [ 2.398597] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 2.403872] mt7530-mdio mdio-bus:1f eth1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=21) [ 2.416988] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth1 [ 2.426973] mt7530-mdio mdio-bus:1f eth2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=22) [ 2.440996] mt7530-mdio mdio-bus:1f eth3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=23) [ 2.454405] mt7530-mdio mdio-bus:1f eth4 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7530 PHY] (irq=24) [ 2.467198] mtk_soc_eth 1e100000.ethernet eth0: entered promiscuous mode [ 2.474117] DSA: tree 0 setup ... [ 6.820998] mtk_soc_eth 1e100000.ethernet dsa: renamed from eth0 [ 6.919904] mtk_soc_eth 1e100000.ethernet wan: renamed from eth1 ``` So the problem seems to be the fact that built-in gmacs get default names (eth0/eth1) and are renamed after switch ports are initialized. This means that when switch port with name `eth1` is brought up this name is still used by gmac1 causing switch port's init to fail. This patch just renames the ports to avoid name collision. Note: this will break existing configs for this device because it renames all the ports. This should not be major problem because this device doesn't have a proper OEM image and is only flashable with serial access, meaning there should not be many users. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Link: https://github.com/openwrt/openwrt/pull/15865 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-04 03:21:52 +00:00
label = "lan4";
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
};
port@4 {
status = "okay";
ramips: rename interfaces for tplink er605v2 Currently eth1 (which is the first "lan" interface) doesn't work on this device. During boot the following can be seen in logs: ``` [ 2.252804] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.266060] mtk_soc_eth 1e100000.ethernet eth0: mediatek frame engine at 0xbe100000, irq 19 [ 2.277889] mtk_soc_eth 1e100000.ethernet eth1: mediatek frame engine at 0xbe100000, irq 19 ... [ 2.355157] mt7530-mdio mdio-bus:1f: MT7530 adapts as multi-chip module [ 2.390312] mt7530-mdio mdio-bus:1f: configuring for fixed/rgmii link mode [ 2.398597] mt7530-mdio mdio-bus:1f: Link is Up - 1Gbps/Full - flow control rx/tx [ 2.403872] mt7530-mdio mdio-bus:1f eth1 (uninitialized): PHY [mt7530-0:01] driver [MediaTek MT7530 PHY] (irq=21) [ 2.416988] mtk_soc_eth 1e100000.ethernet eth0: error -17 registering interface eth1 [ 2.426973] mt7530-mdio mdio-bus:1f eth2 (uninitialized): PHY [mt7530-0:02] driver [MediaTek MT7530 PHY] (irq=22) [ 2.440996] mt7530-mdio mdio-bus:1f eth3 (uninitialized): PHY [mt7530-0:03] driver [MediaTek MT7530 PHY] (irq=23) [ 2.454405] mt7530-mdio mdio-bus:1f eth4 (uninitialized): PHY [mt7530-0:04] driver [MediaTek MT7530 PHY] (irq=24) [ 2.467198] mtk_soc_eth 1e100000.ethernet eth0: entered promiscuous mode [ 2.474117] DSA: tree 0 setup ... [ 6.820998] mtk_soc_eth 1e100000.ethernet dsa: renamed from eth0 [ 6.919904] mtk_soc_eth 1e100000.ethernet wan: renamed from eth1 ``` So the problem seems to be the fact that built-in gmacs get default names (eth0/eth1) and are renamed after switch ports are initialized. This means that when switch port with name `eth1` is brought up this name is still used by gmac1 causing switch port's init to fail. This patch just renames the ports to avoid name collision. Note: this will break existing configs for this device because it renames all the ports. This should not be major problem because this device doesn't have a proper OEM image and is only flashable with serial access, meaning there should not be many users. Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com> Link: https://github.com/openwrt/openwrt/pull/15865 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-04 03:21:52 +00:00
label = "lan5";
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
};
};
};
&nand {
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x80000>;
read-only;
};
partition@80000 {
label = "u-boot-env";
reg = <0x80000 0x80000>;
read-only;
};
partition@100000 {
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
label = "factory";
reg = <0x100000 0x40000>;
read-only;
};
partition@140000 {
label = "firmware";
reg = <0x140000 0x7cc0000>;
};
partition@7e00000 {
label = "panic-ops";
reg = <0x7e00000 0x200000>;
};
};
};
&ethphy0 {
/delete-property/ interrupts;
ramips: add basic support for tp-link er605-v2 This is a MT7621-based device with 128MB NAND flash, 256MB RAM, and a USB port. The board has headers to attach console. In order for them to work two solder bridges near those pads need to be made. The defice has the following partition table: ``` 0x000000000000-0x000000080000 : "u-boot" 0x000000080000-0x000000100000 : "u-boot-env" 0x000000100000-0x000000140000 : "factory" 0x000000140000-0x000007e00000 : "firmware" 0x000007e00000-0x000008000000 : "panic-ops" ``` `firmware` partition contains UBI volumes. Unfortunately I accidentally wiped partition and I no longer have access to it. `firmware` partition contains 'secondary' U-Boot which is run by 'first' u-boot. It also contains various configuration partitions that include device info and MAC address. There also seems to be 'primary' and 'backup' set of 'main' volumes. U-boot has `mtkupgrade` command that just overrides data on firmware partitions. Firmware file provided by TP-Link cannot be used with that command. U-boot also has 'recovery' http server. Unfortunately I was not able to make it work with manufacturer's firmware. Manufacturer's firmware essentially contains multiple UBI volumes along with 'partition table'. Unfortunately I no longer can properly run manufacturer's firmware so I cannot at the moment try to a support for building 'factory' images. This patch adds support for initramfs image as well as sysupgrade image. This seems to be pretty standard MT7621 board otherwise. Things that work: * network * leds * usb * factory MAC detection Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
2022-12-15 01:26:38 +00:00
};
&state_default {
gpio {
groups = "uart2", "uart3", "pcie", "jtag";
function = "gpio";
};
};
&spi0 {
status = "disabled";
};
&xhci {
vusb33-supply = <&reg_3p3v>;
vbus-supply = <&reg_usb_vbus>;
};