arm: Convert DT_DTCM_* to new devicetree.h macros

Convert various DT_DTCM_* macros to use DT_CHOSEN(zephyr_dtcm) and
associated macros from devicetree.h.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-23 17:51:08 -05:00 committed by Kumar Gala
commit a49817d17e
4 changed files with 21 additions and 11 deletions

View file

@ -98,8 +98,8 @@ MEMORY
#ifdef DT_CCM_BASE_ADDRESS
CCM (rw) : ORIGIN = DT_CCM_BASE_ADDRESS, LENGTH = DT_CCM_SIZE * 1K
#endif
#ifdef DT_DTCM_BASE_ADDRESS
DTCM (rw) : ORIGIN = DT_DTCM_BASE_ADDRESS, LENGTH = DT_DTCM_SIZE * 1K
#if DT_HAS_NODE(DT_CHOSEN(zephyr_dtcm))
DTCM (rw) : ORIGIN = DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)), LENGTH = DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm))
#endif
SRAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
#ifdef CONFIG_BT_STM32_IPM
@ -388,7 +388,7 @@ SECTIONS
GROUP_END(RAMABLE_REGION)
#ifdef DT_DTCM_BASE_ADDRESS
#if DT_HAS_NODE(DT_CHOSEN(zephyr_dtcm))
GROUP_START(DTCM)
SECTION_PROLOGUE(_DTCM_BSS_SECTION_NAME, (NOLOAD),SUBALIGN(4))
@ -423,7 +423,7 @@ GROUP_START(DTCM)
__dtcm_data_rom_start = LOADADDR(_DTCM_DATA_SECTION_NAME);
GROUP_END(DTCM)
#endif /* DT_DTCM_BASE_ADDRESS */
#endif
#ifdef CONFIG_CUSTOM_SECTIONS_LD
/* Located in project source directory */
#include <custom-sections.ld>

View file

@ -24,6 +24,16 @@
#include <sys/util.h>
#include <offsets.h>
/* We need to dummy out DT_HAS_NODE when building the unittests since including
* devicetree.h would require generating dummy header files to match what the
* generate creates, so its easier to just dummy out DT_HAS_NODE.
*/
#ifdef ZTEST_UNITTEST
#define DT_HAS_NODE(x) 0
#else
#include <devicetree.h>
#endif
#ifdef _LINKER
@ -217,7 +227,7 @@ extern char __ccm_noinit_end[];
extern char __ccm_end[];
#endif /* DT_CCM_BASE_ADDRESS */
#ifdef DT_DTCM_BASE_ADDRESS
#if DT_HAS_NODE(DT_CHOSEN(zephyr_dtcm))
extern char __dtcm_data_start[];
extern char __dtcm_data_end[];
extern char __dtcm_bss_start[];
@ -227,7 +237,7 @@ extern char __dtcm_noinit_end[];
extern char __dtcm_data_rom_start[];
extern char __dtcm_start[];
extern char __dtcm_end[];
#endif /* DT_DTCM_BASE_ADDRESS */
#endif
/* Used by the Security Attribution Unit to configure the
* Non-Secure Callable region.