1 /*
2  *  Routines to access hardware
3  *
4  *  Copyright (c) 2013 Realtek Semiconductor Corp.
5  *
6  *  This module is a confidential and proprietary property of RealTek and
7  *  possession or use of this module requires written permission of RealTek.
8  */
9 
10 #ifndef _SECTION_CONFIG_H_
11 #define _SECTION_CONFIG_H_
12 
13 #include "basic_types.h"
14 
15 #define RAM_VECTOR_TABLE1_SECTION          \
16         SECTION(".ram_vector_table1")
17 #define RAM_VECTOR_TABLE2_SECTION          \
18         SECTION(".ram_vector_table2")
19 #define RAM_VECTOR_TABLE3_SECTION          \
20         SECTION(".ram_vector_table3")
21 
22 //3 //3 Hal Section
23 #define HAL_ROM_TEXT_SECTION                         \
24         SECTION(".hal.rom.text")
25 
26 #define HAL_ROM_ENTRY_NS_SECTION                         \
27         SECTION(".hal.rom.entryns.rodata")
28 
29 #define SIM_ROM_DATA_SECTION                         \
30         SECTION(".sim.rom.rodata")
31 
32 #define HAL_ROM_DATA_SECTION                         \
33         SECTION(".hal.rom.rodata")
34 
35 #define HAL_ROM_BSS_SECTION                         \
36         SECTION(".hal.rom.bss")
37 
38 #define HAL_ROM_BSS_SECTION_BANK		\
39         SECTION(".hal.rom.bank.bss")
40 
41 #define BOOT_RAM_TEXT_SECTION                         \
42         SECTION(".boot.ram.text")
43 
44 #define BOOT_RAM_RODATA_SECTION                         \
45         SECTION(".boot.rodata")
46 
47 #define BOOT_RAM_DATA_SECTION                         \
48         SECTION(".boot.ram.data")
49 
50 #define BOOT_RAM_BSS_SECTION                         \
51         SECTION(".boot.ram.bss")
52 
53 #define BOOT_RAM_END_BSS_SECTION                         \
54         SECTION(".boot.ram.end.bss")
55 
56 
57 //3 Shell
58 #if defined (ARM_CORE_CM0)
59 #define SHELL_ROM_TEXT_SECTION	HAL_ROM_TEXT_SECTION
60 #define SHELL_ROM_BSS_SECTION		HAL_ROM_BSS_SECTION
61 #define SHELL_ROM_DATA_SECTION	HAL_ROM_DATA_SECTION
62 #else
63 #define SHELL_ROM_TEXT_SECTION
64 #define SHELL_ROM_BSS_SECTION
65 #define SHELL_ROM_DATA_SECTION
66 #endif
67 #define CMD_TABLE_DATA_SECTION				\
68 	SECTION(".cmd.table.data")
69 
70 //3 Image 1 data
71 #define IMAGE1_ENTRY_SECTION                         \
72         SECTION(".image1.entry.data")
73 
74 #define IMAGE1_VALID_PATTEN_SECTION                   \
75         SECTION(".image1.validate.rodata")
76 
77 #define IMAGE1_DATA_SECTION                   \
78         SECTION(".image1.rodata")
79 
80 #define IMAGE2_VALID_PATTEN_SECTION                   \
81         SECTION(".image2.validate.rodata")
82 
83 //3 SRAM Config Section
84 #define SRAM_BD_DATA_SECTION                        \
85         SECTION(".bdsram.data")
86 #define SRAM_NOCACHE_DATA_SECTION		\
87 	SRAM_BD_DATA_SECTION
88 
89 #define SRAM_BF_DATA_SECTION                        \
90         SECTION(".bfsram.data")
91 
92  #define IMAGE2_ENTRY_SECTION                     \
93             SECTION(".image2.entry.data")
94 #define IMAGE2_RAM_TEXT_SECTION                     \
95             SECTION(".image2.ram.text")
96 
97 #define SDRAM_DATA_SECTION
98 
99 #if defined (ARM_CORE_CM4)
100 #define PSRAM_TEXT_SECTION			SECTION(".psram.text")
101 #define PSRAM_DATA_SECTION			SECTION(".psram.data")
102 #define PSRAM_RODATA_SECTION		        SECTION(".psram.rodata")
103 #define PSRAM_BSS_SECTION			SECTION(".psram.bss")
104 #define PSRAM_HEAP_SECTION			SECTION(".psram.heap")
105 #endif
106 
107 //3 Wlan  Section
108 #define WLAN_ROM_TEXT_SECTION
109 
110 #define WLAN_ROM_DATA_SECTION
111 
112 #define WLAN_RAM_MAP_SECTION
113 
114 #undef CONFIG_WIFI_CRITICAL_CODE_SECTION
115 #define CONFIG_WIFI_CRITICAL_CODE_SECTION	IMAGE2_RAM_TEXT_SECTION
116 #define CONFIG_FW_CRITICAL_CODE_SECTION		//IMAGE2_RAM_TEXT_SECTION
117 //3 Apple  Section
118 #define APPLE_ROM_TEXT_SECTION                      \
119         SECTION(".apple.rom.text")
120 
121 #define APPLE_ROM_DATA_SECTION                      \
122         SECTION(".apple.rom.rodata")
123 
124 //3 Libc Section
125 #define LIBC_ROM_TEXT_SECTION                      \
126         SECTION(".libc.rom.text")
127 
128 #define LIBC_ROM_DATA_SECTION                      \
129         SECTION(".libc.rom.rodata")
130 
131 
132 #define LIBC_HEAP_SECTION                         	\
133         SECTION(".heap.stdlib")
134 
135 //3 SSL Section
136 #define SSL_ROM_TEXT_SECTION				\
137         SECTION(".ssl.rom.text")
138 #define SSL_ROM_DATA_SECTION				\
139         SECTION(".ssl.rom.rodata")
140 #define SSL_RAM_MAP_SECTION				\
141         SECTION(".ssl_ram_map")
142 
143 //OS Section
144 #define OS_ROM_TEXT_SECTION                      \
145         SECTION(".os.rom.text")
146 
147 #define OS_ROM_DATA_SECTION                      \
148         SECTION(".os.rom.rodata")
149 
150 //FLASH RUN CODE
151 #define FLASH_BOOT_TEXT_SECTION		SECTION(".flashboot.text")
152 #define IMAGE2_CUSTOM_SIGNATURE		SECTION(".img2_custom_signature") /* 32B: for OTA update */
153 
154 //RDP (read protect area just text)
155 #define RDP_TEXT_SECTION		SECTION(".rdp.ram.text")
156 #define RDP_DATA_SECTION		SECTION(".rdp.ram.data")
157 
158 #define RETENTION_TEXT_SECTION		SECTION(".retention.ram.text")
159 #define RETENTION_DATA_SECTION		SECTION(".retention.ram.data")
160 #define RETENTION_ENTRY_SECTION		SECTION(".retention.entry.data")
161 
162 /* rom map */
163 #define ROM_FUNCTION_MAP		SECTION(".rommap.data")
164 
165 //3 FW Section
166 #define FW_ROM_TEXT_SECTION                         \
167         SECTION(".FW.rom.text")
168 
169 #define FW_ROM_DATA_SECTION                         \
170         SECTION(".FW.rom.rodata")
171 
172 #define FW_ROM_BSS_SECTION                         \
173         SECTION(".FW.rom.bss")
174 
175 #define FW_RAM_TEXT_SECTION                         \
176         SECTION(".FW.ram.text")
177 
178 #define FW_RAM_DATA_SECTION                         \
179         SECTION(".FW.ram.rodata")
180 
181 #define FW_RAM_BSS_SECTION                         \
182         SECTION(".FW.ram.bss")
183 
184 /* image3 secure image */
185 #define IMAGE3_ENTRY_SECTION                     \
186 	SECTION(".image3.nsc_entry.text")
187 
188 /*USB_OTG define*/
189 #define OTG_ROM_TEXT_SECTION
190 #define START_OTG_RAM_FUN_SECTION
191 #define START_OTG_RAM_DATA_SECTION
192 #define OTG_ROM_DATA_SECTION
193 
194 #endif //_SECTION_CONFIG_H_
195