mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 21:24:11 -04:00
fusee_cpp: implement cpu startup
This commit is contained in:
parent
648ad51056
commit
40e2d4bbe6
12 changed files with 282 additions and 19 deletions
|
@ -87,11 +87,13 @@ namespace ams::clkrst {
|
|||
DEFINE_CLOCK_PARAMETERS(SeClock, V, SE, PLLP_OUT0, 0);
|
||||
DEFINE_CLOCK_PARAMETERS(ActmonClock, V, ACTMON, CLK_M, 0);
|
||||
|
||||
DEFINE_CLOCK_PARAMETERS(CsiteClock, U, CSITE, PLLP_OUT0, 4);
|
||||
DEFINE_CLOCK_PARAMETERS(Host1xClock, L, HOST1X, PLLP_OUT0, 3);
|
||||
DEFINE_CLOCK_PARAMETERS(TsecClock, U, TSEC, PLLP_OUT0, 2);
|
||||
DEFINE_CLOCK_PARAMETERS(Sor1Clock, X, SOR1, PLLP_OUT0, 2);
|
||||
DEFINE_CLOCK_PARAMETERS(TsecClock, U, TSEC, PLLP_OUT0, 2);
|
||||
DEFINE_CLOCK_PARAMETERS(Sor1Clock, X, SOR1, PLLP_OUT0, 2);
|
||||
|
||||
DEFINE_CLOCK_PARAMETERS_WITHOUT_CLKDIV(CldvfsClock, W, DVFS);
|
||||
|
||||
DEFINE_CLOCK_PARAMETERS_WITHOUT_CLKDIV(TzramClock, V, TZRAM);
|
||||
|
||||
DEFINE_CLOCK_PARAMETERS_WITHOUT_CLKDIV(SorSafeClock, Y, SOR_SAFE);
|
||||
|
@ -203,6 +205,10 @@ namespace ams::clkrst {
|
|||
EnableClock(CldvfsClock);
|
||||
}
|
||||
|
||||
void EnableCsiteClock() {
|
||||
EnableClock(CsiteClock);
|
||||
}
|
||||
|
||||
void EnableTzramClock() {
|
||||
EnableClock(TzramClock);
|
||||
}
|
||||
|
|
|
@ -26,4 +26,15 @@ namespace ams::hw::arch::arm64 {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void InvalidateDataCache(const void *ptr, size_t size) {
|
||||
const uintptr_t start = reinterpret_cast<uintptr_t>(ptr);
|
||||
const uintptr_t end = util::AlignUp(start + size, hw::DataCacheLineSize);
|
||||
|
||||
for (uintptr_t cur = start; cur < end; cur += hw::DataCacheLineSize) {
|
||||
InvalidateDataCacheLine(reinterpret_cast<void *>(cur));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -65,13 +65,13 @@ namespace ams::pmic {
|
|||
u8 val;
|
||||
|
||||
/* Clear the AE for the GPIO */
|
||||
if (i2c::Query(std::addressof(val), sizeof(val), i2c::Port_5, I2cAddressEristaMax77621, Max77620RegisterAmeGpio)) {
|
||||
if (i2c::Query(std::addressof(val), sizeof(val), i2c::Port_5, I2cAddressMax77620Pmic, Max77620RegisterAmeGpio)) {
|
||||
val &= ~(1 << gpio);
|
||||
i2c::SendByte(i2c::Port_5, I2cAddressEristaMax77621, Max77620RegisterAmeGpio, val);
|
||||
i2c::SendByte(i2c::Port_5, I2cAddressMax77620Pmic, Max77620RegisterAmeGpio, val);
|
||||
}
|
||||
|
||||
/* Set GPIO_DRV_PUSHPULL (bit 0), GPIO_OUTPUT_VAL_HIGH (bit 3). */
|
||||
i2c::SendByte(i2c::Port_5, I2cAddressEristaMax77621, Max77620RegisterGpio0 + gpio, MAX77620_CNFG_GPIO_DRV_PUSHPULL | MAX77620_CNFG_GPIO_OUTPUT_VAL_HIGH);
|
||||
i2c::SendByte(i2c::Port_5, I2cAddressMax77620Pmic, Max77620RegisterGpio0 + gpio, MAX77620_CNFG_GPIO_DRV_PUSHPULL | MAX77620_CNFG_GPIO_OUTPUT_VAL_HIGH);
|
||||
}
|
||||
|
||||
void SetEnBitErista() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue