mmc: core: Fix init of SD cards reporting an invalid VDD range

The OCR register defines the supported range of VDD voltages for SD cards.
However, it has turned out that some SD cards reports an invalid voltage
range, for example having bit7 set.

When a host supports MMC_CAP2_FULL_PWR_CYCLE and some of the voltages from
the invalid VDD range, this triggers the core to run a power cycle of the
card to try to initialize it at the lowest common supported voltage.
Obviously this fails, since the card can't support it.

Let's fix this problem, by clearing invalid bits from the read OCR register
for SD cards, before proceeding with the VDD voltage negotiation.

Reported-by: Philip Langdale <>
Signed-off-by: Ulf Hansson <>
Reviewed-by: Philip Langdale <>
Tested-by: Philip Langdale <>
Tested-by: Manuel Presnitz <>
1 file changed