jz47xx: Add support for INIT region

Change-Id: I100cd661e9b1225167463542800c6aafbc3c17b3
This commit is contained in:
Solomon Peachy 2023-01-04 22:10:48 -05:00
parent fe16ab33dd
commit 641e91aa2f
5 changed files with 41 additions and 8 deletions

View file

@ -1,4 +1,6 @@
#include "config.h"
#define __ASSEMBLY__
#include "cpu.h"
OUTPUT_FORMAT("elf32-littlemips")
OUTPUT_ARCH(MIPS)
@ -20,10 +22,15 @@ INPUT(target/mips/system-mips.o)
/* Where the codec buffer ends, and the plugin buffer starts */
#define ENDCODECADDR (ENDAUDIOADDR + CODEC_SIZE)
/* Place init code in the codec buffer */
#define INITBASE ENDAUDIOADDR
#define INITSIZE CODEC_SIZE
MEMORY
{
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
INIT : ORIGIN = INITBASE, LENGTH = INITSIZE
}
SECTIONS
@ -40,6 +47,9 @@ SECTIONS
.text :
{
*(.text*);
#ifndef HAVE_INIT_ATTR
*(.init*);
#endif
} > DRAM
. = ALIGN(4);
@ -81,6 +91,16 @@ SECTIONS
} > IRAM
_iramcopy = LOADADDR(.iram);
#ifdef HAVE_INIT_ATTR
.init :
{
_initstart = .;
*(.init*);
_initend = .;
} > INIT AT> DRAM
_initcopy = LOADADDR(.init);
#endif
. = ALIGN(4);
.stack (NOLOAD):