mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-20 01:45:07 -04:00
fusee_cpp: implement inline storage of EmcDvfsTimingTables
This commit is contained in:
parent
3bcdd0c3c8
commit
d2f3b806d6
12 changed files with 3705 additions and 753 deletions
|
@ -14,10 +14,46 @@
|
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include <exosphere.hpp>
|
||||
#include "../fusee_fatal.hpp"
|
||||
#include "fusee_mtc.hpp"
|
||||
#include "fusee_mtc_timing_table_erista.hpp"
|
||||
|
||||
namespace ams::nxboot {
|
||||
|
||||
namespace {
|
||||
|
||||
#include "fusee_mtc_tables_erista.inc"
|
||||
|
||||
using EmcDvfsTimingTable = erista::EmcDvfsTimingTable;
|
||||
|
||||
EmcDvfsTimingTable *GetEmcDvfsTimingTables() {
|
||||
const auto index = GetMemoryTrainingTableIndex();
|
||||
switch (index) {
|
||||
case 0:
|
||||
case 3:
|
||||
return reinterpret_cast<EmcDvfsTimingTable *>(T210SdevEmcDvfsTableS4gb01);
|
||||
case 1:
|
||||
return reinterpret_cast<EmcDvfsTimingTable *>(T210SdevEmcDvfsTableS6gb01);
|
||||
case 2:
|
||||
return reinterpret_cast<EmcDvfsTimingTable *>(T210SdevEmcDvfsTableH4gb01);
|
||||
default:
|
||||
ShowFatalError("Unknown EmcDvfsTimingTableIndex: %d\n", index);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DoMemoryTrainingErista() {
|
||||
/* Get timing tables. */
|
||||
auto *timing_tables = GetEmcDvfsTimingTables();
|
||||
auto *src_timing_tables = timing_tables + 0;
|
||||
auto *dst_timing_tables = timing_tables + 1;
|
||||
|
||||
/* Check timing tables. */
|
||||
if (src_timing_tables->rate_khz != 204000 || dst_timing_tables->rate_khz != 1600000) {
|
||||
ShowFatalError("EmcDvfsTimingTables seem corrupted %" PRIu32 " %" PRIu32 "?\n", src_timing_tables->rate_khz, dst_timing_tables->rate_khz);
|
||||
}
|
||||
|
||||
/* TODO */
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue