zephyr/soc/arc/snps_emsk/linker.ld
Kumar Gala e7332f924b soc: arc: Use new dts macros in linker scripts and arc_mpu_regions
Convert linker scripts and arc_mpu_regions.c setup to use new
devicetree.h macros to extract the base address and size of the various
memory regions (DDR, SRAM, FLASH, DCCM, ICCM).  We also remove the
scaling up and down since DT_REG_SIZE() returns the value in bytes.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
2020-04-30 13:29:48 -05:00

43 lines
1.2 KiB
Text

/*
* Copyright (c) 2018 Synopsys, Inc. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @brief Linker script for the Synopsys EM Starterkit platform.
*/
#include <devicetree.h>
#include <autoconf.h>
/*
* DRAM base address and size
*
* DRAM includes the exception vector table at reset, which is at
* the beginning of the region.
*/
#if DT_NODE_HAS_PROP(DT_NODELABEL(ddr0), reg) && \
(DT_REG_SIZE(DT_NODELABEL(ddr0)) > 0)
#define SRAM_START DT_REG_ADDR(DT_NODELABEL(ddr0))
#define SRAM_SIZE DT_REG_SIZE(DT_NODELABEL(ddr0))
#endif
/* Instruction Closely Coupled Memory (ICCM) base address and size */
#if DT_NODE_HAS_PROP(DT_INST(0, arc_iccm), reg) && \
(DT_REG_SIZE(DT_INST(0, arc_iccm)) > 0)
#define ICCM_START DT_REG_ADDR(DT_INST(0, arc_iccm))
#define ICCM_SIZE DT_REG_SIZE(DT_INST(0, arc_iccm))
#endif
/*
* DCCM base address and size. DCCM is the data memory.
*/
/* Data Closely Coupled Memory (DCCM) base address and size */
#if DT_NODE_HAS_PROP(DT_INST(0, arc_dccm), reg) && \
(DT_REG_SIZE(DT_INST(0, arc_dccm)) > 0)
#define DCCM_START DT_REG_ADDR(DT_INST(0, arc_dccm))
#define DCCM_SIZE DT_REG_SIZE(DT_INST(0, arc_dccm))
#endif
#include <arch/arc/v2/linker.ld>