From e93802aec7e7839710281824ce2e9e4689b3a01d Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Wed, 30 Oct 2024 23:14:11 +0100 Subject: [PATCH] ipl3: remove leftovers of stage1 stack in cache --- boot/loader.c | 5 ----- boot/loader.h | 11 ++--------- boot/loader_compat.c | 5 ----- 3 files changed, 2 insertions(+), 19 deletions(-) diff --git a/boot/loader.c b/boot/loader.c index 22ec6441c3..abb80f32b9 100644 --- a/boot/loader.c +++ b/boot/loader.c @@ -246,11 +246,6 @@ void stage2(void) { debugf("Hello from RDRAM ", __builtin_frame_address(0)); - // Invalidate the stack1 area, where the first stage put its stack. - // We don't need it anymore, and we don't want it to be flushed to RDRAM - // that will be cleared anyway. - data_cache_hit_invalidate(STACK1_BASE, STACK1_SIZE); - // Search for the ELF header. We search for a 256-byte aligned header // starting at offset 0x1000 in the ROM area (after the IPL3). // We search for 64 MiB of ROM space (takes only a couple of seconds) diff --git a/boot/loader.h b/boot/loader.h index 5c2d0c2d9e..f317ca645e 100644 --- a/boot/loader.h +++ b/boot/loader.h @@ -3,16 +3,9 @@ // The loader is run directly from RDRAM for speed. We reserve a portion at // the end of RDRAM for it. -#define LOADER_SIZE (28*1024) +#define LOADER_SIZE (32*1024) -// We put the first stage stack into the cache, at the same address as the loader. -// We reserve 4 KiB to it. -#define STACK1_SIZE (4*1024) - -#define TOTAL_RESERVED_SIZE (LOADER_SIZE + STACK1_SIZE) - -#define STACK1_BASE (void*)(0x80800000 - LOADER_SIZE - STACK1_SIZE) -#define STACK1_TOP (void*)(0x80800000 - LOADER_SIZE) +#define TOTAL_RESERVED_SIZE (LOADER_SIZE) #define LOADER_BASE(memsize, stage2size) (void*)(0x80000000 + (memsize) - (stage2size)) #define STACK2_TOP(memsize, stage2size) (LOADER_BASE(memsize, stage2size) - 16) diff --git a/boot/loader_compat.c b/boot/loader_compat.c index ac6cfb5d6e..52298f1722 100644 --- a/boot/loader_compat.c +++ b/boot/loader_compat.c @@ -36,11 +36,6 @@ static void pi_wait(void) __attribute__((used)) void stage2(void) { - // Invalidate the stack1 area, where the first stage put its stack. - // We don't need it anymore, and we don't want it to be flushed to RDRAM - // that will be cleared anyway. - data_cache_hit_invalidate(STACK1_BASE, STACK1_SIZE); - uint32_t entrypoint = io_read32(0x10000008); uint32_t size = io_read32(0x10000010); if (size == 0 || size > (8<<20) - (entrypoint & 0x1FFFFFFF) - TOTAL_RESERVED_SIZE)