Skip to content

Yuzhii0718/uboot-mt7621-dhcpd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

124 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediaTek MT7621 U-Boot with Failsafe Mode

Warnign: Flashing custom bootloaders can brick your device. Proceed with caution and at your own risk.

Web Recovery Page

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.

Online Build

  1. Fork This Repository.

  2. Click Actions then choose Build customized u-boot.

  3. Click Run workflow and set board specific parameters.

  4. U-Boot image will be uploaded to Artifacts.

Local Build

  • 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

Other methods

  • 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-pin marks the GPIO pin number of the WPS button, and it will be used to enter TFTP download mode, alse toggle the --sysled2-pin if 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-mt7621 are 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 

Board Parameters

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

Usage

  1. Flash u-boot-mt7621.bin into board.

  2. Set computer network subnet get method to DHCP

  3. 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 image recovery.bin via TFTP server such as tftpd64.

About

MTK U-Boot (MT7621) v2018.09 Build Customized u-boot Online, costumed WEB UI, support for dhcpd and i18n(English and simplified Chinese)

Resources

Stars

18 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • C 94.9%
  • Python 1.7%
  • Assembly 1.5%
  • Makefile 0.7%
  • Perl 0.6%
  • Shell 0.2%
  • Other 0.4%