diff --git a/cpu/lm4f120/Makefile.include b/cpu/lm4f120/Makefile.include index 717f1ea64f..0bf9fc06ca 100644 --- a/cpu/lm4f120/Makefile.include +++ b/cpu/lm4f120/Makefile.include @@ -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 diff --git a/cpu/lm4f120/ldscripts/LM4F120H5QR.ld b/cpu/lm4f120/ldscripts/LM4F120H5QR.ld deleted file mode 100644 index 798e0b5966..0000000000 --- a/cpu/lm4f120/ldscripts/LM4F120H5QR.ld +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (C) 2015 Rakendra Thapa - * - * @} - */ -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/lpc1768/Makefile.include b/cpu/lpc1768/Makefile.include index ea1a0f256b..00d062d717 100644 --- a/cpu/lpc1768/Makefile.include +++ b/cpu/lpc1768/Makefile.include @@ -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 diff --git a/cpu/lpc1768/ldscripts/lpc1768.ld b/cpu/lpc1768/ldscripts/lpc1768.ld index e954ee0c11..5381a6ac83 100644 --- a/cpu/lpc1768/ldscripts/lpc1768.ld +++ b/cpu/lpc1768/ldscripts/lpc1768.ld @@ -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 diff --git a/cpu/nrf51/Makefile.include b/cpu/nrf51/Makefile.include index 500a78244b..c95ad04470 100644 --- a/cpu/nrf51/Makefile.include +++ b/cpu/nrf51/Makefile.include @@ -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 diff --git a/cpu/nrf51/ldscripts/nrf51x22xxaa.ld b/cpu/nrf51/ldscripts/nrf51x22xxaa.ld deleted file mode 100644 index 50dbd4e652..0000000000 --- a/cpu/nrf51/ldscripts/nrf51x22xxaa.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_nrf51822 - * @{ - * - * @file - * @brief Memory definitions for the NRF51X22XXAA - * - * @author Hauke Petersen - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 16K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/nrf51/ldscripts/nrf51x22xxab.ld b/cpu/nrf51/ldscripts/nrf51x22xxab.ld deleted file mode 100644 index 805bf913c7..0000000000 --- a/cpu/nrf51/ldscripts/nrf51x22xxab.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_nrf51822 - * @{ - * - * @file - * @brief Memory definitions for the NRF51X22XXAB - * - * @author Hauke Petersen - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 128K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 16K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/nrf51/ldscripts/nrf51x22xxac.ld b/cpu/nrf51/ldscripts/nrf51x22xxac.ld deleted file mode 100644 index 6b755b32bb..0000000000 --- a/cpu/nrf51/ldscripts/nrf51x22xxac.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_nrf51822 - * @{ - * - * @file - * @brief Memory definitions for the NRF51X22XXAC - * - * @author Stephane D'Alu - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00000000, LENGTH = 256K - ram (w!rx) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE cortexm_base.ld diff --git a/cpu/nrf52/Makefile.include b/cpu/nrf52/Makefile.include index 1fa7f149cf..98e984bf87 100644 --- a/cpu/nrf52/Makefile.include +++ b/cpu/nrf52/Makefile.include @@ -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 diff --git a/cpu/nrf5x_common/Makefile.include b/cpu/nrf5x_common/Makefile.include index c4b3dec388..649ecdb290 100644 --- a/cpu/nrf5x_common/Makefile.include +++ b/cpu/nrf5x_common/Makefile.include @@ -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 diff --git a/cpu/nrf9160/Makefile.include b/cpu/nrf9160/Makefile.include index b1d2242c3f..118ee9668c 100644 --- a/cpu/nrf9160/Makefile.include +++ b/cpu/nrf9160/Makefile.include @@ -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 diff --git a/cpu/sam_common/Makefile.include b/cpu/sam_common/Makefile.include index ff1e3f42ca..103ee94dd7 100644 --- a/cpu/sam_common/Makefile.include +++ b/cpu/sam_common/Makefile.include @@ -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 diff --git a/cpu/sam_common/ldscripts/sam3x8e.ld b/cpu/sam_common/ldscripts/sam3x8e.ld deleted file mode 100644 index 0a9d6ddc8b..0000000000 --- a/cpu/sam_common/ldscripts/sam3x8e.ld +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2015 Freie Universität Berlin - * - * This file is subject to the terms and conditions of the GNU Lesser - * General Public License v2.1. See the file LICENSE in the top level - * directory for more details. - */ - -/** - * @addtogroup cpu_sam3 - * @{ - * - * @file - * @brief Memory definitions for the SAM3X8E - * - * @author Hauke Petersen - * - * @} - */ - -MEMORY -{ - rom (rx) : ORIGIN = 0x00080000, LENGTH = 512K - ram (w!rx) : ORIGIN = 0x20070000, LENGTH = 96K -} - -INCLUDE cortexm_base.ld