exo: add usb3 force enable support
Like the other configs, it can be read from system_settings.ini and be set. Additionally a new `usb3force` key was added to allow user to override and enable/disable that setting via a boot entry. This allows for fast (re)boot into an entry that disables that (important because of the huge interference that USB3 creates to Bluetooth and WiFi 2.4GHz).
This commit is contained in:
@@ -145,6 +145,7 @@ typedef struct _atm_fatal_error_ctx
|
||||
#define EXO_FLAG_USER_PMU BIT(4)
|
||||
#define EXO_FLAG_CAL0_BLANKING BIT(5)
|
||||
#define EXO_FLAG_CAL0_WRITES_SYS BIT(6)
|
||||
#define EXO_FLAG_ENABLE_USB3 BIT(7)
|
||||
|
||||
#define EXO_FW_VER(mj, mn, rv) (((mj) << 24) | ((mn) << 16) | ((rv) << 8))
|
||||
|
||||
@@ -152,6 +153,7 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base, bool exo_new)
|
||||
{
|
||||
u32 exo_fw_no = 0;
|
||||
u32 exo_flags = 0;
|
||||
bool usb3_force = false;
|
||||
bool user_debug = false;
|
||||
bool cal0_blanking = false;
|
||||
bool cal0_allow_writes_sys = false;
|
||||
@@ -252,6 +254,34 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base, bool exo_new)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Parse usb mtim settings. Avoid parsing if it's overridden.
|
||||
if (ctxt->fss0_main_path && !ctxt->exo_ctx.usb3_force)
|
||||
{
|
||||
char set_path[256];
|
||||
strcpy(set_path, ctxt->fss0_main_path);
|
||||
strcat(set_path, "config/system_settings.ini");
|
||||
LIST_INIT(sys_settings);
|
||||
if (ini_parse(&ini_sections, set_path, false))
|
||||
{
|
||||
LIST_FOREACH_ENTRY(ini_sec_t, ini_sec, &ini_sections, link)
|
||||
{
|
||||
// Only parse usb section.
|
||||
if (!(ini_sec->type == INI_CHOICE) || strcmp(ini_sec->name, "usb"))
|
||||
continue;
|
||||
|
||||
LIST_FOREACH_ENTRY(ini_kv_t, kv, &ini_sec->kvs, link)
|
||||
{
|
||||
if (!strcmp("usb30_force_enabled", kv->key))
|
||||
{
|
||||
usb3_force = !strcmp("u8!0x1", kv->val);
|
||||
break; // Only parse usb30_force_enabled key.
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// To avoid problems, make private debug mode always on if not semi-stock.
|
||||
@@ -270,6 +300,11 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base, bool exo_new)
|
||||
if (ctxt->exo_ctx.user_pmu)
|
||||
exo_flags |= EXO_FLAG_USER_PMU;
|
||||
|
||||
// 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))
|
||||
exo_flags |= EXO_FLAG_ENABLE_USB3;
|
||||
|
||||
// Enable prodinfo blanking. Check if exo ini value is overridden. If not, check if enabled in exo ini.
|
||||
if ((ctxt->exo_ctx.cal0_blank && *ctxt->exo_ctx.cal0_blank)
|
||||
|| (!ctxt->exo_ctx.cal0_blank && cal0_blanking))
|
||||
|
||||
Reference in New Issue
Block a user