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>
Link: https://github.com/openwrt/openwrt/pull/24796
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
OpenWrt Project is a Linux operating system targeting embedded devices. Instead of trying to create a single, static firmware, OpenWrt provides a fully writable filesystem with package management. This frees you from the application selection and configuration provided by the vendor and allows you to customize the device through the use of packages to suit any application. For developers, OpenWrt is the framework to build an application without having to build a complete firmware around it; for users this means the ability for full customization, to use the device in ways never envisioned.
Sunshine!
Download
Built firmware images are available for many architectures and come with a package selection to be used as WiFi home router. To quickly find a factory image usable to migrate from a vendor stock firmware to OpenWrt, try the Firmware Selector.
If your device is supported, please follow the Info link to see install instructions or consult the support resources listed below.
An advanced user may require additional or specific package. (Toolchain, SDK, ...) For everything else than simple firmware download, try the wiki download page:
Development
To build your own firmware you need a GNU/Linux, BSD or macOS system (case sensitive filesystem required). Cygwin is unsupported because of the lack of a case sensitive file system.
Requirements
You need the following tools to compile OpenWrt, the package names vary between distributions. A complete list with distribution specific packages is found in the Build System Setup documentation.
binutils bzip2 diff find flex gawk gcc-6+ getopt grep install libc-dev libz-dev
make4.1+ perl python3.8+ rsync subversion unzip which
Quickstart
-
Run
./scripts/feeds update -ato obtain all the latest package definitions defined in feeds.conf / feeds.conf.default -
Run
./scripts/feeds install -ato install symlinks for all obtained packages into package/feeds/ -
Run
make menuconfigto select your preferred configuration for the toolchain, target system & firmware packages. -
Run
maketo build your firmware. This will download all sources, build the cross-compile toolchain and then cross-compile the GNU/Linux kernel & all chosen applications for your target system.
Related Repositories
The main repository uses multiple sub-repositories to manage packages of
different categories. All packages are installed via the OpenWrt package
manager called opkg. If you're looking to develop the web interface or port
packages to OpenWrt, please find the fitting repository below.
-
LuCI Web Interface: Modern and modular interface to control the device via a web browser.
-
OpenWrt Packages: Community repository of ported packages.
-
OpenWrt Routing: Packages specifically focused on (mesh) routing.
-
OpenWrt Video: Packages specifically focused on display servers and clients (Xorg and Wayland).
Support Information
For a list of supported devices see the OpenWrt Hardware Database
Documentation
Support Community
- Forum: For usage, projects, discussions and hardware advise.
- Support Chat: Channel
#openwrton oftc.net.
Developer Community
- Bug Reports: Report bugs in OpenWrt
- Dev Mailing List: Send patches
- Dev Chat: Channel
#openwrt-develon oftc.net.
License
OpenWrt is licensed under GPL-2.0
