1/*
2 * Copyright (c) 2024 TOKITA Hiroshi
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#if DT_NODE_HAS_STATUS(DT_NODELABEL(id_code), okay)
8
9SECTION_PROLOGUE(.id_code,,)
10{
11	KEEP(*(.id_code*))
12} GROUP_LINK_IN(ID_CODE)
13
14#endif
15
16#if DT_NODE_HAS_STATUS(DT_NODELABEL(option_setting_ofs), okay)
17
18SECTION_PROLOGUE(.option_setting_ofs,,)
19{
20	__OPTION_SETTING_OFS_Start = .;
21	KEEP(*(.option_setting_ofs0))
22	. = __OPTION_SETTING_OFS_Start + 0x04;
23	KEEP(*(.option_setting_ofs2))
24	. = __OPTION_SETTING_OFS_Start + 0x10;
25	KEEP(*(.option_setting_dualsel))
26	__OPTION_SETTING_OFS_End = .;
27} GROUP_LINK_IN(OPTION_SETTING_OFS) = 0xFF
28
29#endif
30
31#if DT_NODE_HAS_STATUS(DT_NODELABEL(option_setting_sas), okay)
32
33SECTION_PROLOGUE(.option_setting_sas,,)
34{
35	__OPTION_SETTING_SAS_Start = .;
36	KEEP(*(.option_setting_sas))
37	__OPTION_SETTING_SAS_End = .;
38} GROUP_LINK_IN(OPTION_SETTING_SAS) = 0xFF
39
40#endif
41
42#if DT_NODE_HAS_STATUS(DT_NODELABEL(option_setting_ns), okay)
43
44SECTION_PROLOGUE(.option_setting_ns,,)
45{
46	__OPTION_SETTING_NS_Start = .;
47	KEEP(*(.option_setting_ofs1))
48        . = __OPTION_SETTING_NS_Start + 0x04;
49	KEEP(*(.option_setting_ofs3))
50        . = __OPTION_SETTING_NS_Start + 0x10;
51	KEEP(*(.option_setting_banksel))
52        . = __OPTION_SETTING_NS_Start + 0x40;
53	KEEP(*(.option_setting_bps0))
54        . = __OPTION_SETTING_NS_Start + 0x44;
55	KEEP(*(.option_setting_bps1))
56        . = __OPTION_SETTING_NS_Start + 0x48;
57	KEEP(*(.option_setting_bps2))
58        . = __OPTION_SETTING_NS_Start + 0x4C;
59	KEEP(*(.option_setting_bps3))
60        . = __OPTION_SETTING_NS_Start + 0x60;
61	KEEP(*(.option_setting_pbps0))
62        . = __OPTION_SETTING_NS_Start + 0x64;
63	KEEP(*(.option_setting_pbps1))
64        . = __OPTION_SETTING_NS_Start + 0x68;
65	KEEP(*(.option_setting_pbps2))
66        . = __OPTION_SETTING_NS_Start + 0x6C;
67	KEEP(*(.option_setting_pbps3))
68	__OPTION_SETTING_NS_End = .;
69} GROUP_LINK_IN(OPTION_SETTING) = 0xFF
70
71#endif
72
73#if DT_NODE_HAS_STATUS(DT_NODELABEL(option_setting_s), okay)
74
75SECTION_PROLOGUE(.option_setting_s,,)
76{
77	__OPTION_SETTING_S_Start = .;
78	KEEP(*(.option_setting_ofs1_sec))
79	. = __OPTION_SETTING_S_Start + 0x04;
80	KEEP(*(.option_setting_ofs3_sec))
81	. = __OPTION_SETTING_S_Start + 0x10;
82	KEEP(*(.option_setting_banksel_sec))
83	. = __OPTION_SETTING_S_Start + 0x40;
84	KEEP(*(.option_setting_bps_sec0))
85	. = __OPTION_SETTING_S_Start + 0x44;
86	KEEP(*(.option_setting_bps_sec1))
87	. = __OPTION_SETTING_S_Start + 0x48;
88	KEEP(*(.option_setting_bps_sec2))
89	. = __OPTION_SETTING_S_Start + 0x4C;
90	KEEP(*(.option_setting_bps_sec3))
91	. = __OPTION_SETTING_S_Start + 0x60;
92	KEEP(*(.option_setting_pbps_sec0))
93	. = __OPTION_SETTING_S_Start + 0x64;
94	KEEP(*(.option_setting_pbps_sec1))
95	. = __OPTION_SETTING_S_Start + 0x68;
96	KEEP(*(.option_setting_pbps_sec2))
97	. = __OPTION_SETTING_S_Start + 0x6C;
98	KEEP(*(.option_setting_pbps_sec3))
99	. = __OPTION_SETTING_S_Start + 0x80;
100	KEEP(*(.option_setting_ofs1_sel))
101	. = __OPTION_SETTING_S_Start + 0x84;
102	KEEP(*(.option_setting_ofs3_sel))
103	. = __OPTION_SETTING_S_Start + 0x90;
104	KEEP(*(.option_setting_banksel_sel))
105	. = __OPTION_SETTING_S_Start + 0xC0;
106	KEEP(*(.option_setting_bps_sel0))
107	. = __OPTION_SETTING_S_Start + 0xC4;
108	KEEP(*(.option_setting_bps_sel1))
109	. = __OPTION_SETTING_S_Start + 0xC8;
110	KEEP(*(.option_setting_bps_sel2))
111	. = __OPTION_SETTING_S_Start + 0xCC;
112	KEEP(*(.option_setting_bps_sel3))
113	__OPTION_SETTING_S_End = .;
114} GROUP_LINK_IN(OPTION_SETTING_S) = 0xFF
115
116#endif
117