Skip to content

Commit

Permalink
ipl3: remove leftovers of stage1 stack in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Oct 30, 2024
1 parent 45d8ef4 commit e93802a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
5 changes: 0 additions & 5 deletions boot/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 2 additions & 9 deletions boot/loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions boot/loader_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e93802a

Please sign in to comment.