diff --git a/bdk/memory_map.h b/bdk/memory_map.h index 70f1354..1db19f1 100644 --- a/bdk/memory_map.h +++ b/bdk/memory_map.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2021 CTCaer + * Copyright (c) 2019 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, @@ -19,8 +19,8 @@ //#define IPL_STACK_TOP 0x4003FF00 /* --- BIT/BCT: 0x40000000 - 0x40003000 --- */ -/* --- IPL: 0x40008000 - 0x40028000 --- */ -#define LDR_LOAD_ADDR 0x40007000 +/* --- IPL: 0x40003000 - 0x40028000 --- */ +#define LDR_LOAD_ADDR 0x40003000 #define IPL_LOAD_ADDR 0x40008000 #define IPL_SZ_MAX 0x20000 // 128KB. @@ -49,14 +49,8 @@ // Virtual disk / Chainloader buffers. #define RAM_DISK_ADDR 0xA4000000 +#define NX_BIS_CACHE_ADDR RAM_DISK_ADDR #define RAM_DISK_SZ 0x41000000 // 1040MB. -#define RAM_DISK2_SZ 0x21000000 // 528MB. - -// NX BIS driver sector cache. -#define NX_BIS_CACHE_ADDR 0xC5000000 -#define NX_BIS_CACHE_SZ 0x10020000 // 256MB. -#define NX_BIS_LOOKUP_ADDR 0xD6000000 -#define NX_BIS_LOOKUP_SZ 0xF000000 // 240MB. // L4T Kernel Panic Storage (PSTORE). #define PSTORE_ADDR 0xB0000000 @@ -97,10 +91,15 @@ #define NYX_FB_SZ 0x384000 // 1280 x 720 x 4. #define DRAM_MEM_HOLE_ADR 0xF6A00000 +#define NX_BIS_LOOKUP_ADR DRAM_MEM_HOLE_ADR #define DRAM_MEM_HOLE_SZ 0x8140000 /* --- Hole: 129MB 0xF6A00000 - 0xFEB3FFFF --- */ #define DRAM_START2 0xFEB40000 +// NX BIS driver sector cache. +// #define NX_BIS_CACHE_ADDR 0xFEE00000 +// #define NX_BIS_CACHE_SZ 0x100000 + // USB buffers. #define USBD_ADDR 0xFEF00000 #define USB_DESCRIPTOR_ADDR 0xFEF40000 diff --git a/source/storage/nx_emmc_bis.c b/source/storage/nx_emmc_bis.c index d68db18..e551a13 100644 --- a/source/storage/nx_emmc_bis.c +++ b/source/storage/nx_emmc_bis.c @@ -318,8 +318,8 @@ void nx_emmc_bis_cluster_cache_init() free(cluster_lookup_buf); // Check if carveout protected, in case of old hwinit (pre 4.0.0) chainload. - *(vu32 *)NX_BIS_LOOKUP_ADDR = 0; - if (*(vu32 *)NX_BIS_LOOKUP_ADDR != 0) + *(vu32 *)NX_BIS_LOOKUP_ADR = 0; + if (*(vu32 *)NX_BIS_LOOKUP_ADR != 0) { cluster_lookup_buf = (u32 *)malloc(cluster_lookup_size + 0x2000); cluster_lookup = (u32 *)ALIGN((u32)cluster_lookup_buf, 0x1000); @@ -327,7 +327,7 @@ void nx_emmc_bis_cluster_cache_init() else { cluster_lookup_buf = NULL; - cluster_lookup = (u32 *)NX_BIS_LOOKUP_ADDR; + cluster_lookup = (u32 *)NX_BIS_LOOKUP_ADR; } // Clear cluster lookup table and reset end index.