From 3f4e0b4912d51b6449ed76bde54f2d99c9bb2af9 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Sun, 15 Nov 2020 13:31:01 -0800 Subject: [PATCH] exo: read first two sd card sectors in mariko_fatal --- libvapours/source/dd/dd_io_mapping.cpp | 6 ++++++ .../sdmmc/impl/sdmmc_sd_host_standard_controller.cpp | 8 +------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libvapours/source/dd/dd_io_mapping.cpp b/libvapours/source/dd/dd_io_mapping.cpp index 966de2fb..581d479c 100644 --- a/libvapours/source/dd/dd_io_mapping.cpp +++ b/libvapours/source/dd/dd_io_mapping.cpp @@ -37,6 +37,12 @@ namespace ams::dd { return secmon::MemoryRegionVirtualDeviceApbMisc.GetAddress() + phys_addr - secmon::MemoryRegionPhysicalDeviceApbMisc.GetAddress(); } else if (secmon::MemoryRegionPhysicalDeviceSdmmc.Contains(phys_addr, size)) { return secmon::MemoryRegionVirtualDeviceSdmmc.GetAddress() + phys_addr - secmon::MemoryRegionPhysicalDeviceSdmmc.GetAddress(); + } else if (secmon::MemoryRegionPhysicalDevicePmc.Contains(phys_addr, size)) { + return secmon::MemoryRegionVirtualDevicePmc.GetAddress() + phys_addr - secmon::MemoryRegionPhysicalDevicePmc.GetAddress(); + } else if (secmon::MemoryRegionPhysicalDeviceI2c5.Contains(phys_addr, size)) { + return secmon::MemoryRegionVirtualDeviceI2c5.GetAddress() + phys_addr - secmon::MemoryRegionPhysicalDeviceI2c5.GetAddress(); + } else if (secmon::MemoryRegionPhysicalDeviceI2c1.Contains(phys_addr, size)) { + return secmon::MemoryRegionVirtualDeviceI2c1.GetAddress() + phys_addr - secmon::MemoryRegionPhysicalDeviceI2c1.GetAddress(); } else { AMS_UNUSED(size); return static_cast(phys_addr); diff --git a/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp b/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp index 5cb9af01..f03d1539 100644 --- a/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp +++ b/libvapours/source/sdmmc/impl/sdmmc_sd_host_standard_controller.cpp @@ -747,13 +747,7 @@ namespace ams::sdmmc::impl { SdHostStandardController::SdHostStandardController(dd::PhysicalAddress registers_phys_addr, size_t registers_size) { /* Translate the physical address to a address. */ - #if defined(ATMOSPHERE_IS_STRATOSPHERE) - const uintptr_t registers_addr = dd::QueryIoMapping(registers_phys_addr, registers_size); - #else - /* TODO: Discriminate between bpmp, exosphere address? */ - AMS_UNUSED(registers_size); - const uintptr_t registers_addr = static_cast(registers_phys_addr); - #endif + const uintptr_t registers_addr = dd::QueryIoMapping(registers_phys_addr, registers_size); /* Set registers. */ AMS_ABORT_UNLESS(registers_addr != 0);