From b123571c56a45ac52d2780302502ebf7ecdb3f19 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Fri, 31 Mar 2023 08:26:19 +0300 Subject: [PATCH] bdk: sdmmc: only allow power raise if SDR50 and up As per spec. --- bdk/storage/sdmmc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bdk/storage/sdmmc.c b/bdk/storage/sdmmc.c index b17c092..306527e 100644 --- a/bdk/storage/sdmmc.c +++ b/bdk/storage/sdmmc.c @@ -1070,9 +1070,6 @@ static int _sd_storage_enable_uhs_low_volt(sdmmc_storage_t *storage, u32 type, u u16 power_limit = buf[7] | buf[6] << 8; DPRINTF("[SD] access: %02X, power: %02X\n", access_mode, power_limit); - // Try to raise the power limit to let the card perform better. - _sd_storage_set_power_limit(storage, power_limit, buf); - u32 hs_type = 0; switch (type) { @@ -1132,6 +1129,10 @@ static int _sd_storage_enable_uhs_low_volt(sdmmc_storage_t *storage, u32 type, u return 1; } + // Try to raise the power limit to let the card perform better. + if (hs_type != UHS_SDR25_BUS_SPEED) + _sd_storage_set_power_limit(storage, power_limit, buf); + // Setup and set selected card and bus speed. if (!_sd_storage_set_card_bus_speed(storage, hs_type, buf)) return 0;