Warnign: Flashing custom bootloaders can brick your device. Proceed with caution and at your own risk.
A modified version of DragonBluep's u-boot for mt7621 by Yuzhii.
Support functions and Features:
- Failsafe Mode with Web Recovery Page
- Support light/dark theme
- I18n support (English/Chinese)
- Auto dhcpd server
- Support Web upgrade U-Boot
- Can boot Initramfs firmware in Web
- Factory(RF) flash
- Backup partition and all flash
- Sysinfo display
Support Actions to build automatically.
-
Fork This Repository.
-
Click
Actionsthen chooseBuild customized u-boot. -
Click
Run workflowand set board specific parameters. -
U-Boot image will be uploaded to Artifacts.
-
Fork This Repository and clone it to local machine.
-
Install required packages:
On Ubuntu22.04:
sudo apt-get install git swig python2-dev- Get toolchain:
wget -O - https://github.com/DragonBluep/uboot-mt7621/releases/download/20230517/openwrt-toolchain-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz | tar --xz -xf -The toolchain directory and U-Boot source directory should be in the same directory. For example:
├── openwrt-toolchain-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64 └── uboot-mt7621-dhcpd
- Run build script:
# Interactive mode
./build.sh- non-interactive mode
./build.sh \
--flash NMBM \
--mtdparts "512k(u-boot),512k(u-boot-env),512k(factory),-(firmware)" \
--model "BOARD_NAME" \
--kernel-offset 0x180000 \
--reset-pin 7 \
--sysled-pin 13 \
--cpufreq 880 \
--ramfreq 1200 \
--ddrparam DDR3-256MiB \
--oldparam false \
--baudrate 115200 \
--yes
--wps-pinmarks the GPIO pin number of the WPS button, and it will be used to enter TFTP download mode, alse toggle the--sysled2-pinif set.
- build by board model name
In this method, it is very dangerous because the configs is not believed to be correct.
These cofigs in dir
configs-mt7621are generated by script automatically based on the information from the Internet, and they may be not correct for your board.
So please make sure the configs is correct before you run the command.
Otherwise it may cause your board to fail to boot, and you may need to re-flash u-boot via Flash-Programmer.
Take risk of bricking your board by yourself.
If you find the configs is wrong, please submit an issue or a pull request to fix it.
BOARD=board_name ./build.sh Flash Type
NOR Flash / NAND Flash / NAND Flash with NMBM support
MTD Partition Table
example: 192k(u-boot),64k(u-boot-env),64k(factory),-(firmware)
notice: u-boot and firmware partitions are essential
Kernel Load Address
equal to the sum of all partition size before firmware in hexadecimal
Reset Button GPIO
GPIO pin number of the reset button
notice: if not set, you can't press reset button to enter failsafe mode
System LED GPIO
GPIO pin number of the status LED
notice: if not set, status LED won't blink when you press reset button
CPU Frequency
default value is 880 (MHz).
notice: Overclock may cause the system to fail to boot or overheat.
DRAM Frequency
default 800 (MT/s) for DDR2 and 1200 (MT/s) for DDR3.
notice: if your board is unstable, try lowering it.
Prefered DDR Init Parameters
DRAM specific model or type and size
notice: DDR3-128MiB-KGD is for MT7621DAT (internal integrated 128MiB RAM)
Use Old DDR Timing Parameters
DDR Timing Parameters used in ralink U-Boot 1.1.3
notice: do not select it if your board is working properly
Baud Rate
TTL serial port baud rate, 57600 or 115200
-
Flash
u-boot-mt7621.bininto board. -
Set computer network subnet get method to DHCP
-
Remove the power supply, press and hold the reset button, plug in the
power supply. And then you can choose:a) Release the button after the status LED blinks at least 1 second
(blink 5 times), then you will enter into WebUI recovery mode. You can
open http://192.168.1.1 in the browser to upload firmware.b) Hold the button until the status LED no longer blinks (blink 3 seconds
in total), then you will enter into TFTP download mode. You can upload
initramfs kernel imagerecovery.binvia TFTP server such as tftpd64.
