hos: add bc based mem mode support
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
* Copyright (c) 2018-2025 CTCaer
|
||||
* Copyright (c) 2018-2026 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
@@ -63,9 +63,10 @@ enum {
|
||||
|
||||
typedef struct _exo_ctxt_t
|
||||
{
|
||||
u32 hos_revision;
|
||||
bool no_user_exceptions;
|
||||
bool user_pmu;
|
||||
u32 hos_revision;
|
||||
bool no_user_exceptions;
|
||||
bool user_pmu;
|
||||
bool *force_mem_mode;
|
||||
bool *usb3_force;
|
||||
bool *cal0_blank;
|
||||
bool *cal0_allow_writes_sys;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018 naehrwert
|
||||
* Copyright (c) 2018-2025 CTCaer
|
||||
* Copyright (c) 2018-2026 CTCaer
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
@@ -223,6 +223,20 @@ static int _config_exo_user_pmu_access(launch_ctxt_t *ctxt, const char *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _config_exo_force_mem_mode(launch_ctxt_t *ctxt, const char *value)
|
||||
{
|
||||
// Override key found.
|
||||
ctxt->exo_ctx.force_mem_mode = zalloc(sizeof(bool));
|
||||
|
||||
if (*value == '1')
|
||||
{
|
||||
DPRINTF("Enabled Auto Memory Mode\n");
|
||||
*ctxt->exo_ctx.force_mem_mode = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int _config_exo_usb3_force(launch_ctxt_t *ctxt, const char *value)
|
||||
{
|
||||
// Override key found.
|
||||
@@ -312,6 +326,7 @@ static const cfg_handler_t _config_handlers[] = {
|
||||
{ "emummcforce", _config_emummc_forced },
|
||||
{ "nouserexceptions", _config_dis_exo_user_exceptions },
|
||||
{ "userpmu", _config_exo_user_pmu_access },
|
||||
{ "memmode", _config_exo_force_mem_mode },
|
||||
{ "usb3force", _config_exo_usb3_force },
|
||||
{ "cal0blank", _config_exo_cal0_blanking },
|
||||
{ "cal0writesys", _config_exo_cal0_writes_enable },
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2025 CTCaer
|
||||
* Copyright (c) 2018-2026 CTCaer
|
||||
* Copyright (c) 2019 Atmosphère-NX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
@@ -136,6 +136,7 @@ typedef struct _atm_fatal_error_ctx
|
||||
#define EXO_FLAG_CAL0_BLANKING BIT(5)
|
||||
#define EXO_FLAG_CAL0_WRITES_SYS BIT(6)
|
||||
#define EXO_FLAG_ENABLE_USB3 BIT(7)
|
||||
#define EXO_FLAG_BC_MEM_MODE BIT(8)
|
||||
|
||||
#define EXO_FW_VER(mj, mn) (((mj) << 24) | ((mn) << 16))
|
||||
|
||||
@@ -145,6 +146,7 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
|
||||
u32 exo_flags = 0;
|
||||
bool usb3_force = false;
|
||||
bool user_debug = false;
|
||||
bool bc_mem_mode = false;
|
||||
bool cal0_blanking = false;
|
||||
bool cal0_allow_writes_sys = false;
|
||||
|
||||
@@ -224,6 +226,8 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
|
||||
exo_cfg->uart_invert = atoi(kv->val);
|
||||
else if (!strcmp("log_baud_rate", kv->key))
|
||||
exo_cfg->uart_baudrate = atoi(kv->val);
|
||||
else if (!strcmp("enable_mem_mode", kv->key))
|
||||
bc_mem_mode = atoi(kv->val);
|
||||
else if (emu_cfg.enabled && !h_cfg.emummc_force_disable)
|
||||
{
|
||||
if (!strcmp("blank_prodinfo_emummc", kv->key))
|
||||
@@ -283,6 +287,11 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base)
|
||||
if (ctxt->exo_ctx.user_pmu)
|
||||
exo_flags |= EXO_FLAG_USER_PMU;
|
||||
|
||||
// Enable Boot Config Memory Mode. Check if system_settings ini value is overridden. If not, check if enabled in ini.
|
||||
if ((ctxt->exo_ctx.force_mem_mode && *ctxt->exo_ctx.force_mem_mode)
|
||||
|| (!ctxt->exo_ctx.force_mem_mode && bc_mem_mode))
|
||||
exo_flags |= EXO_FLAG_BC_MEM_MODE;
|
||||
|
||||
// Enable USB 3.0. Check if system_settings ini value is overridden. If not, check if enabled in ini.
|
||||
if ((ctxt->exo_ctx.usb3_force && *ctxt->exo_ctx.usb3_force)
|
||||
|| (!ctxt->exo_ctx.usb3_force && usb3_force))
|
||||
|
||||
Reference in New Issue
Block a user