fusee: work around some dual-init SDMMC issues

This commit is contained in:
Kate J. Temkin committed 2018-05-23 07:47:02 -06:00
1 parent ef9adabb40
commit eaf8e559d6
3 files changed
+44 -16

No files matched your search

+8 -1
View File
@@ -15,6 +15,13 @@
static bool g_ahb_redirect_enabled = false;
// Only use voltage switching in stage2 and later.
#ifdef FUSEE_STAGE1_SRC
#define MMC_VOLTAGE_SWITCHING_ALLOWED false
#else
#define MMC_VOLTAGE_SWITCHING_ALLOWED true
#endif
/* Global sd struct. */
static struct mmc g_sd_mmc = {0};
static bool g_sd_initialized = false;
@@ -26,7 +33,7 @@ int initialize_sd_mmc(void) {
}
if (!g_sd_initialized) {
int rc = sdmmc_init(&g_sd_mmc, SWITCH_MICROSD);
int rc = sdmmc_init(&g_sd_mmc, SWITCH_MICROSD, MMC_VOLTAGE_SWITCHING_ALLOWED);
if (rc == 0) {
g_sd_initialized = true;
return 0;