Skip to content

Commit 1506c22

Browse files
committed
realtek/rtl839x: add Edgecore ECS2100-52T support
Add support for the Edgecore ECS2100-52T, a 48-port Gigabit Ethernet switch with 4 SFP ports. Hardware: * SoC: RTL8393M * RAM: 256MiB * Flash: 32MiB SPI-NOR * Ethernet: 48 x 10/100/1000BASE-T ports (6x external RTL8218B) * 4x SFP (1x external RTL8214FC) * GPIO Expander: RTL8231 * Fan controller ADT7470 (not used as temp sensor) * Temp sensor: LM75B * Console: RJ45 RS232 port on front panel (baud rate 115200n8) * Green power LED on front panel (always on) * Green diag LED on front panel * Reset button on front panel * Power: Internal PSU, standard IEC C14 connector (100-240 VAC, 50-60 Hz, Max 40W) Vendor Flash Layout: 0x00000000-0x00100000 : "u-boot" 0x00100000-0x00180000 : "u-boot-env" 0x00180000-0x00200000 : "hwinfo" 0x00200000-0x02000000 : "userdata" The partition "userdata" is a jffs2 used by the vendor to store two images, configurations, license (unique to each device) and other internal data. It is overwritten as OpenWrt "firmware" partition. Backup before installation. Vendor MAC address layout: * label/eth0: hwinfo 0x00 (base MAC) * lan<n>: base MAC + n (e.g., lan1 = base MAC + 1) OpenWrt will use a different sequence: * lan1: label MAC * lan2..lan52: incrementing label MAC with the locally-administered bit set Diag LED is used as the system LED. The U-Boot is protected by two levels of password. The first one is to stop U-Boot auto boot process. It is stored in the ubootenv var passwd and it is protected by a simple cipher. The second privileged mode is activated using the `enable` command. It will again ask for a password stored as a string constant in u-boot code (also protected by the same cipher). The cipher is something like this: ``` codestr = "abcdefghijklmnopqrstuvwxyz1234567890"; codelen = strlen(codestr); passlen = strlen(password); i = 0; while (continue = i < passlen, i = i + 1, continue) { if (codelen == 0) { trap(7); } *password = codestr[(int)*password % (int)codelen]; password = password + 1; } ``` The cipher is not directly reversible but it is trivial to find a collision. Installation via bootloader: 1. Prepare TFTP server & connect to serial port. 2. Connect ECS2100-52T to your computer or network with one of the 1G ports. All of them will be fine. 3. Power on ECS2100-52T and interrupt boot process by pressing CTRL+U. 4. The boot loader will ask for a autoboot password. Try: - xpwaw171 (Bootloader < 1.0.0.0.3) - IfeVjhKk (Bootloader >= 1.0.0.0.3) 5. Call 'enable' to enter 'Privileged mode'. > enable 6. The boot loader will ask for a "backdoor" password. Try: - xpwa8tf5 (Bootloader < 1.0.0.0.3) - IfeVccKP (Bootloader >= 1.0.0.0.3) 7. Change U-Boot startup sequence: > setenv bootcmd 'cp.l 0xb4200000 0x81000000 0x300000; bootm 0x81000000' > saveenv 8. Enable networking within U-Boot. > rtk network on 9. Set switch IP and TFTP server IP (optional, adjust to your setup). > setenv ipaddr <ip> # default 192.168.1.50 > setenv serverip <ip> # default 192.168.1.131 10. Download initramfs image from TFTP server. # You can simply use `tftpboot` with no arguments if you name # the image '3201A8C0.img' > tftpboot 0x81000000 /tftpboot/openwrt-realtek-rtl839x-edgecore_ecs2100-52t-initramfs-kernel.bin 11. Boot with the downloaded image. > bootm 12. With rambooted OpenWrt, backup the stock firmware (in order to revert to vendor firmware). THIS IS CRITICAL! /dev/mtd3 contains data that is not provided in the downloadable vendor firmware images. 13. Copy sysupgrade image to the device. 14. Perform sysupgrade with the sysupgrade image. 15. After reboot, you should have functional OpenWrt. Return to stock firmware: 1. Restore mtd3 content (backup from installation step 12), alternatively: a. From ECS2100-52T running OpenWrt > mtd write /tmp/mtd3.img /dev/mtd3 b. From U-Boot (in 'Privileged mode', see Installation steps 1-6): > tftpboot 0x81000000 /tftpboot/mtd3.img > sf erase 0x200000 0x1e00000 > sf write 0x81000000 0x200000 MTD3_IMG_SIZE 2. From U-Boot (in 'Privileged mode', see Installation steps 1-6), restore the bootcmd: > setenv bootcmd 'acc bootm' > saveenv This commit also adds the `Build/edgecore-header` recipe, which pads the uImage header and appends the specific board ID required by Edgecore images. Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
1 parent f1a6ac8 commit 1506c22

4 files changed

Lines changed: 620 additions & 0 deletions

File tree

target/linux/realtek/base-files/etc/board.d/02_network

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ realtek_setup_macs()
5353

5454
case $board in
5555
datto,l8|\
56+
edgecore,ecs2100-52t|\
5657
edgecore,ecs4100-12ph|\
5758
linksys,lgs310c|\
5859
linksys,lgs328c|\

0 commit comments

Comments
 (0)