sdmmc v2: Name eMMC physical partitions

This commit is contained in:
CTCaer
2020-04-29 22:06:33 +03:00
parent 10e7e06048
commit 5442547a59
12 changed files with 23 additions and 23 deletions

View File

@@ -525,7 +525,7 @@ static void _dump_emmc_selected(emmcPartType_t dumpType)
if ((dumpType & PART_SYSTEM) || (dumpType & PART_USER) || (dumpType & PART_RAW))
{
sdmmc_storage_set_mmc_partition(&storage, 0);
sdmmc_storage_set_mmc_partition(&storage, EMMC_GPP);
if ((dumpType & PART_SYSTEM) || (dumpType & PART_USER))
{
@@ -873,7 +873,7 @@ static void _restore_emmc_selected(emmcPartType_t restoreType)
if (restoreType & PART_GP_ALL)
{
sdmmc_storage_set_mmc_partition(&storage, 0);
sdmmc_storage_set_mmc_partition(&storage, EMMC_GPP);
LIST_INIT(gpt);
nx_emmc_gpt_parse(&gpt, &storage);

View File

@@ -263,7 +263,7 @@ void print_mmc_info()
gfx_put_small_sep();
gfx_printf("%kGPP (eMMC USER) partition table:%k\n", 0xFF00DDFF, 0xFFCCCCCC);
sdmmc_storage_set_mmc_partition(&storage, 0);
sdmmc_storage_set_mmc_partition(&storage, EMMC_GPP);
LIST_INIT(gpt);
nx_emmc_gpt_parse(&gpt, &storage);
int gpp_idx = 0;
@@ -350,7 +350,7 @@ void print_tsec_key()
// Read package1.
u8 *pkg1 = (u8 *)malloc(0x40000);
sdmmc_storage_set_mmc_partition(&storage, 1);
sdmmc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
sdmmc_storage_read(&storage, 0x100000 / NX_EMMC_BLOCKSIZE, 0x40000 / NX_EMMC_BLOCKSIZE, pkg1);
sdmmc_storage_end(&storage);
const pkg1_id_t *pkg1_id = pkg1_identify(pkg1);

View File

@@ -74,7 +74,7 @@ void dump_packages12()
EPRINTF("Failed to init eMMC.");
goto out_free;
}
sdmmc_storage_set_mmc_partition(&storage, 1);
sdmmc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
// Read package1.
sdmmc_storage_read(&storage, 0x100000 / NX_EMMC_BLOCKSIZE, 0x40000 / NX_EMMC_BLOCKSIZE, pkg1);
@@ -169,7 +169,7 @@ void dump_packages12()
}
// Dump package2.1.
sdmmc_storage_set_mmc_partition(&storage, 0);
sdmmc_storage_set_mmc_partition(&storage, EMMC_GPP);
// Parse eMMC GPT.
LIST_INIT(gpt);
nx_emmc_gpt_parse(&gpt, &storage);
@@ -271,7 +271,7 @@ void _toggle_autorcm(bool enable)
}
u8 *tempbuf = (u8 *)malloc(0x200);
sdmmc_storage_set_mmc_partition(&storage, 1);
sdmmc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
int i, sect = 0;
u8 corr_mod_byte0;
@@ -344,7 +344,7 @@ void menu_autorcm()
}
u8 *tempbuf = (u8 *)malloc(0x200);
sdmmc_storage_set_mmc_partition(&storage, 1);
sdmmc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
sdmmc_storage_read(&storage, 0x200 / NX_EMMC_BLOCKSIZE, 1, tempbuf);
if ((fuse_read_odm(4) & 3) != 3)

View File

@@ -346,7 +346,7 @@ static int _read_emmc_pkg1(launch_ctxt_t *ctxt)
// Read package1.
ctxt->pkg1 = (void *)malloc(0x40000);
emummc_storage_set_mmc_partition(&storage, 1);
emummc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
emummc_storage_read(&storage, 0x100000 / NX_EMMC_BLOCKSIZE, 0x40000 / NX_EMMC_BLOCKSIZE, ctxt->pkg1);
ctxt->pkg1_id = pkg1_identify(ctxt->pkg1);
if (!ctxt->pkg1_id)
@@ -387,7 +387,7 @@ static u8 *_read_emmc_pkg2(launch_ctxt_t *ctxt)
return NULL;
}
emummc_storage_set_mmc_partition(&storage, 0);
emummc_storage_set_mmc_partition(&storage, EMMC_GPP);
// Parse eMMC GPT.
LIST_INIT(gpt);

View File

@@ -201,7 +201,7 @@ void config_exosphere(launch_ctxt_t *ctxt)
u8 *rsa_mod = (u8 *)malloc(512);
sdmmc_storage_init_mmc(&storage, &sdmmc, SDMMC_BUS_WIDTH_8, SDHCI_TIMING_MMC_HS400);
sdmmc_storage_set_mmc_partition(&storage, 1);
sdmmc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
sdmmc_storage_read(&storage, 1, 1, rsa_mod);
sdmmc_storage_end(&storage);

View File

@@ -103,7 +103,7 @@ void check_sept(ini_sec_t *cfg_sec)
goto out_free;
}
emummc_storage_set_mmc_partition(&storage, 1);
emummc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
// Read package1.
emummc_storage_read(&storage, 0x100000 / NX_EMMC_BLOCKSIZE, 0x40000 / NX_EMMC_BLOCKSIZE, pkg1);

View File

@@ -1155,7 +1155,7 @@ static void _patched_rcm_protection()
return;
u8 *tempbuf = (u8 *)malloc(0x200);
sdmmc_storage_set_mmc_partition(&storage, 1);
sdmmc_storage_set_mmc_partition(&storage, EMMC_BOOT0);
u8 corr_mod_byte0;
int i, sect = 0;