Skip to content

Commit

Permalink
Refactor linker scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
saursin committed Mar 10, 2024
1 parent a3f8e88 commit adea8a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
14 changes: 6 additions & 8 deletions sw/lib/link/link_bootloader.ld
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@ ENTRY(_start)
MEMORY
{
BOOT_ROM (rx): ORIGIN = 0x00010000, LENGTH = 8K

CODE_RAM (rx): ORIGIN = 0x20000000, LENGTH = 40K
DATA_RAM (rwx): ORIGIN = 0x2000a000, LENGTH = 8K
RAM (rx): ORIGIN = 0x20000000, LENGTH = 48K
}

__bootrom_start = ORIGIN(BOOT_ROM);
__bootrom_size = LENGTH(BOOT_ROM);
__approm_start = ORIGIN(CODE_RAM);
__approm_size = LENGTH(CODE_RAM);
__approm_start = ORIGIN(RAM);
__approm_size = LENGTH(RAM);


SECTIONS
Expand Down Expand Up @@ -70,7 +68,7 @@ SECTIONS
. = ALIGN(4);
_edata = .;

} > DATA_RAM AT> BOOT_ROM
} > RAM AT> BOOT_ROM


/* ----- Uninitialized Data ----- */
Expand All @@ -86,10 +84,10 @@ SECTIONS
. = ALIGN(4);
_ebss = .;

} > DATA_RAM AT> BOOT_ROM
} > RAM AT> BOOT_ROM

_end = .;
}

PROVIDE(_start_heap = _ebss);
PROVIDE(_stack_pointer = ORIGIN(DATA_RAM) + LENGTH(DATA_RAM));
PROVIDE(_stack_pointer = ORIGIN(RAM) + LENGTH(RAM));
4 changes: 2 additions & 2 deletions sw/lib/link/link_hydrogensoc.ld
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ ENTRY(_start)
/* MEMORY LAYOUT */
MEMORY
{
CODE_RAM (rx): ORIGIN = 0x20000000, LENGTH = 40K
DATA_RAM (rwx): ORIGIN = 0x2000a000, LENGTH = 8K
CODE_RAM (rx): ORIGIN = 0x20000000, LENGTH = 36K
DATA_RAM (rwx): ORIGIN = (ORIGIN(CODE_RAM) + LENGTH(CODE_RAM)), LENGTH = 12K
}

__coderam_start = ORIGIN(CODE_RAM);
Expand Down

0 comments on commit adea8a6

Please sign in to comment.