aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosua Mayer <josua@solid-run.com>2023-10-25 10:22:54 +0200
committerStefan Roese <sr@denx.de>2023-10-26 14:49:36 +0200
commit3a80ec0a276bac604d8a38188139e9a557b85c79 (patch)
tree904481a216c479eeddfa02728ed744d1b32c65ed
parenta5539f976b9d5317ba893c6ba63afd9424498eeb (diff)
cmd: mvebu/bubt: move eMMC data-partition uboot from LBA-0 to 4096
A38x bootrom only searches 2 sectors when booting from eMMC, irregardless of data or boot partition: 0 & 4096. For eMMC boot partitions sector 0 is fine, but on data partition it conflicts with MBR. Change bubt command default to 4096 for eMMC data partition only, to allow using an MBR partition table on the eMMC data partition while also booting from it. Signed-off-by: Josua Mayer <josua@solid-run.com> Reviewed-by: Stefan Roese <sr@denx.de>
-rw-r--r--cmd/mvebu/bubt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c
index ca24a5c1c4..744b1c20aa 100644
--- a/cmd/mvebu/bubt.c
+++ b/cmd/mvebu/bubt.c
@@ -240,9 +240,16 @@ static int mmc_burn_image(size_t image_size)
#endif
/* SD reserves LBA-0 for MBR and boots from LBA-1,
- * MMC/eMMC boots from LBA-0
+ * MMC/eMMC boots from LBA-0 and LBA-4096
*/
- start_lba = IS_SD(mmc) ? 1 : 0;
+ if (IS_SD(mmc))
+ start_lba = 1;
+#ifdef CONFIG_SUPPORT_EMMC_BOOT
+ else if (part)
+ start_lba = 0;
+#endif
+ else
+ start_lba = 4096;
#ifdef CONFIG_BLK
blk_count = image_size / mmc->write_bl_len;
if (image_size % mmc->write_bl_len)