Commit 32ded5022e5606fe1a1220ed5ea3e2f935da0fce

Authored by Anatolij Gustschin
Committed by Tom Rini
1 parent 4b5c4dd93a

spl: mmc: make eMMC HW boot partition configuration optional

Loading U-Boot on i.MX8QXP MEK board is broken since recent changes
in spl_mmc:

  U-Boot SPL 2019.10-00162-gff5bd397e4 (Oct 18 2019 - 15:50:45 +0200)
  Normal Boot
  WDT:   Not found!
  Trying to boot from MMC2_2
  Load image from MMC/SD 0x46400
  spl: mmc partition switch failed
  SPL: failed to boot from all boot devices
  ### ERROR ### Please RESET the board ###

The newly added CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION option
is selected automatically and overrides the EXT_CSC_PART_CONFIG
configurations with default value, always selecting the eMMC boot
partition 1. Boards which place U-Boot image in other partitions
became not bootable.

Fix this by making the eMMC HW boot partition selection optional.

Fixes: 17241ea0543a (spl: mmc: Add option to set eMMC HW boot partition)
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Anatolij Gustschin <agust@denx.de>

Showing 1 changed file with 22 additions and 6 deletions Side-by-side Diff

... ... @@ -325,12 +325,6 @@
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   -
334 328 config SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION
335 329 bool "MMC Raw mode: by partition"
336 330 help
... ... @@ -358,6 +352,28 @@
358 352 help
359 353 Partition Type on the MMC to load U-Boot from, when the MMC is being
360 354 used in raw mode.
  355 +
  356 +config SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG
  357 + bool "Override eMMC EXT_CSC_PART_CONFIG by user defined partition"
  358 + depends on SUPPORT_EMMC_BOOT
  359 + help
  360 + eMMC boot partition is normally configured by the bits of the EXT_CSD
  361 + register (EXT_CSC_PART_CONFIG), BOOT_PARTITION_ENABLE field. In some
  362 + cases it might be required in SPL to load the image from different
  363 + partition than the partition selected by EXT_CSC_PART_CONFIG register.
  364 + Enable this option if you intend to use an eMMC boot partition other
  365 + then selected via EXT_CSC_PART_CONFIG register and specify the custom
  366 + partition number by the CONFIG_SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
  367 + option.
  368 +
  369 +config SYS_MMCSD_RAW_MODE_EMMC_BOOT_PARTITION
  370 + int "Number of the eMMC boot partition to use"
  371 + depends on SUPPORT_EMMC_BOOT_OVERRIDE_PART_CONFIG
  372 + default 1
  373 + help
  374 + eMMC boot partition number to use when the eMMC in raw mode and
  375 + the eMMC EXT_CSC_PART_CONFIG selection should be overridden in SPL
  376 + by user defined partition number.
361 377  
362 378 config SPL_CRC32_SUPPORT
363 379 bool "Support CRC32"