sdmmc: Add T210B01 support

The driver was working before this, but adding the changes provides a proper and better sdmmc controller inner state.
This commit is contained in:
CTCaer
2020-12-02 02:07:15 +02:00
parent 8e45fcc069
commit c13eabcde8
4 changed files with 219 additions and 69 deletions

View File

@@ -1205,9 +1205,10 @@ static bool _sdmmc_storage_get_low_voltage_support(u32 bus_width, u32 type)
void sdmmc_storage_init_wait_sd()
{
// T210/T210B01 WAR: Wait exactly 239ms for IO and Controller power to discharge.
u32 sd_poweroff_time = (u32)get_tmr_ms() - sd_power_cycle_time_start;
if (sd_poweroff_time < 100)
msleep(100 - sd_poweroff_time);
if (sd_poweroff_time < 239)
msleep(239 - sd_poweroff_time);
}
int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 bus_width, u32 type)