From: Leo Yan Date: Fri, 25 Oct 2024 17:18:19 +0000 (+0100) Subject: arm: total_compute: Dynamically detect block device X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=26be18f7bcd4c40e27819947d4ca7d2d6e395327;p=u-boot.git arm: total_compute: Dynamically detect block device Dynamically detect block device in the boot command, this allows to support both MMC and virtio block devices. Signed-off-by: Leo Yan --- diff --git a/board/armltd/total_compute/total_compute.env b/board/armltd/total_compute/total_compute.env index 9dd50819ea..93460aa5dc 100644 --- a/board/armltd/total_compute/total_compute.env +++ b/board/armltd/total_compute/total_compute.env @@ -4,21 +4,28 @@ load_addr=0xa0000000 initrd_addr_r=0x88000000 bootcmd= - if part number mmc 0 vbmeta is_avb; then - echo 'MMC with vbmeta partition detected.'; + virtio scan; + if virtio info; then + blk_dev=virtio; + else; + blk_dev=mmc; + fi; + echo block device is ${blk_dev}; + if part number ${blk_dev} 0 vbmeta is_avb; then + echo '${blk_dev} with vbmeta partition detected.'; echo 'Starting Android Verified boot...'; - avb init mmc 0; + avb init ${blk_dev} 0; if avb verify; then set bootargs $bootargs $avb_bootargs; - part start mmc 0 boot boot_start; - part size mmc 0 boot boot_size; - mmc read ${load_addr} ${boot_start} ${boot_size}; + part start ${blk_dev} 0 boot boot_start; + part size ${blk_dev} 0 boot boot_size; + ${blk_dev} read ${load_addr} ${boot_start} ${boot_size}; bootm ${load_addr} ${load_addr} ${fdt_addr_r}; else; echo 'AVB verification failed.'; exit; fi; - elif part number mmc 0 system is_non_avb_android; then + elif part number ${blk_dev} 0 system is_non_avb_android; then echo 'Booting Android non-AVB...'; booti ${kernel_addr_r} ${initrd_addr_r} ${fdt_addr_r}; elif iminfo ${load_addr}; then