Skip to content

Commit 60f82e6

Browse files
GTLin08jhedberg
authored andcommitted
it8xxx2: add support for putting switch.S in ram code section
Get better performance from executing z_riscv_switch() function. Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
1 parent 00966b8 commit 60f82e6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

soc/ite/ec/it8xxx2/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ config SOC_IT8XXX2_LIBRARY_TO_RAM
216216
If this is selected it means that there is a library that needs to be excluded
217217
from the text section.
218218

219+
config SOC_IT8XXX2_SWITCH_IN_RAM
220+
bool "Place switch handling code in RAM"
221+
select SOC_IT8XXX2_USE_ILM
222+
select SOC_IT8XXX2_LIBRARY_TO_RAM
223+
help
224+
Place content switching code in ILM for better performance.
225+
219226
config SOC_IT8XXX2_SERIAL_IN_RAM
220227
bool "Place serial handling code in RAM"
221228
select SOC_IT8XXX2_USE_ILM

soc/ite/ec/it8xxx2/linker.ld

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,9 @@ SECTIONS
173173
#ifdef CONFIG_SOC_IT8XXX2_LIBRARY_TO_RAM
174174
*(EXCLUDE_FILE (
175175
#endif
176+
#ifdef CONFIG_SOC_IT8XXX2_SWITCH_IN_RAM
177+
*libarch__riscv__core.a:*
178+
#endif
176179
#ifdef CONFIG_SOC_IT8XXX2_SERIAL_IN_RAM
177180
*libdrivers__serial.a:*
178181
#endif
@@ -191,6 +194,9 @@ SECTIONS
191194
#ifdef CONFIG_SOC_IT8XXX2_LIBRARY_TO_RAM
192195
*(EXCLUDE_FILE (
193196
#endif
197+
#ifdef CONFIG_SOC_IT8XXX2_SWITCH_IN_RAM
198+
*libarch__riscv__core.a:*
199+
#endif
194200
#ifdef CONFIG_SOC_IT8XXX2_SERIAL_IN_RAM
195201
*libdrivers__serial.a:*
196202
#endif
@@ -227,6 +233,9 @@ SECTIONS
227233
KEEP(*(".exception.entry.*"))
228234
*(".exception.other.*")
229235
#endif
236+
#ifdef CONFIG_SOC_IT8XXX2_SWITCH_IN_RAM
237+
*libarch__riscv__core.a:*(.text .text.*)
238+
#endif
230239
#ifdef CONFIG_SOC_IT8XXX2_SERIAL_IN_RAM
231240
*libdrivers__serial.a:*(.text .text.*)
232241
*libdrivers__serial.a:*(.rodata .rodata.*)

0 commit comments

Comments
 (0)