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