Skip to content

Commit

Permalink
Merge pull request #18636 from benpicco/cpu/cortexm.ld
Browse files Browse the repository at this point in the history
cpu: make use of `cortexm.ld`
  • Loading branch information
benpicco authored Sep 28, 2022
2 parents 826795e + a3b2382 commit 09fd98c
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 149 deletions.
8 changes: 8 additions & 0 deletions cpu/lm4f120/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
ROM_LEN ?= 0x40000
RAM_LEN ?= 0x8000

ROM_START_ADDR ?= 0x00000000
RAM_START_ADDR ?= 0x20000000

LINKER_SCRIPT ?= cortexm.ld

include $(RIOTMAKE)/arch/cortexm.inc.mk

include $(RIOTCPU)/stellaris_common/Makefile.include
26 changes: 0 additions & 26 deletions cpu/lm4f120/ldscripts/LM4F120H5QR.ld

This file was deleted.

6 changes: 6 additions & 0 deletions cpu/lpc1768/Makefile.include
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
ROM_START_ADDR ?= 0x0
RAM_START_ADDR ?= 0x100000C8

ROM_LEN ?= 0x80000
RAM_LEN ?= 0x7f38 # 32K - 0xC8

include $(RIOTMAKE)/arch/cortexm.inc.mk
4 changes: 1 addition & 3 deletions cpu/lpc1768/ldscripts/lpc1768.ld
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@

MEMORY
{
rom (rx) : ORIGIN = 0x00000000, LENGTH = 512K
ram (w!rx) : ORIGIN = 0x100000C8, LENGTH = (32K - 0xC8)
usb_ram : ORIGIN = 0x2007C000, LENGTH = 16K
eth_ram : ORIGIN = 0x20080000, LENGTH = 16K
}

INCLUDE cortexm_base.ld
INCLUDE cortexm.ld
16 changes: 16 additions & 0 deletions cpu/nrf51/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,2 +1,18 @@
ROM_START_ADDR ?= 0

# Set ROM and RAM lengths according to CPU model
ifneq (,$(filter nrf51x22xxaa nrf51x22xxab,$(CPU_MODEL)))
ROM_LEN ?= 0x40000
RAM_LEN ?= 0x4000
endif
ifneq (,$(filter nrf51x22xxaa,$(CPU_MODEL)))
ROM_LEN ?= 0x20000
RAM_LEN ?= 0x4000
endif
ifneq (,$(filter nrf51x22xxac,$(CPU_MODEL)))
ROM_LEN ?= 0x40000
RAM_LEN ?= 0x8000
endif

include $(RIOTCPU)/nrf5x_common/Makefile.include
include $(RIOTMAKE)/arch/cortexm.inc.mk
27 changes: 0 additions & 27 deletions cpu/nrf51/ldscripts/nrf51x22xxaa.ld

This file was deleted.

27 changes: 0 additions & 27 deletions cpu/nrf51/ldscripts/nrf51x22xxab.ld

This file was deleted.

27 changes: 0 additions & 27 deletions cpu/nrf51/ldscripts/nrf51x22xxac.ld

This file was deleted.

5 changes: 0 additions & 5 deletions cpu/nrf52/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ ifneq (,$(filter nrf52840xxaa,$(CPU_MODEL)))
RAM_LEN ?= 0x40000
endif

ROM_START_ADDR ?= 0x00000000
RAM_START_ADDR ?= 0x20000000

LINKER_SCRIPT ?= cortexm.ld

VECTORS_O ?= $(BINDIR)/nrf52_vectors/vectors_$(CPU_MODEL).o

include $(RIOTCPU)/nrf5x_common/Makefile.include
Expand Down
5 changes: 5 additions & 0 deletions cpu/nrf5x_common/Makefile.include
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))

ROM_START_ADDR ?= 0x00000000
RAM_START_ADDR ?= 0x20000000

LINKER_SCRIPT ?= cortexm.ld

INCLUDES += -I$(RIOTCPU)/nrf5x_common/include
5 changes: 0 additions & 5 deletions cpu/nrf9160/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
ROM_LEN ?= 0x100000
RAM_LEN ?= 0x40000

ROM_START_ADDR ?= 0x00000000
RAM_START_ADDR ?= 0x20000000

LINKER_SCRIPT ?= cortexm.ld

FLASHFILE ?= $(BINFILE)

PROGRAMMER ?= jlink
Expand Down
9 changes: 7 additions & 2 deletions cpu/sam_common/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ CFLAGS += -DCPU_FAM_$(call uppercase_and_underscore,$(CPU_FAM))
# this CPU implementation doesn't use CMSIS initialization
CFLAGS += -DDONT_USE_CMSIS_INIT

# for the sam[drl] CPUs we hold all linkerscripts in the sam0 common folder
LINKFLAGS += -L$(RIOTCPU)/sam_common/ldscripts
ROM_START_ADDR ?= 0x80000
RAM_START_ADDR ?= 0x20070000

ROM_LEN ?= 0x80000
RAM_LEN ?= 0x18000

LINKER_SCRIPT ?= cortexm.ld

INCLUDES += -I$(RIOTCPU)/sam_common/include
27 changes: 0 additions & 27 deletions cpu/sam_common/ldscripts/sam3x8e.ld

This file was deleted.

0 comments on commit 09fd98c

Please sign in to comment.