Commit 17241ea0543a4c998f79bde27b8a6047c8d84d0a

Authored by Mans Rullgard
Committed by Tom Rini
1 parent 9243990b17

spl: mmc: Add option to set eMMC HW boot partition

This change allows setting pre-defined eMMC boot partition for SPL eMMC
booting. It is necessary in the case when one wants to boot (through falcon
boot) from eMMC after loading SPL from other memory (like SPI-NOR).

Signed-off-by: Mans Rullgard <mans@mansr.com>
[lukma: Edit the commit message]
Signed-off-by: Lukasz Majewski <lukma@denx.de>
Acked-by: Andreas Dannenberg <dannenberg@ti.com>

Showing 2 changed files with 10 additions and 0 deletions Side-by-side Diff

... ... @@ -325,6 +325,12 @@
325 325 Address on the MMC to load U-Boot from, when the MMC is being used
326 326 in raw mode. Units: MMC sectors (1 sector = 512 bytes).
327 327  
  328 +config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
  329 + int "Number of the eMMC boot partition to use"
  330 + default 1
  331 + help
  332 + eMMC boot partition number to use when the eMMC in raw mode.
  333 +
328 334 config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
329 335 bool "MMC Raw mode: by partition"
330 336 help
common/spl/spl_mmc.c
... ... @@ -355,6 +355,9 @@
355 355 err = -EINVAL;
356 356 switch (boot_mode) {
357 357 case MMCSD_MODE_EMMCBOOT:
  358 +#ifdef CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
  359 + part = CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION;
  360 +#else
358 361 /*
359 362 * We need to check what the partition is configured to.
360 363 * 1 and 2 match up to boot0 / boot1 and 7 is user data
... ... @@ -364,6 +367,7 @@
364 367  
365 368 if (part == 7)
366 369 part = 0;
  370 +#endif
367 371  
368 372 if (CONFIG_IS_ENABLED(MMC_TINY))
369 373 err = mmc_switch_part(mmc, part);