ldr: fix formating
This commit is contained in:
@@ -44,11 +44,11 @@ namespace ams::ldr::hoc::pcv {
|
||||
constexpr u32 uv_min = 600'000;
|
||||
|
||||
auto validator = [](regulator *entry) {
|
||||
R_UNLESS(entry->id == 1, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type == 1, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type_1.volt_reg == 0x17, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type_1.step_uv == uv_step, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type_1.min_uv == uv_min, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->id == 1, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type == 1, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type_1.volt_reg == 0x17, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type_1.step_uv == uv_step, ldr::ResultInvalidRegulatorEntry());
|
||||
R_UNLESS(entry->type_1.min_uv == uv_min, ldr::ResultInvalidRegulatorEntry());
|
||||
R_SUCCEED();
|
||||
};
|
||||
|
||||
@@ -76,14 +76,14 @@ namespace ams::ldr::hoc::pcv {
|
||||
}
|
||||
|
||||
void SafetyCheck() {
|
||||
struct sValidator {
|
||||
struct Validator {
|
||||
volatile u32 value;
|
||||
u32 min;
|
||||
u32 max;
|
||||
u32 panic;
|
||||
bool value_required = false;
|
||||
|
||||
Result check() {
|
||||
Result Check() {
|
||||
if (!value_required && !value) {
|
||||
R_SUCCEED();
|
||||
}
|
||||
@@ -145,85 +145,25 @@ namespace ams::ldr::hoc::pcv {
|
||||
break;
|
||||
}
|
||||
|
||||
sValidator validators[] = {
|
||||
Validator validators[] = {
|
||||
{ C.eristaCpuBoostClock, 1020'000, 2397'000, panic::Cpu, true },
|
||||
{ C.marikoCpuBoostClock, 1020'000, 2703'000, panic::Cpu, true },
|
||||
{
|
||||
C.eristaCpuMaxVolt,
|
||||
1000,
|
||||
1260,
|
||||
panic::Cpu,
|
||||
},
|
||||
{
|
||||
C.marikoCpuMaxVolt,
|
||||
1000,
|
||||
1200,
|
||||
panic::Cpu,
|
||||
},
|
||||
{
|
||||
eristaCpuDvfsMaxFreq,
|
||||
1785'000,
|
||||
2397'000,
|
||||
panic::Cpu,
|
||||
},
|
||||
{
|
||||
marikoCpuDvfsMaxFreq,
|
||||
1785'000,
|
||||
2703'000,
|
||||
panic::Cpu,
|
||||
},
|
||||
{
|
||||
C.commonEmcMemVolt,
|
||||
912'500,
|
||||
1350'000,
|
||||
panic::Emc,
|
||||
}, /* Official vmax for the RAMs is 1400-1500mV */
|
||||
{
|
||||
C.eristaEmcMaxClock,
|
||||
1600'000,
|
||||
2600'000,
|
||||
panic::Emc,
|
||||
},
|
||||
{
|
||||
C.marikoEmcMaxClock,
|
||||
1600'000,
|
||||
3500'000,
|
||||
panic::Emc,
|
||||
},
|
||||
{
|
||||
C.marikoEmcVddqVolt,
|
||||
400'000,
|
||||
750'000,
|
||||
panic::Emc,
|
||||
},
|
||||
{
|
||||
C.marikoSocVmax,
|
||||
1000,
|
||||
1200,
|
||||
panic::Emc,
|
||||
},
|
||||
{
|
||||
eristaGpuDvfsMaxFreq,
|
||||
768'000,
|
||||
1152'000,
|
||||
panic::Gpu,
|
||||
},
|
||||
{
|
||||
marikoGpuDvfsMaxFreq,
|
||||
768'000,
|
||||
1536'000,
|
||||
panic::Gpu,
|
||||
},
|
||||
{
|
||||
C.marikoGpuVmax,
|
||||
800,
|
||||
960,
|
||||
panic::Gpu,
|
||||
},
|
||||
{ C.eristaCpuMaxVolt, 1000, 1260, panic::Cpu, },
|
||||
{ C.marikoCpuMaxVolt, 1000, 1200, panic::Cpu, },
|
||||
{ eristaCpuDvfsMaxFreq, 1785'000, 2397'000, panic::Cpu, },
|
||||
{ marikoCpuDvfsMaxFreq, 1785'000, 2703'000, panic::Cpu, },
|
||||
{ C.commonEmcMemVolt, 912'500, 1350'000, panic::Emc, }, /* Official vmax for the RAMs is 1400-1500mV */
|
||||
{ C.eristaEmcMaxClock, 1600'000, 2600'000, panic::Emc, },
|
||||
{ C.marikoEmcMaxClock, 1600'000, 3500'000, panic::Emc, },
|
||||
{ C.marikoEmcVddqVolt, 400'000, 750'000, panic::Emc, },
|
||||
{ C.marikoSocVmax, 1000, 1200, panic::Emc, },
|
||||
{ eristaGpuDvfsMaxFreq, 768'000, 1152'000, panic::Gpu, },
|
||||
{ marikoGpuDvfsMaxFreq, 768'000, 1536'000, panic::Gpu, },
|
||||
{ C.marikoGpuVmax, 800, 960, panic::Gpu, },
|
||||
};
|
||||
|
||||
for (auto &v : validators) {
|
||||
if (R_FAILED(v.check())) {
|
||||
if (R_FAILED(v.Check())) {
|
||||
panic::SmcError(v.panic);
|
||||
CRASH("Validation FAIL");
|
||||
}
|
||||
@@ -249,4 +189,4 @@ namespace ams::ldr::hoc::pcv {
|
||||
WriteKipLoadToIram();
|
||||
}
|
||||
|
||||
} // namespace ams::ldr::hoc::pcv
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user