sdmmc: fix bug in WaitWhileCommandInhibit, add mmc accessors

This commit is contained in:
Michael Scire
2020-10-25 21:09:58 -07:00
parent 37704d670b
commit a0f1971353
4 changed files with 83 additions and 6 deletions

View File

@@ -32,4 +32,12 @@ namespace ams::sdmmc::impl {
return std::addressof(g_mmc0_host_controller);
}
IDeviceAccessor *GetDeviceAccessorOfPortMmc0() {
return std::addressof(g_mmc0_device_accessor);
}
MmcDeviceAccessor *GetMmcDeviceAccessorOfPortMmc0() {
return std::addressof(g_mmc0_device_accessor);
}
}

View File

@@ -355,7 +355,7 @@ namespace ams::sdmmc::impl {
R_TRY(this->CheckRemoved());
/* Check if command inhibit is no longer present. */
if (reg::HasValue(this->registers->present_state, SD_REG_BITS_ENUM(PRESENT_STATE_COMMAND_INHIBIT_CMD, NOT_READY))) {
if (reg::HasValue(this->registers->present_state, SD_REG_BITS_ENUM(PRESENT_STATE_COMMAND_INHIBIT_CMD, READY))) {
break;
}
@@ -375,7 +375,7 @@ namespace ams::sdmmc::impl {
R_TRY(this->CheckRemoved());
/* Check if command inhibit is no longer present. */
if (reg::HasValue(this->registers->present_state, SD_REG_BITS_ENUM(PRESENT_STATE_COMMAND_INHIBIT_DAT, NOT_READY))) {
if (reg::HasValue(this->registers->present_state, SD_REG_BITS_ENUM(PRESENT_STATE_COMMAND_INHIBIT_DAT, READY))) {
break;
}