rockbox/firmware/target/arm/stm32/app.lds
Aidan MacDonald d15bb5f848 stm32h7: move LCD framebuffer to AXI SRAM
Framebuffer access consumes a lot of SDRAM bandwidth.
Moving it to AXI SRAM should be a big improvement as
it's around 8x faster (2x clock speed, 4x bus width).

Also take advantage of explicitly assigning sections
to the special :NONE segment, which means they will
not appear in any ELF program header and thus aren't
visible to the bootloader. They can then overlap
areas used by the bootloader -- by the time they're
written, the bootloader will be long gone -- making
it easier to make efficient use of SRAM.

Change-Id: I2392fd23b17472cc08dc5fe4556f6def3cc186ed
2026-01-27 10:04:59 -05:00

82 lines
1.7 KiB
Text

#include "cpu.h"
ENTRY(crt0_start)
OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
STARTUP(target/arm/stm32/crt0-stm32h7.o)
MEMORY
{
DTCM (rw) : ORIGIN = STM32_DTCM_BASE, LENGTH = STM32_DTCM_SIZE
ITCM (rx) : ORIGIN = STM32_ITCM_BASE, LENGTH = STM32_ITCM_SIZE
SRAM_AXI (rw) : ORIGIN = STM32_SRAM_AXI_BASE, LENGTH = STM32_SRAM_AXI_SIZE
SDRAM (rwx) : ORIGIN = STM32_SDRAM1_BASE, LENGTH = MEMORYSIZE * 1024 * 1024
}
PHDRS
{
itcm PT_LOAD;
sdram PT_LOAD;
}
SECTIONS
{
.itext :
{
KEEP(*(.vectors.arm));
KEEP(*(.vectors.platform));
*(.icode*);
} > ITCM :itcm
.stack (NOLOAD) : ALIGN(8)
{
irqstackbegin = .;
. += 0x400;
irqstackend = .;
stackbegin = .;
. += 0x2000;
stackend = .;
} > DTCM :NONE
.framebuffer (NOLOAD) :
{
*(.framebuffer);
} > SRAM_AXI :NONE
.text :
{
loadaddress = .; /* only needed to keep ROLO happy */
*(.init*);
*(.text*);
} > SDRAM :sdram
.rodata :
{
*(.rodata*);
} > SDRAM :sdram
.data :
{
*(.data*);
} > SDRAM :sdram
.bss (NOLOAD) :
{
_bssbegin = .;
*(.bss*);
*(COMMON);
_bssend = .;
} > SDRAM :sdram
audiobuffer = ALIGN(32);
audiobufend = ORIGIN(SDRAM) + LENGTH(SDRAM) - CODEC_SIZE - PLUGIN_BUFFER_SIZE;
codecbuf = audiobufend;
pluginbuf = codecbuf + CODEC_SIZE;
}
EXTERN(__vectors_arm);
EXTERN(__vectors_platform);
ASSERT(DEFINED(__vectors_arm), "ARM exception vectors are not defined.");
ASSERT(DEFINED(__vectors_platform), "Platform exception vectors are not defined.");