foboot: move software stuff to sw directory

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
2019-03-05 08:52:47 +08:00
parent 2ac79e45e9
commit 84d4b40897
36 changed files with 0 additions and 2048 deletions

55
sw/ld/linker.ld Normal file
View File

@ -0,0 +1,55 @@
INCLUDE ld/output_format.ld
ENTRY(_start)
__DYNAMIC = 0;
INCLUDE ld/regions.ld
SECTIONS
{
.text :
{
_ftext = .;
*(.text.start)
*(.text .stub .text.* .gnu.linkonce.t.*)
_etext = .;
} > rom
.rodata :
{
. = ALIGN(4);
_frodata = .;
*(.rodata .rodata.* .gnu.linkonce.r.*)
*(.rodata1)
*(.srodata)
_erodata = .;
} > rom
.data : AT (ADDR(.rodata) + SIZEOF (.rodata))
{
. = ALIGN(4);
_fdata = .;
*(.data .data.* .gnu.linkonce.d.*)
*(.data1)
_gp = ALIGN(16);
*(.sdata .sdata.* .gnu.linkonce.s.* .sdata2 .sdata2.*)
_edata = ALIGN(16); /* Make sure _edata is >= _gp. */
} > sram
.bss :
{
. = ALIGN(4);
_fbss = .;
*(.dynsbss)
*(.sbss .sbss.* .gnu.linkonce.sb.*)
*(.scommon)
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN(4);
_ebss = .;
_end = .;
} > sram
}
PROVIDE(_fstack = ORIGIN(sram) + LENGTH(sram) - 4);

1
sw/ld/output_format.ld Normal file
View File

@ -0,0 +1 @@
OUTPUT_FORMAT("elf32-littleriscv")

5
sw/ld/regions.ld Normal file
View File

@ -0,0 +1,5 @@
MEMORY {
spiflash : ORIGIN = 0x20000000, LENGTH = 0x00200000
sram : ORIGIN = 0x10000000, LENGTH = 0x00020000
rom : ORIGIN = 0x00000000, LENGTH = 0x00002000
}