diff options
author | Oskari Lemmela <oskari@lemmela.net> | 2021-04-10 20:16:08 +0300 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-04-11 20:19:44 +0100 |
commit | 3c23a7c03dc9821d25f3fd2a8ab17a4c460c3584 (patch) | |
tree | c160c7a241ebb5f5fb9f1c21f78a86dc798667f6 /target/linux/mediatek/mt7622/base-files | |
parent | 987562bad2d8d48297829070bfdbaf0a0a423a27 (diff) | |
download | upstream-3c23a7c03dc9821d25f3fd2a8ab17a4c460c3584.tar.gz upstream-3c23a7c03dc9821d25f3fd2a8ab17a4c460c3584.tar.bz2 upstream-3c23a7c03dc9821d25f3fd2a8ab17a4c460c3584.zip |
mediatek: mt7622: add spi-nand support for bananapi bpi-r64
Some of bpi-r64 boards have serial NAND attached to SPI bus.
Add SD card image support for installing openwrt to it.
Default to nand upgrade if root device is not mmc block device.
Separate preloader and uboot images for snand are generated.
Signed-off-by: Oskari Lemmela <oskari@lemmela.net>
Diffstat (limited to 'target/linux/mediatek/mt7622/base-files')
-rwxr-xr-x | target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh index 2c1460650f..cdae06e630 100755 --- a/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh +++ b/target/linux/mediatek/mt7622/base-files/lib/upgrade/platform.sh @@ -10,16 +10,24 @@ platform_do_upgrade() { bananapi,bpi-r64) export_bootdevice export_partdevice rootdev 0 - local fitpart=$(get_partition_by_name $rootdev "production") - [ "$fitpart" ] || return 1 - dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null - blockdev --rereadpt /dev/$rootdev - get_image "$1" | dd of=/dev/$fitpart - blockdev --rereadpt /dev/$rootdev - local datapart=$(get_partition_by_name $rootdev "rootfs_data") - [ "$datapart" ] || return 0 - dd if=/dev/zero of=/dev/$datapart bs=4096 count=1 2>/dev/null - echo $datapart > /tmp/sysupgrade.datapart + case "$rootdev" in + mmc*) + local fitpart=$(get_partition_by_name $rootdev "production") + [ "$fitpart" ] || return 1 + dd if=/dev/zero of=/dev/$fitpart bs=4096 count=1 2>/dev/null + blockdev --rereadpt /dev/$rootdev + get_image "$1" | dd of=/dev/$fitpart + blockdev --rereadpt /dev/$rootdev + local datapart=$(get_partition_by_name $rootdev "rootfs_data") + [ "$datapart" ] || return 0 + dd if=/dev/zero of=/dev/$datapart bs=4096 count=1 2>/dev/null + echo $datapart > /tmp/sysupgrade.datapart + ;; + *) + CI_KERNPART="fit" + nand_do_upgrade "$1" + ;; + esac ;; buffalo,wsr-2533dhp2) local magic="$(get_magic_long "$1")" @@ -87,7 +95,11 @@ platform_copy_config_mmc() { platform_copy_config() { case "$(board_name)" in bananapi,bpi-r64) - platform_copy_config_mmc + export_bootdevice + export_partdevice rootdev 0 + if echo $rootdev | grep -q mmc; then + platform_copy_config_mmc + fi ;; esac } |