Support for NYX to load from BOOT1/GPP/SD in that order, UMS option to mount whatever volume is selected as boot storage

This commit is contained in:
Christoph Baumann
2025-04-24 12:06:15 +02:00
parent 4e9e21b3b1
commit 337f219ac6
28 changed files with 425 additions and 150 deletions

View File

@@ -26,6 +26,7 @@
#include <ianos/ianos.h>
#include <libs/compr/blz.h>
#include <libs/fatfs/ff.h>
#include <storage/boot_storage.h>
#include "frontend/fe_emmc_tools.h"
#include "frontend/gui.h"
@@ -34,10 +35,10 @@ nyx_config n_cfg;
hekate_config h_cfg;
const volatile ipl_ver_meta_t __attribute__((section ("._ipl_version"))) ipl_ver = {
.magic = NYX_MAGIC,
.magic = NYX_MAGIC,
.version = (NYX_VER_MJ + '0') | ((NYX_VER_MN + '0') << 8) | ((NYX_VER_HF + '0') << 16) | ((NYX_VER_RL) << 24),
.rsvd0 = 0,
.rsvd1 = 0
.rsvd0 = 0,
.rsvd1 = 0
};
volatile nyx_storage_t *nyx_str = (nyx_storage_t *)NYX_STORAGE_ADDR;
@@ -134,7 +135,7 @@ lv_res_t launch_payload(lv_obj_t *list)
strcpy(path,"bootloader/payloads/");
strcat(path, filename);
if (!sd_mount())
if (!boot_storage_mount())
goto out;
FIL fp;
@@ -174,7 +175,7 @@ lv_res_t launch_payload(lv_obj_t *list)
f_close(&fp);
sd_end();
boot_storage_end();
if (size < 0x30000)
{
@@ -351,8 +352,8 @@ static void _show_errors(int sd_error)
if (*excp_enabled == EXCP_MAGIC || sd_error)
{
gfx_clear_grey(0);
gfx_con_setpos(0, 0, 0);
// gfx_clear_grey(0);
// gfx_con_setpos(0, 0, 0);
display_backlight_brightness(150, 1000);
display_init_window_d_console();
display_window_d_console_enable();
@@ -440,13 +441,13 @@ void nyx_init_load_res()
_show_errors(SD_NO_ERROR);
// Try 2 times to mount SD card.
if (!sd_mount())
if (!boot_storage_mount())
{
// Restore speed to SDR104.
sd_end();
boot_storage_end();
// Retry.
if (!sd_mount())
if (!boot_storage_mount())
_show_errors(SD_MOUNT_ERROR); // Fatal.
}
@@ -496,7 +497,7 @@ void nyx_init_load_res()
nyx_load_bg_icons();
// Unmount FAT partition.
sd_unmount();
boot_storage_unmount();
}
void ipl_main()