mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 19:31:12 +00:00
bdk: sdmmc: allow max power limit to be set
Even if it defaults to 1.44W. Some cards' firmware maybe be bugged. The 3.3V regulator on all SKUs allow more than 800mA current anyway.
This commit is contained in:
parent
25be98b7e3
commit
b7164a629f
1 changed files with 16 additions and 25 deletions
|
@ -999,25 +999,17 @@ static void _sd_storage_set_power_limit(sdmmc_storage_t *storage, u16 power_limi
|
||||||
u32 pwr = SD_SET_POWER_LIMIT_0_72;
|
u32 pwr = SD_SET_POWER_LIMIT_0_72;
|
||||||
|
|
||||||
// If UHS-I only, anything above 1.44W defaults to 1.44W.
|
// If UHS-I only, anything above 1.44W defaults to 1.44W.
|
||||||
#if SDMMC_UHS2_SUPPORT
|
|
||||||
if (power_limit & SD_MAX_POWER_2_88)
|
if (power_limit & SD_MAX_POWER_2_88)
|
||||||
pwr = SD_SET_POWER_LIMIT_2_88;
|
pwr = SD_SET_POWER_LIMIT_2_88;
|
||||||
else if (power_limit & SD_MAX_POWER_2_16)
|
else if (power_limit & SD_MAX_POWER_2_16)
|
||||||
pwr = SD_SET_POWER_LIMIT_2_16;
|
pwr = SD_SET_POWER_LIMIT_2_16;
|
||||||
else if (power_limit & SD_MAX_POWER_1_44)
|
else if (power_limit & SD_MAX_POWER_1_44)
|
||||||
pwr = SD_SET_POWER_LIMIT_1_44;
|
pwr = SD_SET_POWER_LIMIT_1_44;
|
||||||
#else
|
|
||||||
if (power_limit & SD_MAX_POWER_1_44)
|
|
||||||
pwr = SD_SET_POWER_LIMIT_1_44;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_sd_storage_switch(storage, buf, SD_SWITCH_SET, SD_SWITCH_GRP_PWRLIM, pwr);
|
_sd_storage_switch(storage, buf, SD_SWITCH_SET, SD_SWITCH_GRP_PWRLIM, pwr);
|
||||||
|
|
||||||
if (((buf[15] >> 4) & 0x0F) == pwr)
|
switch ((buf[15] >> 4) & 0x0F)
|
||||||
{
|
{
|
||||||
switch (pwr)
|
|
||||||
{
|
|
||||||
#if SDMMC_UHS2_SUPPORT
|
|
||||||
case SD_SET_POWER_LIMIT_2_88:
|
case SD_SET_POWER_LIMIT_2_88:
|
||||||
DPRINTF("[SD] power limit raised to 2880 mW\n");
|
DPRINTF("[SD] power limit raised to 2880 mW\n");
|
||||||
break;
|
break;
|
||||||
|
@ -1025,7 +1017,7 @@ DPRINTF("[SD] power limit raised to 2880 mW\n");
|
||||||
case SD_SET_POWER_LIMIT_2_16:
|
case SD_SET_POWER_LIMIT_2_16:
|
||||||
DPRINTF("[SD] power limit raised to 2160 mW\n");
|
DPRINTF("[SD] power limit raised to 2160 mW\n");
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case SD_SET_POWER_LIMIT_1_44:
|
case SD_SET_POWER_LIMIT_1_44:
|
||||||
DPRINTF("[SD] power limit raised to 1440 mW\n");
|
DPRINTF("[SD] power limit raised to 1440 mW\n");
|
||||||
break;
|
break;
|
||||||
|
@ -1036,7 +1028,6 @@ DPRINTF("[SD] power limit defaulted to 720 mW\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static int _sd_storage_set_card_bus_speed(sdmmc_storage_t *storage, u32 hs_type, u8 *buf)
|
static int _sd_storage_set_card_bus_speed(sdmmc_storage_t *storage, u32 hs_type, u8 *buf)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue