From cb7560efc9c8d71305b6fdb80437ef6197188365 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Tue, 14 Nov 2023 13:21:02 +0100 Subject: [PATCH 1/2] linker: allow tagging variables with __nocache_noinit Allow tagging variables with __nocach_noinit. With CONFIG_NOCACHE_MEMORY=y, this will resolve to __nocache, which implies __noinit. With CONFIG_NOCACHE_MEMORY=n, this simply resolves to __noinit. Signed-off-by: Henrik Brix Andersen (cherry picked from commit afe1ca6847851f24cd72c7efc60730726ab4b684) --- include/zephyr/linker/section_tags.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/zephyr/linker/section_tags.h b/include/zephyr/linker/section_tags.h index d0ef2ecf126610..5678a07325bc6b 100644 --- a/include/zephyr/linker/section_tags.h +++ b/include/zephyr/linker/section_tags.h @@ -49,8 +49,10 @@ #if defined(CONFIG_NOCACHE_MEMORY) #define __nocache __in_section_unique(_NOCACHE_SECTION_NAME) +#define __nocache_noinit __nocache #else #define __nocache +#define __nocache_noinit __noinit #endif /* CONFIG_NOCACHE_MEMORY */ #if defined(CONFIG_KERNEL_COHERENCE) From befd70864c77e3d8b34dac6299d96e8f45dd881f Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Tue, 14 Nov 2023 13:23:13 +0100 Subject: [PATCH 2/2] drivers: can: mcan: use __nocache_noinit for MRAM data variables Use __nocache_noinit for the Bosch M_CAN MRAM data variables on SoCs without dedicated MRAM. Fixes: #64691 Signed-off-by: Henrik Brix Andersen (cherry picked from commit 58e1963c6b7a7d6966244be9b89fb099aa6d66d7) --- include/zephyr/drivers/can/can_mcan.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/zephyr/drivers/can/can_mcan.h b/include/zephyr/drivers/can/can_mcan.h index 6cc632fb13e3da..b29adc857f7f29 100644 --- a/include/zephyr/drivers/can/can_mcan.h +++ b/include/zephyr/drivers/can/can_mcan.h @@ -640,7 +640,7 @@ enum can_mcan_psr_lec { */ #define CAN_MCAN_DT_MRAM_DEFINE(node_id, _name) \ BUILD_ASSERT(CAN_MCAN_DT_MRAM_OFFSET(node_id) == 0, "offset must be 0"); \ - static char __noinit __nocache __aligned(4) _name[CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(node_id)]; + static char __nocache_noinit __aligned(4) _name[CAN_MCAN_DT_MRAM_ELEMENTS_SIZE(node_id)]; /** * @brief Assert that the Message RAM configuration meets the Bosch M_CAN IP core restrictions