soc: it8xxx2: linker: Move kernel library to RAM to enhance performance

Place kernel library in ILM. This can improve performance.

test:
Print the message 10000 times with 1ms sleep interval to compare the
time difference before and after adding RAM code on the it82002bw evb.

                         RAM code size    save time
original:                1954 bytes
libkernel.a:            +8941 bytes      -649ms

Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com>
This commit is contained in:
Tim Lin 2024-07-01 17:24:34 +08:00 committed by Anas Nashif
commit 2ab908bcf2
2 changed files with 18 additions and 0 deletions

View file

@ -197,6 +197,13 @@ config SOC_IT8XXX2_SERIAL_IN_RAM
Place serial handling (Include uart_ns16550.c and uart_ite_it8xxx2.c) code
in ILM. This can improve performance.
config SOC_IT8XXX2_KERNEL_IN_RAM
bool "Place kernel handling code in RAM"
select SOC_IT8XXX2_USE_ILM
select SOC_IT8XXX2_LIBRARY_TO_RAM
help
Place kernel handling code in ILM. This can significantly improve performance.
config SOC_IT8XXX2_SHA256_HW_ACCELERATE
bool "HW SHA256 calculation"
help

View file

@ -176,6 +176,9 @@ SECTIONS
#ifdef CONFIG_SOC_IT8XXX2_SERIAL_IN_RAM
*libdrivers__serial.a:*
#endif
#ifdef CONFIG_SOC_IT8XXX2_KERNEL_IN_RAM
*libkernel.a:*
#endif
#ifdef CONFIG_SOC_IT8XXX2_LIBRARY_TO_RAM
)
.text
@ -188,6 +191,9 @@ SECTIONS
#ifdef CONFIG_SOC_IT8XXX2_SERIAL_IN_RAM
*libdrivers__serial.a:*
#endif
#ifdef CONFIG_SOC_IT8XXX2_KERNEL_IN_RAM
*libkernel.a:*
#endif
#ifdef CONFIG_SOC_IT8XXX2_LIBRARY_TO_RAM
)
.text.*
@ -219,6 +225,11 @@ SECTIONS
*libdrivers__serial.a:*(.text .text.*)
*libdrivers__serial.a:*(.rodata .rodata.*)
*libdrivers__serial.a:*(.srodata .srodata.*)
#endif
#ifdef CONFIG_SOC_IT8XXX2_KERNEL_IN_RAM
*libkernel.a:*(.text .text.*)
*libkernel.a:*(.rodata .rodata.*)
*libkernel.a:*(.srodata .srodata.*)
#endif
__ilm_flash_end = .;
/* ILM mapping is always a multiple of 4k size; ensure following