Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
CTCaer
GitHub Repository: CTCaer/hekate
Path: blob/master/bdk/memory_map.h
1471 views
1
/*
2
* Copyright (c) 2019-2021 CTCaer
3
*
4
* This program is free software; you can redistribute it and/or modify it
5
* under the terms and conditions of the GNU General Public License,
6
* version 2, as published by the Free Software Foundation.
7
*
8
* This program is distributed in the hope it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
* more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
15
*/
16
17
#ifndef _MEMORY_MAP_H_
18
#define _MEMORY_MAP_H_
19
20
/* --- BIT/BCT: 0x40000000 - 0x40003000 --- */
21
/* --- IPL: 0x40008000 - 0x40028000 --- */
22
#define LDR_LOAD_ADDR 0x40007000
23
24
#define IPL_LOAD_ADDR 0x40008000
25
#define IPL_SZ_MAX SZ_128K
26
27
#define XUSB_RING_ADDR 0x40020000 // XUSB EP context and TRB ring buffers.
28
29
#define SECMON_MIN_START 0x4002B000 // Minimum reserved address for secmon.
30
31
#define SDRAM_PARAMS_ADDR 0x40030000 // SDRAM extraction buffer during sdram init.
32
33
/* start.S / exception_handlers.S */
34
#define SYS_STACK_TOP_INIT 0x4003FF00
35
#define FIQ_STACK_TOP 0x40040000
36
#define IRQ_STACK_TOP 0x40040000
37
#define IPL_RELOC_ADDR 0x4003FF00
38
#define IPL_RELOC_SZ 0x10
39
#define EXCP_STORAGE_ADDR 0x4003FFF0
40
#define EXCP_STORAGE_SZ 0x10
41
42
/* --- DRAM START --- */
43
#define DRAM_START 0x80000000
44
#define HOS_RSVD SZ_16M // Do not write anything in this area.
45
46
#define NYX_LOAD_ADDR 0x81000000
47
#define NYX_SZ_MAX SZ_16M
48
/* --- Gap: 0x82000000 - 0x82FFFFFF --- */
49
50
/* Stack theoretical max: 33MB */
51
#define IPL_STACK_TOP 0x83100000
52
#define IPL_HEAP_START 0x84000000
53
#define IPL_HEAP_SZ (SZ_512M - SZ_64M)
54
55
#define SMMU_HEAP_ADDR 0xA0000000
56
/* --- Gap: 1040MB 0xA4000000 - 0xE4FFFFFF --- */
57
58
// Virtual disk / Chainloader buffers.
59
#define RAM_DISK_ADDR 0xA4000000
60
#define RAM_DISK_SZ 0x41000000 // 1040MB.
61
#define RAM_DISK2_SZ 0x21000000 // 528MB.
62
63
// NX BIS driver sector cache.
64
#define NX_BIS_CACHE_ADDR 0xC5000000
65
#define NX_BIS_CACHE_SZ 0x10020000 // 256MB.
66
#define NX_BIS_LOOKUP_ADDR 0xD6000000
67
#define NX_BIS_LOOKUP_SZ 0xF000000 // 240MB.
68
69
// L4T Kernel Panic Storage (PSTORE).
70
#define PSTORE_ADDR 0xB0000000
71
#define PSTORE_SZ SZ_2M
72
73
//#define DRAM_LIB_ADDR 0xE0000000
74
/* --- Chnldr: 252MB 0xC03C0000 - 0xCFFFFFFF --- */ //! Only used when chainloading.
75
76
// SDMMC DMA buffers 1
77
#define SDMMC_UPPER_BUFFER 0xE5000000
78
#define SDMMC_UP_BUF_SZ SZ_128M
79
80
// Nyx buffers.
81
#define NYX_STORAGE_ADDR 0xED000000
82
#define NYX_RES_ADDR 0xEE000000
83
#define NYX_RES_SZ SZ_16M
84
85
// SDMMC DMA buffers 2
86
#define SDXC_BUF_ALIGNED 0xEF000000
87
#define MIXD_BUF_ALIGNED 0xF0000000
88
#define EMMC_BUF_ALIGNED MIXD_BUF_ALIGNED
89
#define SDMMC_DMA_BUF_SZ SZ_16M // 4MB currently used.
90
91
// Nyx LvGL buffers.
92
#define NYX_LV_VDB_ADR 0xF1000000
93
#define NYX_FB_SZ 0x384000 // 1280 x 720 x 4.
94
#define NYX_LV_MEM_ADR 0xF1400000
95
#define NYX_LV_MEM_SZ 0x6600000 // 70MB.
96
97
// Framebuffer addresses.
98
#define IPL_FB_ADDRESS 0xF5A00000
99
#define IPL_FB_SZ 0x384000 // 720 x 1280 x 4.
100
#define LOG_FB_ADDRESS 0xF5E00000
101
#define LOG_FB_SZ 0x334000 // 1280 x 656 x 4.
102
#define NYX_FB_ADDRESS 0xF6200000
103
#define NYX_FB2_ADDRESS 0xF6600000
104
#define NYX_FB_SZ 0x384000 // 1280 x 720 x 4.
105
106
/* OBSOLETE: Very old hwinit based payloads were setting a carveout here. */
107
#define DRAM_MEM_HOLE_ADR 0xF6A00000
108
#define DRAM_MEM_HOLE_SZ 0x8140000
109
/* --- Hole: 129MB 0xF6A00000 - 0xFEB3FFFF --- */
110
#define DRAM_START2 0xFEB40000
111
112
// USB buffers.
113
#define USBD_ADDR 0xFEF00000
114
#define USB_DESCRIPTOR_ADDR 0xFEF40000
115
#define USB_EP_CONTROL_BUF_ADDR 0xFEF80000
116
#define USB_EP_BULK_IN_BUF_ADDR 0xFF000000
117
#define USB_EP_BULK_OUT_BUF_ADDR 0xFF800000
118
#define USB_EP_BULK_OUT_MAX_XFER SZ_8M
119
120
// #define EXT_PAYLOAD_ADDR 0xC0000000
121
// #define RCM_PAYLOAD_ADDR (EXT_PAYLOAD_ADDR + ALIGN(PATCHED_RELOC_SZ, 0x10))
122
// #define COREBOOT_ADDR (0xD0000000 - rom_size)
123
124
#endif
125
126