diff options
author | Ian Chang <ianchang@ieiworld.com> | 2021-09-02 17:47:20 +0800 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-10-14 13:09:57 +0100 |
commit | c43a5921fa7288ba183cc56da8f110a6ed0cd958 (patch) | |
tree | ed9ebb0239c59b5f636964c87d5688500e159e14 /target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh | |
parent | bb1eb5e8e6609d0a2f2c8d3123038bee410bdb0e (diff) | |
download | upstream-c43a5921fa7288ba183cc56da8f110a6ed0cd958.tar.gz upstream-c43a5921fa7288ba183cc56da8f110a6ed0cd958.tar.bz2 upstream-c43a5921fa7288ba183cc56da8f110a6ed0cd958.zip |
mvebu: add support for iEi Puzzle-M901/Puzzle-M902
Hardware specification
----------------------
* CN9130 SoC, Quad-core ARMv8 Cortex-72 @ 2200 MHz
* 4 GB DDR
* 4 GB eMMC
* mmcblk0
- mmcblk0p1 64M kernel_1
- mmcblk0p2 64M kernel_2
- mmcblk0p3 512M rootfs_1
- mmcblk0p4 512M rootfs_2
- mmcblk0p5 512M Reserved
- mmcblk0p6 64M Reserved
- mmcblk0p7 1.8G rootfs_data
* 4 MB (SPI Flash)
* 6 x 2.5 Gigabit ports (Puzzle-M901)
- External PHY with 6 ports (AQR112R)
* 6 x 2.5 Gigabit ports (Puzzle-M902)
- External PHY with 6 ports (AQR112R)
3 x 10 Gigabit ports (Puzzle-M902)
- External PHY with 3 ports (AQR113R)
* 4 x Front panel LED
* 1 x USB 3.0
* Reset button on Rear panel
* UART (115200 8N1,header on PCB)
Flash instructions:
The original firmware is based on OpenWrt.
Flash firmware using LuCI and CLI
Signed-off-by: Ian Chang <ianchang@ieiworld.com>
(cherry picked from commit 70c75965a97799b44871249c205bad48fea9a4ae)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh')
-rwxr-xr-x | target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh new file mode 100755 index 0000000000..5e5c356ed6 --- /dev/null +++ b/target/linux/mvebu/cortexa72/base-files/lib/upgrade/emmc-puzzle.sh @@ -0,0 +1,36 @@ +platform_do_upgrade_emmc() { + local board=$(board_name) + local diskdev partdev + + export_bootdevice && export_partdevice diskdev 0 || { + v "Unable to determine upgrade device" + return 1 + } + sync + if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then + get_partitions "/dev/$diskdev" bootdisk + v "Extract boot sector from the image" + get_image_dd "$1" of=/tmp/image.bs count=1 bs=512b + get_partitions /tmp/image.bs image + fi + + #iterate over each partition from the image and write it to the boot disk + while read part start size; do + if export_partdevice partdev $part; then + if [ "$partdev" = "mmcblk0p2" ]; then + v "Writing image mmcblk0p3 for /dev/$partdev $start $size" + get_image_dd "$1" of="/dev/mmcblk0p3" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + elif [ "$partdev" = "mmcblk0p1" ]; then + v "Writing image mmcblk0p1 for /dev/$partdev $start $size" + get_image_dd "$1" of="/dev/$partdev" ibs="512" obs=1M skip="$start" count="$size" conv=fsync + fi + else + v "Unable to find partition $part device, skipped." + fi + done < /tmp/partmap.image + + v "Writing new UUID to /dev/$diskdev..." + get_image_dd "$1" of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync + + sleep 1 +} |