From f78f7076aa7461af450b4f50c3a81bea870a039d Mon Sep 17 00:00:00 2001 From: Loic Poulain Date: Mon, 16 Sep 2019 14:59:22 +0200 Subject: [PATCH] soc: nxp: rt: Add custom memory areas to linker script RT SOCs have several memory areas (OCRAMs, DTCM, ITCM, SDRAM, FLASH...) but only two are selected for FLASH (code) and RAM (data). It would be good to let the linker be aware about other regions, which could then be used by drivers or application to create dedicated sections and relocate memory. For example if we have code in ITCM and data in DTCM, we still need a dma-able region/section for e.g. video/camera buffers. Signed-off-by: Loic Poulain --- soc/arm/nxp_imx/rt/linker.ld | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/soc/arm/nxp_imx/rt/linker.ld b/soc/arm/nxp_imx/rt/linker.ld index ad3736715ad..fd951b5eb86 100644 --- a/soc/arm/nxp_imx/rt/linker.ld +++ b/soc/arm/nxp_imx/rt/linker.ld @@ -4,4 +4,23 @@ * SPDX-License-Identifier: Apache-2.0 */ + #include + #include + +MEMORY + { +#if (DT_MMIO_SRAM_20200000_SIZE > 0) && !defined(CONFIG_DATA_OCRAM) + OCRAM (wx) : ORIGIN = DT_MMIO_SRAM_20200000_BASE_ADDRESS, LENGTH = DT_MMIO_SRAM_20200000_SIZE +#endif +#if (DT_MMIO_SRAM_80000000_SIZE > 0) && !defined(CONFIG_DATA_SEMC) + SDRAM (wx) : ORIGIN = DT_MMIO_SRAM_80000000_BASE_ADDRESS, LENGTH = DT_MMIO_SRAM_80000000_SIZE +#endif +#if (DT_INST_0_NXP_IMX_DTCM_SIZE > 0) && !defined(CONFIG_DATA_DTCM) + DTCM (wx) : ORIGIN = DT_INST_0_NXP_IMX_DTCM_BASE_ADDRESS, LENGTH = DT_INST_0_NXP_IMX_DTCM_SIZE +#endif +#if (DT_INST_0_NXP_IMX_ITCM_SIZE > 0) && !defined(CONFIG_CODE_ITCM) + ITCM (wx) : ORIGIN = DT_INST_0_NXP_IMX_ITCM_BASE_ADDRESS, LENGTH = DT_INST_0_NXP_IMX_ITCM_SIZE +#endif + } + #include