@@ -90,6 +90,14 @@ config ASPEED_UBOOT_MMC_BASE
The base block number of the U-Boot
image in the eMMC device
+config ASPEED_UBOOT_MMC_PART
+ int "U-Boot eMMC partition"
+ default 0
+ help
+ The partition number of the U-Boot
+ image in the eMMC device. This is not
+ the user data partition number.
+
config ASPEED_UBOOT_MMC_SIZE
hex "U-Boot eMMC size in blocks"
default 0x0
@@ -46,8 +46,8 @@ static int aspeed_spl_mmc_load_image(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
{
int err;
+ int part = CONFIG_ASPEED_UBOOT_MMC_PART;
u32 count;
-
struct mmc *mmc = NULL;
struct udevice *dev;
struct blk_desc *bd;
@@ -78,6 +78,13 @@ static int aspeed_spl_mmc_load_image(struct spl_image_info *spl_image,
bd = mmc_get_blk_desc(mmc);
+ if (part) {
+ if (CONFIG_IS_ENABLED(MMC_TINY))
+ err = mmc_switch_part(mmc, part);
+ else
+ err = blk_dselect_hwpart(bd, part);
+ }
+
count = blk_dread(bd, CONFIG_ASPEED_UBOOT_MMC_BASE, CONFIG_ASPEED_UBOOT_MMC_SIZE,
(void *)CONFIG_ASPEED_UBOOT_DRAM_BASE);
if (count != CONFIG_ASPEED_UBOOT_MMC_SIZE) {