boot: add missing 18.0.0 change and new 23.0.0 change
This commit is contained in:
@@ -467,11 +467,20 @@ namespace ams::boot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* On 18.0.0+ i2c shutdown is unconditionally disabled here. */
|
||||||
|
if (hos::GetVersion() >= hos::Version_18_0_0) {
|
||||||
|
if (R_FAILED(battery_driver.SetI2cShutdownEnabled(false))) {
|
||||||
|
boot::ShutdownSystem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the boot reason. */
|
/* Get the boot reason. */
|
||||||
const auto boot_reason = boot::GetBootReason();
|
const auto boot_reason = boot::GetBootReason();
|
||||||
|
|
||||||
/* Initialize the charger driver. */
|
/* Initialize the charger driver. */
|
||||||
if (R_FAILED(charger_driver.Initialize(boot_reason != spl::BootReason_RtcAlarm2)))
|
if (R_FAILED(charger_driver.Initialize(boot_reason != spl::BootReason_RtcAlarm2))) {
|
||||||
|
boot::ShutdownSystem();
|
||||||
|
}
|
||||||
|
|
||||||
/* Check that the charger input limit is greater than 150 milli-amps. */
|
/* Check that the charger input limit is greater than 150 milli-amps. */
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -75,11 +75,14 @@ namespace ams::boot {
|
|||||||
R_ABORT_UNLESS(ReadI2cRegister(m_i2c_session, std::addressof(on_off_1_val), sizeof(on_off_1_val), std::addressof(on_off_1_addr), sizeof(on_off_1_addr)));
|
R_ABORT_UNLESS(ReadI2cRegister(m_i2c_session, std::addressof(on_off_1_val), sizeof(on_off_1_val), std::addressof(on_off_1_addr), sizeof(on_off_1_addr)));
|
||||||
on_off_1_val |= 0x80;
|
on_off_1_val |= 0x80;
|
||||||
|
|
||||||
|
/* 23.0.0+ no longer finalizes the battery on any hardware type. */
|
||||||
|
if (hos::GetVersion() < hos::Version_23_0_0) {
|
||||||
/* Finalize the battery on non-Calcio. */
|
/* Finalize the battery on non-Calcio. */
|
||||||
if (spl::GetHardwareType() != spl::HardwareType::Calcio) {
|
if (spl::GetHardwareType() != spl::HardwareType::Calcio) {
|
||||||
BatteryDriver battery_driver;
|
BatteryDriver battery_driver;
|
||||||
this->FinalizeBattery(battery_driver);
|
this->FinalizeBattery(battery_driver);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Actually write the value to trigger shutdown/reset. */
|
/* Actually write the value to trigger shutdown/reset. */
|
||||||
R_ABORT_UNLESS(WriteI2cRegister(m_i2c_session, std::addressof(on_off_1_val), sizeof(on_off_1_val), std::addressof(on_off_1_addr), sizeof(on_off_1_addr)));
|
R_ABORT_UNLESS(WriteI2cRegister(m_i2c_session, std::addressof(on_off_1_val), sizeof(on_off_1_val), std::addressof(on_off_1_addr), sizeof(on_off_1_addr)));
|
||||||
|
|||||||
Reference in New Issue
Block a user