* Stratosphere: Use modern C++ idioms in some places
* algorithms like std::for_each are used instead of raw loops
* Stratosphere: Replace more raw loops with algorithms
* Stratosphere: Add a utility predicate function to test for equality with a reference element
This can be used to rewrite some common raw loops using algorithms instead
* fs.mitm: Use variant
* fs.mitm: Use enum class
* fs.mitm: Turn RomFSSourceInfo::Cleanup into a destructor
This obsoletes the need for a custom deleter in other places
* fs.mitm: Use enum class some more
* fs.mitm: Use unique_ptr
* fs.mitm: Simplify initialization
* Stratosphere: Simplify initialization
* fs.mitm: Use unique_ptr (fix memory leak along the way)
The previous code was using "delete" rather than "delete[]"
* fs.mitm: Use vector::emplace_back rather than push_back
emplace_back constructs elements in-place, hence avoiding a redundant element copy.
* Stratosphere: Replace more raw loops with algorithms
* Stratosphere: Use unique_ptr
* fs.mitm: Replace more raw loops with algorithms
* Stratosphere: Prefer move-construction over copy-construction when moving sink parameters around
Use 204 MHz as host clock in SDR104 mode instead of 136 MHz.
Due to this, also change the frequency init divider so the
initialization frequency is below 400 kHz.
This makes the clocks for SDMMC1 in all modes to match the TRM table.
Make it clear in the code that HS200/HS400 modes in fact use PLLP_OUT0
and not PLLC4_OUT2_LJ like the comment suggest. In fact selecting the
PLLC4_OUT2_LJ as clock source results in freeze after switching to
HS200/HS400 mode. This is most likely related to the PLLC4 not being
enabled, but it should be checked later.
Set the HS200/HS400 divider to 3, as this is what the code really did
set prior to this change - so this commit does not change that.
Configure Legacy 12 MHz clock to run at 12 MHz using the SW default
configuration (as per TRM) for the SDMMC legacy timer.
Introduce initial version of sdmmc_host_clock_delay() in order to use it
in places where the wait is host clock dependent. The way it is
implemented now does not change the sleep that was used instead.
Properly configure pull up and pull down offsets for autocal.
Run autocal prior to every transfer.
Prevent race conditions in sdmmc_wait_for_event() - make sure the fault
handler has highest priority, then the target irq, state conditions and
finally the error mask.
Do not clear all bits (|=) when acknowledging fault conditions,
only acknowledge the fault conditions itself.
Enable interrupts before preparing command registers - if sdmmc is fast
enough it can actually finish transfer before we enabled the interrupts.
Enabling interrupts clears the COMMAND COMPLETE status bit.
Temporarily print all the sdmmc messages in stage2 - for yet unknown
reason respecting the log level results in some failures.
This results in working microsd card in stage2 on my switch with Samsung
EVO+ 256GB microsd card.