This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 18be6955c696091757d5f2ff1ba86292dd4bf92e Author: Tiago Medicci Serrano <[email protected]> AuthorDate: Tue Feb 24 15:55:44 2026 -0300 arch/xtensa/src/common: Create SoC-specific initialization routine This commits adds a function that can be implemented by any vendor to allow SoC-specific functions to be called by `up_initialize`. Please note that `up_initialize` is provided by the arch level, but it doesn't allow SoC-specific initialization. Although it could be possible to run such initialization on board-level, semantically it isn't related to the board, but with the SoC. As an example of such implementation, some SoCs require RTC subsystem initialization to occur before the OS is completely initialized. Signed-off-by: Tiago Medicci Serrano <[email protected]> --- arch/xtensa/src/common/xtensa.h | 4 ++++ arch/xtensa/src/common/xtensa_initialize.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/arch/xtensa/src/common/xtensa.h b/arch/xtensa/src/common/xtensa.h index 4c08f4101ad..8ce47b0416a 100644 --- a/arch/xtensa/src/common/xtensa.h +++ b/arch/xtensa/src/common/xtensa.h @@ -266,6 +266,10 @@ void xtensa_clrpend_irq(int irq); void weak_function xtensa_dma_initialize(void); #endif +/* SoC-specific CPU initialization */ + +void weak_function xtensa_soc_initialize(void); + /* Memory management */ #if CONFIG_MM_REGIONS > 1 diff --git a/arch/xtensa/src/common/xtensa_initialize.c b/arch/xtensa/src/common/xtensa_initialize.c index e354dae7ed8..b59a8ebe124 100644 --- a/arch/xtensa/src/common/xtensa_initialize.c +++ b/arch/xtensa/src/common/xtensa_initialize.c @@ -106,5 +106,12 @@ void up_initialize(void) xtensa_usbinitialize(); +#ifdef CONFIG_HAVE_WEAKFUNCTIONS + if (xtensa_soc_initialize) +#endif + { + xtensa_soc_initialize(); + } + board_autoled_on(LED_IRQSENABLED); }
