From 08c165f2b085579f46a86d395e63c7a3a1a0c8fb Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Mon, 8 Oct 2018 10:43:07 -0700 Subject: [PATCH] arm: cypress/psoc6: add SoC specific linker input sections The Cypress PSoC6 specifies some input sections in the startup scripts. These sections (.heap, .stack, etc.) need to be placed at correct location. Signed-off-by: Daniel Leung --- include/arch/arm/cortex_m/scripts/linker.ld | 2 ++ soc/arm/cypress/psoc6/Kconfig.series | 2 ++ soc/arm/cypress/psoc6/soc-noinit.ld | 16 ++++++++++++++++ soc/arm/cypress/psoc6/soc-rwdata.ld | 6 ++++++ 4 files changed, 26 insertions(+) create mode 100644 soc/arm/cypress/psoc6/soc-noinit.ld create mode 100644 soc/arm/cypress/psoc6/soc-rwdata.ld diff --git a/include/arch/arm/cortex_m/scripts/linker.ld b/include/arch/arm/cortex_m/scripts/linker.ld index 90d8cca5e0e..67089c44c0c 100644 --- a/include/arch/arm/cortex_m/scripts/linker.ld +++ b/include/arch/arm/cortex_m/scripts/linker.ld @@ -114,6 +114,8 @@ SECTIONS KEEP(*(IRQ_VECTOR_TABLE)) + KEEP(*(.vectors)) + KEEP(*(.openocd_dbg)) KEEP(*(".openocd_dbg.*")) diff --git a/soc/arm/cypress/psoc6/Kconfig.series b/soc/arm/cypress/psoc6/Kconfig.series index 73ee3b7f028..aa1f820b425 100644 --- a/soc/arm/cypress/psoc6/Kconfig.series +++ b/soc/arm/cypress/psoc6/Kconfig.series @@ -11,5 +11,7 @@ config SOC_SERIES_PSOC62 select SYS_POWER_LOW_POWER_STATE_SUPPORTED select CPU_HAS_SYSTICK select HAS_CYPRESS_DRIVERS + select SOC_NOINIT_LD + select SOC_RWDATA_LD help Enable support for Cypress PSoC6 MCU series diff --git a/soc/arm/cypress/psoc6/soc-noinit.ld b/soc/arm/cypress/psoc6/soc-noinit.ld new file mode 100644 index 00000000000..8b22d4ed0e6 --- /dev/null +++ b/soc/arm/cypress/psoc6/soc-noinit.ld @@ -0,0 +1,16 @@ + /* + * Extracted from: + * ext/hal/cypress/.../devices/psoc6/linker/gcc/cy8c6xx6_cm0plus.ld + * + * Size of sections are calculated in the startup scripts, + * so they don't have to be specified here. + */ + + . = ALIGN(8); + KEEP(*(.ram_vectors)) + + . = ALIGN(4); + KEEP(*(.heap)) + + . = ALIGN(4); + KEEP(*(.stack)) diff --git a/soc/arm/cypress/psoc6/soc-rwdata.ld b/soc/arm/cypress/psoc6/soc-rwdata.ld new file mode 100644 index 00000000000..49169cdcdd9 --- /dev/null +++ b/soc/arm/cypress/psoc6/soc-rwdata.ld @@ -0,0 +1,6 @@ + /* + * Extracted from: + * ext/hal/cypress/.../devices/psoc6/linker/gcc/cy8c6xx6_cm0plus.ld + */ + + KEEP(*(.cy_ramfunc))