diff options
author | INAGAKI Hiroshi <musashino.open@gmail.com> | 2021-01-26 23:50:51 +0900 |
---|---|---|
committer | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2021-02-07 21:58:51 +0100 |
commit | 88fbddb49d7128ee565c65bcc1e72ae68c7c2635 (patch) | |
tree | d0fac1677ecbf9b5a4f7360d95c24c8045af006b /target/linux/ramips/mt7621/base-files/lib/upgrade | |
parent | 07f4e3b5b24fd742439a96530f5440bc24030de4 (diff) | |
download | upstream-88fbddb49d7128ee565c65bcc1e72ae68c7c2635.tar.gz upstream-88fbddb49d7128ee565c65bcc1e72ae68c7c2635.tar.bz2 upstream-88fbddb49d7128ee565c65bcc1e72ae68c7c2635.zip |
ramips: add support for I-O DATA WN-DX1200GR
I-O DATA WN-DX1200GR is a 2.4/5 GHz band 11ac (WiFi-5) router, based on
MT7621A.
Specification:
- SoC : MediaTek MT7621A
- RAM : DDR3 128 MiB
- Flash : raw NAND 128 MiB
- WLAN : 2.4/5 GHz 2T2R
- 2.4 GHz : MediaTek MT7603E
- 5 GHz : MediaTek MT7613BE
- Ethernet : 10/100/1000 Mbps x5
- Switch : MediaTek MT7530 (SoC)
- LEDs/keys : 2x/3x (2x buttons, 1x slide-switch)
- UART : through-hole on PCB
- J5: 3.3V, TX, RX, NC, GND from triangle-mark
- 57600n8
- Power : 12 VDC, 1 A
Flash instruction using initramfs image:
1. Boot WN-DX1200GR normally
2. Access to "http://192.168.0.1/" and open firmware update page
("ファームウェア")
3. Select the OpenWrt initramfs image and click update ("更新") button
to perform firmware update
4. On the initramfs image, perform sysupgrade with the
squashfs-sysupgrade image
5. Wait ~120 seconds to complete flashing
Notes:
- currently, mt7615e driver in mt76 doesn't fully support MT7613
(MT7663) wifi chip
- the eeprom data in flash is not used by mt7615e driver and the
driver reports the tx-power up to 3dBm
- the correct MAC address for MT7613BE in eeprom data cannot be
assigned to the phy
- last 0x80000 (512 KiB) in NAND flash is not used on stock firmware
- stock firmware requires "customized uImage header" (called as "combo
image") by MSTC (MitraStar Technology Corp.), but U-Boot doesn't
- uImage magic ( 0x0 - 0x3 ) : 0x434F4D43 ("COMC")
- header crc32 ( 0x4 - 0x7 ) : with "data length" and "data crc32"
- image name (0x20 - 0x37) : model ID and firmware versions
- data length (0x38 - 0x3b) : kernel + rootfs
- data crc32 (0x3c - 0x3f) : kernel + rootfs
MAC addresses:
LAN: 50:41:B9:xx:xx:08 (Ubootenv, ethaddr (text) / Factory, 0x1E000 (hex))
WAN: 50:41:B9:xx:xx:0A (Factory, 0x1E006 (hex))
2.4GHz: 50:41:B9:xx:xx:08 (Factory, 0x4 (hex))
5GHz: 50:41:B9:xx:xx:09 (Factory, 0x8004 (hex))
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[add check whether dflag_offset is set]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ramips/mt7621/base-files/lib/upgrade')
-rw-r--r-- | target/linux/ramips/mt7621/base-files/lib/upgrade/iodata.sh | 15 | ||||
-rwxr-xr-x | target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh | 6 |
2 files changed, 17 insertions, 4 deletions
diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/iodata.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/iodata.sh index d7a3477f0a..071a132e02 100644 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/iodata.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/iodata.sh @@ -16,9 +16,18 @@ iodata_mstc_prepare_fail() { # use 1st image in OpenWrt # - debugflag: enable/disable debug # users can interrupt Z-Loader for recovering the device if enabled +# +# parameters: +# - $1: the offset of "debugflag" iodata_mstc_upgrade_prepare() { local persist_mtd="$(find_mtd_part persist)" local factory_mtd="$(find_mtd_part factory)" + local dflag_offset="$1" + + if [ -z "$dflag_offset" ]; then + echo 'no debugflag offset provided' + iodata_mstc_prepare_fail + fi if [ -z "$persist_mtd" -o -z "$factory_mtd" ]; then echo 'cannot find mtd partition(s), "factory" or "persist"' @@ -26,14 +35,14 @@ iodata_mstc_upgrade_prepare() { fi local bootnum=$(hexdump -s 4 -n 1 -e '"%x"' ${persist_mtd}) - local debugflag=$(hexdump -s 65141 -n 1 -e '"%x"' ${factory_mtd}) + local debugflag=$(hexdump -s $((dflag_offset)) -n 1 -e '"%x"' ${factory_mtd}) if [ "$bootnum" != "1" -a "$bootnum" != "2" ]; then echo "failed to get bootnum, please check the value at 0x4 in ${persist_mtd}" iodata_mstc_prepare_fail fi if [ "$debugflag" != "0" -a "$debugflag" != "1" ]; then - echo "failed to get debugflag, please check the value at 0xFE75 in ${factory_mtd}" + echo "failed to get debugflag, please check the value at ${dflag_offset} in ${factory_mtd}" iodata_mstc_prepare_fail fi echo "current: bootnum => ${bootnum}, debugflag => ${debugflag}" @@ -46,7 +55,7 @@ iodata_mstc_upgrade_prepare() { echo "### switch to 1st os-image on next boot ###" fi if [ "$debugflag" = "0" ]; then - if ! (echo -ne "\x01" | dd bs=1 count=1 seek=65141 conv=notrunc of=${factory_mtd} 2>/dev/null); then + if ! (echo -ne "\x01" | dd bs=1 count=1 seek=$((dflag_offset)) conv=notrunc of=${factory_mtd} 2>/dev/null); then echo "failed to set debugflag" iodata_mstc_prepare_fail fi diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh index 5bb0386253..c9152c5cf4 100755 --- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh +++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh @@ -71,7 +71,11 @@ platform_do_upgrade() { iodata,wn-ax1167gr2|\ iodata,wn-ax2033gr|\ iodata,wn-dx1167r) - iodata_mstc_upgrade_prepare + iodata_mstc_upgrade_prepare "0xfe75" + nand_do_upgrade "$1" + ;; + iodata,wn-dx1200gr) + iodata_mstc_upgrade_prepare "0x1fe75" nand_do_upgrade "$1" ;; ubnt,edgerouter-x|\ |