Commit ab2515ad authored by Peter Marheine's avatar Peter Marheine Committed by Carles Cufi
Browse files

it8xxx2: support relocating ISR code to RAM



IT8xxx2 uses a relatively slow SPI flash for ROM with a small 4k
I-cache. As a result in large or busy applications, instruction fetch
can be very costly due to I-cache misses. Since exception handling code
is some of the hottest code in most applications, add an option (enabled
by default) causing that code to execute out of RAM in order to improve
performance.

This is very similar to exception section placement on XIP niosii
platforms (which has similar motivation), but can still be disabled by
configuration.

Signed-off-by: default avatarPeter Marheine <pmarheine@chromium.org>
parent d37f496e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -89,4 +89,14 @@ config SOC_IT8XXX2_USE_ILM
	  predictable than executing from Flash directly, and some code (such as code
	  that writes to the internal Flash) must execute out of RAM.

config SOC_IT8XXX2_EXCEPTIONS_IN_RAM
	bool "Place exception handling code in RAM"
	default y
	select SOC_IT8XXX2_USE_ILM
	help
	  Place exception handling (ISR entry/exit and related) code in ILM, which
	  has more reliable performance characteristics than executing directly from
	  Flash. This can significantly improve performance when under I-cache
	  pressure.

endif # SOC_IT8XXX2
+6 −0
Original line number Diff line number Diff line
@@ -120,11 +120,13 @@ SECTIONS
		KEEP(*(.reset.*))
    } GROUP_LINK_IN(ROMABLE_REGION)

#ifndef CONFIG_SOC_IT8XXX2_EXCEPTIONS_IN_RAM
    SECTION_PROLOGUE(_EXCEPTION_SECTION_NAME,,)
	{
		KEEP(*(".exception.entry.*"))
		*(".exception.other.*")
	} GROUP_LINK_IN(ROMABLE_REGION)
#endif

    SECTION_PROLOGUE(_TEXT_SECTION_NAME,,)
	{
@@ -148,6 +150,10 @@ SECTIONS
		/* Specially-tagged functions in SoC sources */
		KEEP(*(.__ram_code))
		*(.__ram_code.*)
#ifdef CONFIG_SOC_IT8XXX2_EXCEPTIONS_IN_RAM
		KEEP(*(".exception.entry.*"))
		*(".exception.other.*")
#endif
		__ilm_flash_end = .;
		/* ILM mapping is always a multiple of 4k size; ensure following
		 * sections won't incorrectly redirect to RAM. */