83 lines
1.8 KiB
Plaintext
Raw Normal View History

2017-09-06 19:19:45 +08:00
#
# Copyright (C) 2011-2012 OpenWrt.org
#
[ -e /etc/config/ubootenv ] && exit 0
touch /etc/config/ubootenv
. /lib/uboot-envtools.sh
. /lib/functions.sh
2018-01-15 18:26:41 +08:00
board=$(board_name)
2017-09-06 19:19:45 +08:00
case "$board" in
alfa-network,ac1200rm|\
alfa-network,awusfree1|\
2019-12-10 19:48:48 -08:00
alfa-network,quad-e4g|\
alfa-network,r36m-e4g|\
alfa-network,tube-e4g|\
huasifei,mt7621dtu)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
;;
allnet,all0256n-4m|\
allnet,all0256n-8m|\
allnet,all5002)
2017-09-06 19:19:45 +08:00
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x10000"
;;
ampedwireless,ally-00x19k|\
ampedwireless,ally-r1900k)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000" "4"
;;
ramips: Add support for Beeline SmartBox TURBO+ (#8161) * ramips: add support for Beeline(Sercomm) U-Boot - Add recipe for several Beeline/Sercomm devices (e.g., Beeline SmartBox GIGA, Beeline SmartBox Turbo+, Sercomm S3) that appends special header to a kernel. - Add device variables KERNEL_LOADADDR, LZMA_TEXT_START. It's also necessary for the devices mentioned above. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> (cherry picked from commit 6240da24f4c1442b0f750f06be512f630b0bc6c8) Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> * ramips: Add support for Beeline SmartBox TURBO+ This PR adds support for router Beeline Smart Box TURBO+. OEM/ODM Serсomm. Almost identical to Serсomm S3. Specification ------------- SoC Type: MediaTek MT7621AT (880 MHz, 2 cores) RAM (Nanya NT5CC64M16GP): 128 MiB Flash (Macronix MX30LF1G18AC): 128 MiB Wireless 2.4 GHz (MT7603EN): b/g/n, 2x2 Wireless 5 GHz (MT7615N): a/n/ac, 4x4 Ethernet: 5 ports - 5×GbE (WAN, LAN1-4) USB ports: 1xUSB3.0 Buttons: 2 button (reset, wps) LEDs: Red, Green, Blue Zigbee (EFR32MG1B232GG): 3.0 Stock bootloader: U-Boot 1.1.3 Power: 12 VDC, 1.5 A Installation ------------ Attach serial console, then boot the initramfs image via TFTP. Once inside OpenWrt, run sysupgrade -n with the sysupgrade file. Signed-off-by: Maximilian Weinmann <x1@disroot.org> (cherry picked from commit d1f294521bd8bc462c76e09c57a5c8b0600170cd) (factory recipe from a2cfe339995467308c9126c3d0f70d2a28aeb073) (big NAND from e6e5837a625ba09e286a5bde05f2ce581cfbeab7) (removed nvmem cells, fixed conflicts) Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> * ramips: add Sercomm partition map parser This adds an MTD partition parser for the Sercomm partition table that is used in some Netgear routers. This is essentially the same code as proposed in the pull request for Netgear R6350 support by NOGUCHI Hiroshi <drvlabo@gmail.com>: https://github.com/openwrt/openwrt/pull/1318 It was originally rejected as it did not seem to work correctly. However, this was only due the NAND driver transparently shifting pages to hide bad blocks, which was fixed in commit 527832e54bf3bc4d699a145ae66f34230246f0a9. Signed-off-by: Jan Hoffmann <jan@3e8.eu> [x1@disroot.org: correction from checkpatch.pl] Signed-off-by: Maximilian Weinmann <x1@disroot.org> (cherry picked from commit 65e772105f8d5e98a999b836fed794b7415f2741) Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> * ramips: Improve Beeline Smartbox Turbo+ support in lede Changed switch configuration and a few minor changes. Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com> Co-authored-by: Maximilian Weinmann <x1@disroot.org> Co-authored-by: Jan Hoffmann <jan@3e8.eu>
2021-11-03 07:16:32 +03:00
beeline,smartbox-giga|\
beeline,smartbox-turbo-plus)
ubootenv_add_uci_config "/dev/mtd0" "0x80000" "0x1000" "0x20000"
;;
buffalo,wsr-1166dhp|\
buffalo,wsr-600dhp|\
mediatek,linkit-smart-7688|\
samknows,whitebox-v8|\
xiaomi,mi-router-4c|\
xiaomi,miwifi-nano|\
zbtlink,zbt-wg2626|\
zte,mf283plus)
2017-09-06 19:19:45 +08:00
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x10000"
;;
ramips: add support for H3C TX180x series devices H3C TX180x series WiFi6 routers are customized by different carrier. While these three devices look different, they use the same motherboard inside. Another minor difference comes from the model name definition in the u-boot environment variable. Specifications: SOC: MT7621 + MT7915 ROM: 128 MiB RAM: 256 MiB LED: status *2 Button: reset *1 + wps/mesh *1 Ethernet: lan *3 + wan *1 (10/100/1000Mbps) TTL Baudrate: 115200 TFTP server IP: 192.168.124.99 Compatibility mode is used to guarantee the connection of old devices that only support WiFi4 or WiFi5. TFTP + TTL Installation: Although a TTL connection is required for installation, we do not need to tear down it. We can find the TTL port from the cooling hole at the bottom. It is located below LAN3 and the pins are defined as follows: |LAN1|LAN2|LAN3|----|WAN| -------------------- |GND|TX|RX|VCC| 1. Set tftp server IP to 192.168.124.99 and put initramfs firmware in server's root directory, rename it to a simple name "initramfs.bin". 2. Plug in the power supply and wait for power on, connect the TTL cable and open a TTL session, enter "reboot", then enter "Y" to confirm. Finally push "0" to interruput boot while booting. 3. Execute command to install a initramfs system: # tftp 0x80010000 192.168.124.99:initramfs.bin # bootm 0x80010000 4. Backup nand flash by OpenWrt LuCI or dd instruction. We need those partitions if we want to back to stock firmwre due to official website does not provide download link. # dd if=/dev/mtd1 of=/tmp/u-boot-env.bin # dd if=/dev/mtd4 of=/tmp/firmware.bin 5. Edit u-boot env to ensure use default bootargs and first image slot: # fw_setenv bootargs # fw_setenv bootflag 0 6. Upgrade sysupgrade firmware. 7. About restore stock firmware: flash the "firmware" and "u-boot-env" partitions that we backed up in step 4. # mtd write /tmp/u-boot-env.bin u-boot-env # mtd write /tmp/firmware.bin firmware Additional Info: The H3C stock firmware has a 160-byte firmware header that appears to use a non-standard CRC32 verification algorithm. For this part of the data, the u-boot does not check it so we can just directly replace it with a placeholder. Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2022-03-20 23:42:37 +08:00
h3c,tx1800-plus|\
h3c,tx1801-plus|\
h3c,tx1806|\
jcg,q20)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x20000" "0x20000"
;;
hootoo,ht-tm05|\
ravpower,rp-wd03)
idx="$(find_mtd_index u-boot-env)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x4000" "0x1000" "0x1000"
;;
linksys,ea7300-v1|\
linksys,ea7500-v2|\
linksys,ea8100-v1|\
xiaomi,mir3p|\
xiaomi,mir3g|\
xiaomi,mir4|\
xiaomi,miwifi-r3|\
xiaomi,mi-router-ac2100|\
xiaomi,redmi-router-ac2100)
2018-01-15 18:26:41 +08:00
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x20000"
;;
xiaomi,mi-router-cr660x)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
;;
zyxel,nr7101)
idx="$(find_mtd_index Config)"
[ -n "$idx" ] && \
ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x1000" "0x80000"
;;
2017-09-06 19:19:45 +08:00
esac
config_load ubootenv
config_foreach ubootenv_add_app_config ubootenv
exit 0