/*1* Copyright (c) 2019-2021 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.3132/* start.S / exception_handlers.S */33#define SYS_STACK_TOP_INIT 0x4003FF0034#define FIQ_STACK_TOP 0x4004000035#define IRQ_STACK_TOP 0x4004000036#define IPL_RELOC_ADDR 0x4003FF0037#define IPL_RELOC_SZ 0x1038#define EXCP_STORAGE_ADDR 0x4003FFF039#define EXCP_STORAGE_SZ 0x104041/* --- DRAM START --- */42#define DRAM_START 0x8000000043#define HOS_RSVD SZ_16M // Do not write anything in this area.4445#define NYX_LOAD_ADDR 0x8100000046#define NYX_SZ_MAX SZ_16M47/* --- Gap: 0x82000000 - 0x82FFFFFF --- */4849/* Stack theoretical max: 33MB */50#define IPL_STACK_TOP 0x8310000051#define IPL_HEAP_START 0x8400000052#define IPL_HEAP_SZ (SZ_512M - SZ_64M)5354#define SMMU_HEAP_ADDR 0xA000000055/* --- Gap: 1040MB 0xA4000000 - 0xE4FFFFFF --- */5657// Virtual disk / Chainloader buffers.58#define RAM_DISK_ADDR 0xA400000059#define RAM_DISK_SZ 0x41000000 // 1040MB.60#define RAM_DISK2_SZ 0x21000000 // 528MB.6162// NX BIS driver sector cache.63#define NX_BIS_CACHE_ADDR 0xC500000064#define NX_BIS_CACHE_SZ 0x10020000 // 256MB.65#define NX_BIS_LOOKUP_ADDR 0xD600000066#define NX_BIS_LOOKUP_SZ 0xF000000 // 240MB.6768// L4T Kernel Panic Storage (PSTORE).69#define PSTORE_ADDR 0xB000000070#define PSTORE_SZ SZ_2M7172//#define DRAM_LIB_ADDR 0xE000000073/* --- Chnldr: 252MB 0xC03C0000 - 0xCFFFFFFF --- */ //! Only used when chainloading.7475// SDMMC DMA buffers 176#define SDMMC_UPPER_BUFFER 0xE500000077#define SDMMC_UP_BUF_SZ SZ_128M7879// Nyx buffers.80#define NYX_STORAGE_ADDR 0xED00000081#define NYX_RES_ADDR 0xEE00000082#define NYX_RES_SZ SZ_16M8384// SDMMC DMA buffers 285#define SDXC_BUF_ALIGNED 0xEF00000086#define MIXD_BUF_ALIGNED 0xF000000087#define EMMC_BUF_ALIGNED MIXD_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.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/* OBSOLETE: Very old hwinit based payloads were setting a carveout here. */106#define DRAM_MEM_HOLE_ADR 0xF6A00000107#define DRAM_MEM_HOLE_SZ 0x8140000108/* --- Hole: 129MB 0xF6A00000 - 0xFEB3FFFF --- */109#define DRAM_START2 0xFEB40000110111// USB buffers.112#define USBD_ADDR 0xFEF00000113#define USB_DESCRIPTOR_ADDR 0xFEF40000114#define USB_EP_CONTROL_BUF_ADDR 0xFEF80000115#define USB_EP_BULK_IN_BUF_ADDR 0xFF000000116#define USB_EP_BULK_OUT_BUF_ADDR 0xFF800000117#define USB_EP_BULK_OUT_MAX_XFER SZ_8M118119// #define EXT_PAYLOAD_ADDR 0xC0000000120// #define RCM_PAYLOAD_ADDR (EXT_PAYLOAD_ADDR + ALIGN(PATCHED_RELOC_SZ, 0x10))121// #define COREBOOT_ADDR (0xD0000000 - rom_size)122123#endif124125126