Add dram id functions

This commit is contained in:
Lightos1
2026-03-20 21:08:55 +01:00
parent 308f39694c
commit 130f9101a2
2 changed files with 21 additions and 0 deletions

View File

@@ -28,6 +28,7 @@
#include <sysclk.h>
#include <switch.h>
#include <pwm.h>
#include <registers.h>
#include "board.hpp"
#include "board_fuse.hpp"
@@ -193,4 +194,22 @@ namespace board {
return gConsoleType;
}
u8 GetDramID() {
return dramID;
}
bool IsDram8GB() {
SecmonArgs args = {};
args.X[0] = 0xF0000002;
args.X[1] = MC_REGISTER_BASE + MC_EMEM_CFG_0;
svcCallSecureMonitor(&args);
if (args.X[1] == (MC_REGISTER_BASE + MC_EMEM_CFG_0)) { // if param 1 is identical read failed
writeNotification("Horizon OC\nSecmon read failed!\n This may be a hardware issue!");
return false;
}
return args.X[1] == 0x00002000 ? true : false;
}
}

View File

@@ -37,5 +37,7 @@ namespace board {
void Exit();
SysClkSocType GetSocType();
HorizonOCConsoleType GetConsoleType();
u8 GetDramID();
bool isIsDram8GB();
}