1/*
2 * Copyright (c) 2022 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#include <zephyr/linker/linker-tool.h>
8
9#define IS_CHOSEN_SRAM(x) (DT_DEP_ORD(DT_NODELABEL(x)) == DT_DEP_ORD(DT_CHOSEN(zephyr_sram)))
10
11#if (DT_REG_SIZE(DT_NODELABEL(ocram)) > 0) && !IS_CHOSEN_SRAM(ocram)
12GROUP_START(OCRAM)
13	__ocram_start = .;
14	SECTION_PROLOGUE(.ocram_bss,(NOLOAD),SUBALIGN(4))
15	{
16		__ocram_bss_start = .;
17		*(.ocram_bss)
18		*(".ocram_bss.*")
19		__ocram_bss_end = .;
20		__ocram_end = .;
21	} GROUP_LINK_IN(OCRAM)
22	SECTION_PROLOGUE(.ocram_noinit,(NOLOAD),SUBALIGN(4))
23	{
24		__ocram_noinit_start = .;
25		*(.ocram_noinit)
26		*(".ocram_noinit.*")
27		__ocram_noinit_end = .;
28	} GROUP_LINK_IN(OCRAM)
29	SECTION_PROLOGUE(.ocram_data,,SUBALIGN(4))
30	{
31		__ocram_data_start = .;
32		*(.ocram_data)
33		*(".ocram_data.*")
34		__ocram_data_end = .;
35	} GROUP_LINK_IN(OCRAM AT> ROMABLE_REGION)
36	__ocram_end = .;
37
38	__ocram_data_load_start = LOADADDR(.ocram_data);
39#endif
40