/*1* Copyright (c) 2019-2026 CTCaer2*3* This program is free software; you can redistribute it and/or modify it4* under the terms and conditions of the GNU General Public License,5* version 2, as published by the Free Software Foundation.6*7* This program is distributed in the hope it will be useful, but WITHOUT8* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or9* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for10* more details.11*12* You should have received a copy of the GNU General Public License13* along with this program. If not, see <http://www.gnu.org/licenses/>.14*/1516#ifndef _MEMORY_MAP_H_17#define _MEMORY_MAP_H_1819/* --- BIT/BCT: 0x40000000 - 0x40003000 --- */20/* --- IPL: 0x40008000 - 0x40028000 --- */21#define LDR_LOAD_ADDR 0x400070002223#define IPL_LOAD_ADDR 0x4000800024#define IPL_SZ_MAX SZ_128K2526#define XUSB_RING_ADDR 0x40020000 // XUSB EP context and TRB ring buffers.2728#define SECMON_MIN_START 0x4002B000 // Minimum reserved address for secmon.2930#define SDRAM_PARAMS_ADDR 0x40030000 // SDRAM extraction buffer during sdram init.31#define SDRAM_PARAMS_SZ 0x8383233/* start.S / exception_handlers.S */34#define SYS_STACK_TOP_INIT 0x4003FF0035#define FIQ_STACK_TOP 0x4004000036#define IRQ_STACK_TOP 0x4004000037#define IPL_RELOC_ADDR 0x4003FF0038#define IPL_RELOC_SZ 0x1039#define EXCP_STORAGE_ADDR 0x4003FF1040#define EXCP_STORAGE_SZ 0x104142/* --- DRAM START --- */43#define DRAM_START 0x8000000044#define HOS_RSVD SZ_16M // Do not write anything in this area.4546#define NYX_LOAD_ADDR 0x8100000047#define NYX_SZ_MAX SZ_16M48/* --- Gap: 0x82000000 - 0x82FFFFFF --- */4950// Heap buffer.51#define IPL_HEAP_START 0x8200000052#define IPL_HEAP_SZ (SZ_256M)5354#define SMMU_HEAP_ADDR 0x9200000055/* --- Gap: 1280MB 0x96000000 - 0xE4FFFFFF --- */5657// Virtual disk / Chainloader buffers.58#define RAM_DISK_ADDR 0x9500000059#define RAM_DISK_SZ 0x50000000 // 1280MB.6061// L4T Kernel Panic Storage (PSTORE).62#define PSTORE_ADDR 0xB000000063#define PSTORE_SZ SZ_2M6465// NX BIS driver sector cache.66#define NX_BIS_CACHE_ADDR 0xC700000067#define NX_BIS_CACHE_SZ 0x10020000 // 256MB.68#define NX_BIS_LOOKUP_ADDR 0xD800000069#define NX_BIS_LOOKUP_SZ 0x8000000 // 128MB. 512GB eMMC partition max.7071//#define DRAM_LIB_ADDR 0xE000000072/* --- Chnldr: 252MB 0xC03C0000 - 0xCFFFFFFF --- */ //! Only used when chainloading.7374// SDMMC DMA buffer. Used for unaligned DMA buffer address.75#define SDMMC_ALT_DMA_BUFFER 0xE500000076#define SDMMC_ALT_DMA_BUF_SZ SZ_128M7778// Nyx buffers. !Do not change!79#define NYX_STORAGE_ADDR 0xED00000080#define NYX_STR_SZ SZ_16M81#define NYX_RES_ADDR 0xEE00000082#define NYX_RES_SZ SZ_16M8384// SDMMC Application DMA aligned buffers.85#define SDXC_BUF_ALIGNED 0xEF000000 // Also used by UMS.86#define EMMC_BUF_ALIGNED 0xF000000087#define MIXD_BUF_ALIGNED EMMC_BUF_ALIGNED88#define SDMMC_DMA_BUF_SZ SZ_16M // 4MB currently used.8990// Nyx LvGL buffers.91#define NYX_LV_VDB_ADR 0xF100000092#define NYX_FB_SZ 0x384000 // 1280 x 720 x 4.93#define NYX_LV_MEM_ADR 0xF140000094#define NYX_LV_MEM_SZ 0x6600000 // 70MB.9596// Framebuffer addresses. !Do not change!97#define IPL_FB_ADDRESS 0xF5A0000098#define IPL_FB_SZ 0x384000 // 720 x 1280 x 4.99#define LOG_FB_ADDRESS 0xF5E00000100#define LOG_FB_SZ 0x334000 // 1280 x 656 x 4.101#define NYX_FB_ADDRESS 0xF6200000102#define NYX_FB2_ADDRESS 0xF6600000103#define NYX_FB_SZ 0x384000 // 1280 x 720 x 4.104105// USB buffers.106#define USBD_ADDR 0xFEF00000107#define USB_DESCRIPTOR_ADDR 0xFEF40000108#define USB_EP_CONTROL_BUF_ADDR 0xFEF80000109#define USB_EP_BULK_IN_BUF_ADDR 0xFF000000110#define USB_EP_BULK_OUT_BUF_ADDR 0xFF800000111#define USB_EP_BULK_OUT_MAX_XFER SZ_8M112113// #define EXT_PAYLOAD_ADDR 0xC0000000114// #define RCM_PAYLOAD_ADDR (EXT_PAYLOAD_ADDR + ALIGN(PATCHED_RELOC_SZ, 0x10))115116#endif117118119