diff --git a/bootloader/hos/hos.h b/bootloader/hos/hos.h index 573066b..97e54ba 100644 --- a/bootloader/hos/hos.h +++ b/bootloader/hos/hos.h @@ -68,6 +68,8 @@ typedef struct _launch_ctxt_t bool atmosphere; bool exo_no_user_exceptions; bool exo_user_pmu; + bool exo_blank_prodinfo; + bool exo_allow_writing_to_cal_sysmmc; bool fss0_enable_experimental; bool emuMMC; diff --git a/bootloader/hos/hos_config.c b/bootloader/hos/hos_config.c index e22fbaa..4169ec8 100644 --- a/bootloader/hos/hos_config.c +++ b/bootloader/hos/hos_config.c @@ -211,6 +211,26 @@ static int _config_exo_user_pmu_access(launch_ctxt_t *ctxt, const char *value) return 1; } +static int _config_exo_blank_prodinfo(launch_ctxt_t *ctxt, const char *value) +{ + if (*value == '1') + { + DPRINTF("Enabled prodinfo blanking\n"); + ctxt->exo_blank_prodinfo = true; + } + return 1; +} + +static int _config_exo_allow_cal_write(launch_ctxt_t *ctxt, const char *value) +{ + if (*value == '1') + { + DPRINTF("Enabled writing to cal on sysMMC\n"); + ctxt->exo_allow_writing_to_cal_sysmmc = true; + } + return 1; +} + static int _config_fss(launch_ctxt_t *ctxt, const char *value) { LIST_FOREACH_ENTRY(ini_kv_t, kv, &ctxt->cfg->kvs, link) @@ -243,6 +263,8 @@ static const cfg_handler_t _config_handlers[] = { { "atmosphere", _config_atmosphere }, { "nouserexceptions", _config_dis_exo_user_exceptions }, { "userpmu", _config_exo_user_pmu_access }, + { "blankprodinfo", _config_exo_blank_prodinfo }, + { "allowcalwrite", _config_exo_allow_cal_write }, { "fss0", _config_fss }, { NULL, NULL }, }; diff --git a/bootloader/hos/secmon_exo.c b/bootloader/hos/secmon_exo.c index 290c72a..5352a2b 100644 --- a/bootloader/hos/secmon_exo.c +++ b/bootloader/hos/secmon_exo.c @@ -133,10 +133,12 @@ typedef struct _atm_fatal_error_ctx // Exosphère mailbox defines. #define EXO_CFG_ADDR 0x8000F000 #define EXO_MAGIC_VAL 0x304F5845 -#define EXO_FLAG_DBG_PRIV (1 << 1) -#define EXO_FLAG_DBG_USER (1 << 2) -#define EXO_FLAG_NO_USER_EXC (1 << 3) -#define EXO_FLAG_USER_PMU (1 << 4) +#define EXO_FLAG_DBG_PRIV (1 << 1) +#define EXO_FLAG_DBG_USER (1 << 2) +#define EXO_FLAG_NO_USER_EXC (1 << 3) +#define EXO_FLAG_USER_PMU (1 << 4) +#define EXO_FLAG_BLANK_PRODINFO (1 << 5) +#define EXO_FLAG_ALLOW_WRITING_TO_CAL_SYSMMC (1 << 6) void config_exosphere(launch_ctxt_t *ctxt) { @@ -180,6 +182,14 @@ void config_exosphere(launch_ctxt_t *ctxt) if (ctxt->exo_user_pmu) exoFlags |= EXO_FLAG_USER_PMU; + // Blank prodinfo. + if (ctxt->exo_blank_prodinfo) + exoFlags |= EXO_FLAG_BLANK_PRODINFO; + + // Allow writing to cal on sysMMC. + if (ctxt->exo_allow_writing_to_cal_sysmmc) + exoFlags |= EXO_FLAG_ALLOW_WRITING_TO_CAL_SYSMMC; + // Set mailbox values. exo_cfg->magic = EXO_MAGIC_VAL; diff --git a/nyx/nyx_gui/hos/hos.h b/nyx/nyx_gui/hos/hos.h index a315e9d..463f05e 100644 --- a/nyx/nyx_gui/hos/hos.h +++ b/nyx/nyx_gui/hos/hos.h @@ -65,6 +65,8 @@ typedef struct _launch_ctxt_t bool stock; bool atmosphere; bool exo_no_user_exceptions; + bool exo_blank_prodinfo; + bool exo_allow_writing_to_cal_sysmmc; bool emuMMC; ini_sec_t *cfg;