Move display_end before secmon + add boolean supp.

Currently bpmp loses access to the relevant registers when secmon or exosphere is launched.

This change provides support for all firmwares and properly sanitizes the display.
This commit is contained in:
Kostas Missos
2018-08-13 12:12:53 +03:00
parent e5abdd938e
commit 6b8887b5d8
15 changed files with 83 additions and 86 deletions

View File

@@ -67,9 +67,9 @@ typedef struct _launch_ctxt_t
link_t kip1_list;
char* kip1_patches;
int svcperm;
int debugmode;
int atmosphere;
bool svcperm;
bool debugmode;
bool atmosphere;
} launch_ctxt_t;
typedef struct _merge_kip_t
@@ -358,7 +358,7 @@ static int _config_svcperm(launch_ctxt_t *ctxt, const char *value)
if (*value == '1')
{
DPRINTF("Disabled SVC verification\n");
ctxt->svcperm = 1;
ctxt->svcperm = true;
}
return 1;
}
@@ -368,7 +368,7 @@ static int _config_debugmode(launch_ctxt_t *ctxt, const char *value)
if (*value == '1')
{
DPRINTF("Enabled Debug mode\n");
ctxt->debugmode = 1;
ctxt->debugmode = true;
}
return 1;
}
@@ -378,7 +378,7 @@ static int _config_atmosphere(launch_ctxt_t *ctxt, const char *value)
if (*value == '1')
{
DPRINTF("Enabled atmosphere patching\n");
ctxt->atmosphere = 1;
ctxt->atmosphere = true;
}
return 1;
}
@@ -457,7 +457,6 @@ int hos_launch(ini_sec_t *cfg)
int bootStateDramPkg2 = 0;
int bootStatePkg2Continue = 0;
int exoFwNumber = 0;
int end_di = 0;
launch_ctxt_t ctxt;
memset(&ctxt, 0, sizeof(launch_ctxt_t));
@@ -611,7 +610,6 @@ int hos_launch(ini_sec_t *cfg)
se_key_acc_ctrl(13, 0xFF);
bootStateDramPkg2 = 2;
bootStatePkg2Continue = 3;
end_di = 1;
if (!exoFwNumber)
exoFwNumber = 3;
break;
@@ -662,7 +660,8 @@ int hos_launch(ini_sec_t *cfg)
*mb_in = bootStateDramPkg2;
*mb_out = 0;
display_backlight(0);
// Disable display. This must be executed before secmon to provide support for all fw versions.
display_end();
// Wait for secmon to get ready.
cluster_boot_cpu0(ctxt.pkg1_id->secmon_base);
@@ -679,10 +678,6 @@ int hos_launch(ini_sec_t *cfg)
PMC(0x5BC) = 0xFFFFFFFF;
PMC(0x5C0) = 0xFFAAFFFF;*/
// Disable display.
if (end_di)
display_end();
// Signal pkg2 ready and continue boot.
*mb_in = bootStatePkg2Continue;