mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-27 13:14:15 -04:00
Implement support for parsing/interacting with NCAs. (#942)
* fs: implement support for interacting with ncas. * spl: extend to use virtual keyslots
This commit is contained in:
parent
3a1ccdd919
commit
81f91803ec
118 changed files with 13301 additions and 405 deletions
|
@ -66,7 +66,7 @@ namespace ams::boot {
|
|||
/* Globals. */
|
||||
bool g_is_display_intialized = false;
|
||||
u32 *g_frame_buffer = nullptr;
|
||||
bool g_is_mariko = false;
|
||||
spl::SocType g_soc_type = spl::SocType_Erista;
|
||||
u32 g_lcd_vendor = 0;
|
||||
Handle g_dc_das_hnd = INVALID_HANDLE;
|
||||
u8 g_frame_buffer_storage[DeviceAddressSpaceAlignSize + FrameBufferSize];
|
||||
|
@ -95,10 +95,9 @@ namespace ams::boot {
|
|||
}
|
||||
|
||||
inline void DoSocDependentRegisterWrites(uintptr_t base_address, const RegisterWrite *reg_writes_erista, size_t num_writes_erista, const RegisterWrite *reg_writes_mariko, size_t num_writes_mariko) {
|
||||
if (g_is_mariko) {
|
||||
DoRegisterWrites(base_address, reg_writes_mariko, num_writes_mariko);
|
||||
} else {
|
||||
DoRegisterWrites(base_address, reg_writes_erista, num_writes_erista);
|
||||
switch (g_soc_type) {
|
||||
case spl::SocType_Erista: DoRegisterWrites(base_address, reg_writes_erista, num_writes_erista); break;
|
||||
case spl::SocType_Mariko: DoRegisterWrites(base_address, reg_writes_mariko, num_writes_mariko); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,7 +187,7 @@ namespace ams::boot {
|
|||
void InitializeDisplay() {
|
||||
/* Setup globals. */
|
||||
InitializeRegisterBaseAddresses();
|
||||
g_is_mariko = spl::IsMariko();
|
||||
g_soc_type = spl::GetSocType();
|
||||
InitializeFrameBuffer();
|
||||
|
||||
/* Turn on DSI/voltage rail. */
|
||||
|
@ -199,7 +198,7 @@ namespace ams::boot {
|
|||
|
||||
i2c::driver::OpenSession(&i2c_session, I2cDevice_Max77620Pmic);
|
||||
|
||||
if (g_is_mariko) {
|
||||
if (g_soc_type == spl::SocType_Mariko) {
|
||||
WriteI2cRegister(i2c_session, 0x18, 0x3A);
|
||||
WriteI2cRegister(i2c_session, 0x1F, 0x71);
|
||||
}
|
||||
|
@ -242,7 +241,7 @@ namespace ams::boot {
|
|||
|
||||
/* Configure display interface and display. */
|
||||
reg::Write(g_mipi_cal_regs + 0x060, 0);
|
||||
if (g_is_mariko) {
|
||||
if (g_soc_type == spl::SocType_Mariko) {
|
||||
reg::Write(g_mipi_cal_regs + 0x058, 0);
|
||||
reg::Write(g_apb_misc_regs + 0xAC0, 0);
|
||||
}
|
||||
|
@ -367,7 +366,7 @@ namespace ams::boot {
|
|||
DO_SOC_DEPENDENT_REGISTER_WRITES(g_dsi_regs, DisplayConfigDsi01Init11);
|
||||
DO_SOC_DEPENDENT_REGISTER_WRITES(g_mipi_cal_regs, DisplayConfigMipiCal03);
|
||||
DO_REGISTER_WRITES(g_mipi_cal_regs, DisplayConfigMipiCal04);
|
||||
if (g_is_mariko) {
|
||||
if (g_soc_type == spl::SocType_Mariko) {
|
||||
/* On Mariko the above configurations are executed twice, for some reason. */
|
||||
DO_SOC_DEPENDENT_REGISTER_WRITES(g_mipi_cal_regs, DisplayConfigMipiCal02);
|
||||
DO_SOC_DEPENDENT_REGISTER_WRITES(g_dsi_regs, DisplayConfigDsi01Init11);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue