1
0
Fork 0
mirror of https://github.com/CTCaer/hekate.git synced 2024-11-26 11:42:09 +00:00

bdk: emmc: utilize emmc_end

This commit is contained in:
CTCaer 2022-10-11 04:12:04 +03:00
parent 8bbe403e41
commit 07695196cb
2 changed files with 14 additions and 11 deletions

View file

@ -61,6 +61,8 @@ u32 emmc_get_mode()
return emmc_mode; return emmc_mode;
} }
void emmc_end() { sdmmc_storage_end(&emmc_storage); }
int emmc_init_retry(bool power_cycle) int emmc_init_retry(bool power_cycle)
{ {
u32 bus_width = SDMMC_BUS_WIDTH_8; u32 bus_width = SDMMC_BUS_WIDTH_8;
@ -70,7 +72,7 @@ int emmc_init_retry(bool power_cycle)
if (power_cycle) if (power_cycle)
{ {
emmc_mode--; emmc_mode--;
sdmmc_storage_end(&emmc_storage); emmc_end();
} }
// Get init parameters. // Get init parameters.
@ -105,7 +107,7 @@ bool emmc_initialize(bool power_cycle)
emmc_mode = EMMC_MMC_HS400; emmc_mode = EMMC_MMC_HS400;
if (power_cycle) if (power_cycle)
sdmmc_storage_end(&emmc_storage); emmc_end();
int res = !emmc_init_retry(false); int res = !emmc_init_retry(false);
@ -124,7 +126,7 @@ bool emmc_initialize(bool power_cycle)
} }
} }
sdmmc_storage_end(&emmc_storage); emmc_end();
return false; return false;
} }

View file

@ -63,6 +63,7 @@ u16 *emmc_get_error_count();
u32 emmc_get_mode(); u32 emmc_get_mode();
int emmc_init_retry(bool power_cycle); int emmc_init_retry(bool power_cycle);
bool emmc_initialize(bool power_cycle); bool emmc_initialize(bool power_cycle);
void emmc_end();
void emmc_gpt_parse(link_t *gpt); void emmc_gpt_parse(link_t *gpt);
void emmc_gpt_free(link_t *gpt); void emmc_gpt_free(link_t *gpt);