Nyx: emuMMC Manage window, Tools UI, and misc updates
- Add gui_emu_tools: emuMMC Manage window with correct positioning (LV_PROTECT_PARENT + re-parent to win) - Tools: single SD button (tap = SD partition manager, 3s hold = eMMC) - Remove emuSD from Nyx UI (tabs, UMS, partition manager); keep bootloader emusd - Shorten Create emuMMC description text by one character - Storage/build/config and dependency updates Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include "../hos/hos.h"
|
||||
#include "../hos/pkg1.h"
|
||||
#include <libs/fatfs/ff.h>
|
||||
#include <storage/boot_storage.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -75,15 +76,15 @@ static lv_res_t _cal0_dump_window_action(lv_obj_t *btns, const char * txt)
|
||||
|
||||
if (btn_idx == 1)
|
||||
{
|
||||
int error = !sd_mount();
|
||||
int error = !boot_storage_mount();
|
||||
|
||||
if (!error)
|
||||
{
|
||||
char path[64];
|
||||
emmcsn_path_impl(path, "/dumps", "cal0.bin", NULL);
|
||||
error = sd_save_to_file((u8 *)cal0_buf, SZ_32K, path);
|
||||
error = boot_storage_save_to_file((u8 *)cal0_buf, SZ_32K, path);
|
||||
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
_create_window_dump_done(error, "cal0.bin");
|
||||
@@ -95,7 +96,7 @@ static lv_res_t _cal0_dump_window_action(lv_obj_t *btns, const char * txt)
|
||||
|
||||
static lv_res_t _battery_dump_window_action(lv_obj_t * btn)
|
||||
{
|
||||
int error = !sd_mount();
|
||||
int error = !boot_storage_mount();
|
||||
|
||||
if (!error)
|
||||
{
|
||||
@@ -105,9 +106,9 @@ static lv_res_t _battery_dump_window_action(lv_obj_t * btn)
|
||||
max17050_dump_regs(buf);
|
||||
|
||||
emmcsn_path_impl(path, "/dumps", "fuel_gauge.bin", NULL);
|
||||
error = sd_save_to_file((u8 *)buf, 0x200, path);
|
||||
error = boot_storage_save_to_file((u8 *)buf, 0x200, path);
|
||||
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
_create_window_dump_done(error, "fuel_gauge.bin");
|
||||
@@ -119,7 +120,7 @@ static lv_res_t _bootrom_dump_window_action(lv_obj_t * btn)
|
||||
{
|
||||
static const u32 BOOTROM_SIZE = 0x18000;
|
||||
|
||||
int error = !sd_mount();
|
||||
int error = !boot_storage_mount();
|
||||
if (!error)
|
||||
{
|
||||
char path[64];
|
||||
@@ -129,13 +130,13 @@ static lv_res_t _bootrom_dump_window_action(lv_obj_t * btn)
|
||||
if (!error)
|
||||
{
|
||||
emmcsn_path_impl(path, "/dumps", "evp_thunks.bin", NULL);
|
||||
error = sd_save_to_file((u8 *)iram_evp_thunks, iram_evp_thunks_len, path);
|
||||
error = boot_storage_save_to_file((u8 *)iram_evp_thunks, iram_evp_thunks_len, path);
|
||||
}
|
||||
else
|
||||
error = 255;
|
||||
|
||||
emmcsn_path_impl(path, "/dumps", "bootrom_patched.bin", NULL);
|
||||
int res = sd_save_to_file((u8 *)IROM_BASE, BOOTROM_SIZE, path);
|
||||
int res = boot_storage_save_to_file((u8 *)IROM_BASE, BOOTROM_SIZE, path);
|
||||
if (!error)
|
||||
error = res;
|
||||
|
||||
@@ -144,13 +145,13 @@ static lv_res_t _bootrom_dump_window_action(lv_obj_t * btn)
|
||||
memset((void*)IPATCH_BASE, 0, sizeof(ipatch_cam)); // Zeroing valid entries is enough but zero everything.
|
||||
|
||||
emmcsn_path_impl(path, "/dumps", "bootrom_unpatched.bin", NULL);
|
||||
res = sd_save_to_file((u8 *)IROM_BASE, BOOTROM_SIZE, path);
|
||||
res = boot_storage_save_to_file((u8 *)IROM_BASE, BOOTROM_SIZE, path);
|
||||
if (!error)
|
||||
error = res;
|
||||
|
||||
memcpy((void*)IPATCH_BASE, ipatch_cam, sizeof(ipatch_cam));
|
||||
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
_create_window_dump_done(error, "evp_thunks.bin, bootrom_patched.bin, bootrom_unpatched.bin");
|
||||
|
||||
@@ -180,14 +181,14 @@ static void _unlock_reserved_odm_fuses(bool lock)
|
||||
|
||||
static lv_res_t _fuse_dump_window_action(lv_obj_t * btn)
|
||||
{
|
||||
int error = !sd_mount();
|
||||
int error = !boot_storage_mount();
|
||||
if (!error)
|
||||
{
|
||||
char path[128];
|
||||
if (!h_cfg.t210b01)
|
||||
{
|
||||
emmcsn_path_impl(path, "/dumps", "fuse_cached_t210.bin", NULL);
|
||||
error = sd_save_to_file((u8 *)0x7000F900, 0x300, path);
|
||||
error = boot_storage_save_to_file((u8 *)0x7000F900, 0x300, path);
|
||||
emmcsn_path_impl(path, "/dumps", "fuse_array_raw_t210.bin", NULL);
|
||||
}
|
||||
else
|
||||
@@ -196,10 +197,10 @@ static lv_res_t _fuse_dump_window_action(lv_obj_t * btn)
|
||||
_unlock_reserved_odm_fuses(false);
|
||||
|
||||
emmcsn_path_impl(path, "/dumps", "fuse_cached_t210b01_x898.bin", NULL);
|
||||
error = sd_save_to_file((u8 *)0x7000F898, 0x68, path);
|
||||
error = boot_storage_save_to_file((u8 *)0x7000F898, 0x68, path);
|
||||
emmcsn_path_impl(path, "/dumps", "fuse_cached_t210b01_x900.bin", NULL);
|
||||
if (!error)
|
||||
error = sd_save_to_file((u8 *)0x7000F900, 0x300, path);
|
||||
error = boot_storage_save_to_file((u8 *)0x7000F900, 0x300, path);
|
||||
emmcsn_path_impl(path, "/dumps", "fuse_array_raw_t210b01.bin", NULL);
|
||||
}
|
||||
|
||||
@@ -214,7 +215,7 @@ static lv_res_t _fuse_dump_window_action(lv_obj_t * btn)
|
||||
if (h_cfg.t210b01)
|
||||
_unlock_reserved_odm_fuses(true);
|
||||
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
if (!h_cfg.t210b01)
|
||||
@@ -231,15 +232,15 @@ static lv_res_t _kfuse_dump_window_action(lv_obj_t * btn)
|
||||
int error = !kfuse_read(buf);
|
||||
|
||||
if (!error)
|
||||
error = !sd_mount();
|
||||
error = !boot_storage_mount();
|
||||
|
||||
if (!error)
|
||||
{
|
||||
char path[64];
|
||||
emmcsn_path_impl(path, "/dumps", "kfuses.bin", NULL);
|
||||
error = sd_save_to_file((u8 *)buf, KFUSE_NUM_WORDS * 4, path);
|
||||
error = boot_storage_save_to_file((u8 *)buf, KFUSE_NUM_WORDS * 4, path);
|
||||
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
}
|
||||
|
||||
_create_window_dump_done(error, "kfuses.bin");
|
||||
@@ -269,7 +270,7 @@ static lv_res_t _create_mbox_cal0(lv_obj_t *btn)
|
||||
lv_label_set_style(lb_desc, &monospace_text);
|
||||
lv_obj_set_width(lb_desc, LV_HOR_RES / 9 * 4);
|
||||
|
||||
sd_mount();
|
||||
boot_storage_mount();
|
||||
|
||||
// Dump CAL0.
|
||||
int cal0_res = hos_dump_cal0();
|
||||
@@ -290,7 +291,7 @@ static lv_res_t _create_mbox_cal0(lv_obj_t *btn)
|
||||
nx_emmc_cal0_t *cal0 = (nx_emmc_cal0_t *)cal0_buf;
|
||||
|
||||
u32 hash[8];
|
||||
se_sha_hash_256_oneshot(hash, (u8 *)&cal0->cfg_id1, cal0->body_size);
|
||||
se_calc_sha256_oneshot(hash, (u8 *)&cal0->cfg_id1, cal0->body_size);
|
||||
|
||||
s_printf(txt_buf,
|
||||
"#FF8000 CAL0 Version:# %d\n"
|
||||
@@ -369,7 +370,7 @@ static lv_res_t _create_mbox_cal0(lv_obj_t *btn)
|
||||
|
||||
out:
|
||||
free(txt_buf);
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, _cal0_dump_window_action);
|
||||
|
||||
@@ -1094,6 +1095,30 @@ static lv_res_t _create_window_hw_info_status(lv_obj_t *btn)
|
||||
|
||||
switch (display_id)
|
||||
{
|
||||
case PANEL_RR_SUPER5_OLED_V1:
|
||||
strcat(txt_buf, "RR SUPER5 OLED");
|
||||
switch (display_rev)
|
||||
{
|
||||
case 0x01:
|
||||
strcat(txt_buf, "-V1");
|
||||
break;
|
||||
default:
|
||||
strcat(txt_buf, " #FFDD00 Contact me!#");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PANEL_RR_SUPER5_OLED_HD_V1:
|
||||
strcat(txt_buf, "RR SUPER5 OLED HD");
|
||||
switch (display_rev)
|
||||
{
|
||||
case 0x01:
|
||||
strcat(txt_buf, "-V1");
|
||||
break;
|
||||
default:
|
||||
strcat(txt_buf, " #FFDD00 Contact me!#");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case PANEL_JDI_LAM062M109A:
|
||||
strcat(txt_buf, "JDI LAM062M109A");
|
||||
break;
|
||||
@@ -1811,7 +1836,7 @@ static lv_res_t _create_mbox_benchmark(bool sd_bench)
|
||||
for (u32 i = 0; i < rnd_off_cnt; i += 4)
|
||||
{
|
||||
// Generate new random numbers.
|
||||
while (!se_rng_pseudo(random_numbers, SE_RNG_BLOCK_SIZE))
|
||||
while (!se_gen_prng128(random_numbers))
|
||||
;
|
||||
// Clamp offsets to 256MB range.
|
||||
random_offsets[i + 0] = random_numbers[0] % sct_rem_4kb;
|
||||
@@ -2881,7 +2906,7 @@ static bool _lockpick_exists_check()
|
||||
|
||||
bool found = false;
|
||||
void *buf = malloc(0x200);
|
||||
if (sd_mount())
|
||||
if (boot_storage_mount())
|
||||
{
|
||||
FIL fp;
|
||||
if (f_open(&fp, "bootloader/payloads/Lockpick_RCM.bin", FA_READ))
|
||||
@@ -2906,7 +2931,7 @@ static bool _lockpick_exists_check()
|
||||
|
||||
out:
|
||||
free(buf);
|
||||
sd_unmount();
|
||||
boot_storage_unmount();
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user