Add dram id functions
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,5 +37,7 @@ namespace board {
|
||||
void Exit();
|
||||
SysClkSocType GetSocType();
|
||||
HorizonOCConsoleType GetConsoleType();
|
||||
u8 GetDramID();
|
||||
bool isIsDram8GB();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user