From d933aa80f792d21bf9673f2e0bd6154408ac6fd9 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Sun, 2 Jun 2024 07:04:17 +0300 Subject: [PATCH] hekate: use IRAM for stack --- bootloader/main.c | 6 +++--- bootloader/start.S | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bootloader/main.c b/bootloader/main.c index aebf302..840c22e 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -1487,10 +1487,10 @@ void ipl_main() // Do initial HW configuration. This is compatible with consecutive reruns without a reset. hw_init(); - // Pivot the stack so we have enough space. - pivot_stack(IPL_STACK_TOP); + // Pivot the stack under IPL. (Only max 4KB is needed). + pivot_stack(IPL_LOAD_ADDR); - // Tegra/Horizon configuration goes to 0x80000000+, package2 goes to 0xA9800000, we place our heap in between. + // Place heap at a place outside of L4T/HOS configuration and binaries. heap_init((void *)IPL_HEAP_START); #ifdef DEBUG_UART_PORT diff --git a/bootloader/start.S b/bootloader/start.S index 269f2c7..d1def0a 100644 --- a/bootloader/start.S +++ b/bootloader/start.S @@ -60,7 +60,8 @@ _reloc_ipl: BX R3 _real_start: - /* Initially, we place our stack in IRAM but will move it to SDRAM later. */ + /* Initially, we place our stack under relocator but will move it to under the payload. */ + /* This depends on application scope. */ LDR SP, =0x4003FF00 LDR R0, =__bss_start EOR R1, R1, R1