]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: spl: Use separate fault handlers instead of a single common one
authorCsókás Bence <csokas.bence@prolan.hu>
Tue, 19 Dec 2023 13:33:18 +0000 (14:33 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 12 Jan 2024 02:19:25 +0000 (21:19 -0500)
It may be necessary to set breakpoints etc. on a specific fault handler in SPL.
Add a Kconfig option to separate the different handlers into their own individual infinite loops.

Signed-off-by: Csókás Bence <csokas.bence@prolan.hu>
arch/arm/Kconfig
arch/arm/lib/vectors.S

index 1fd7aacc3804907981c3ebbbd3debd003a1bd7ce..2d4458b7b56f6c84374eb67626e2546d3e961bae 100644 (file)
@@ -79,6 +79,15 @@ config SPL_SYS_NO_VECTOR_TABLE
        depends on SPL
        bool
 
+config SPL_USE_SEPARATE_FAULT_HANDLERS
+       bool "Use separate fault handlers instead of a single common one"
+       depends on !SPL_SYS_NO_VECTOR_TABLE && !ARM64 && !CPU_V7M
+       help
+         Instead of a common fault handler, generate a separate one for
+         undefined_instruction, software_interrupt, prefetch_abort etc.
+         This is for debugging purposes, when you want to set breakpoints
+         on them separately.
+
 config LINUX_KERNEL_IMAGE_HEADER
        depends on ARM64
        bool
index 843f9b9c281c9d5cf67aa01b08d5583677bfe222..b6b879339df6bdb88579423f7dc0a32e597f64c5 100644 (file)
@@ -138,11 +138,29 @@ _fiq:                     .word fiq
 #if !CONFIG_IS_ENABLED(SYS_NO_VECTOR_TABLE)
        .align  5
 undefined_instruction:
+#if CONFIG_IS_ENABLED(USE_SEPARATE_FAULT_HANDLERS)
+       b       undefined_instruction
+#endif
 software_interrupt:
+#if CONFIG_IS_ENABLED(USE_SEPARATE_FAULT_HANDLERS)
+       b       software_interrupt
+#endif
 prefetch_abort:
+#if CONFIG_IS_ENABLED(USE_SEPARATE_FAULT_HANDLERS)
+       b       prefetch_abort
+#endif
 data_abort:
+#if CONFIG_IS_ENABLED(USE_SEPARATE_FAULT_HANDLERS)
+       b       data_abort
+#endif
 not_used:
+#if CONFIG_IS_ENABLED(USE_SEPARATE_FAULT_HANDLERS)
+       b       not_used
+#endif
 irq:
+#if CONFIG_IS_ENABLED(USE_SEPARATE_FAULT_HANDLERS)
+       b       irq
+#endif
 fiq:
 1:
        b       1b                      /* hang and never return */