soc: renesas: ra: allocate default NMI handler for Renesas RA SoC

Allocate NMI_Handler as default NMI handler for Renesas RA family

Signed-off-by: The Nguyen <the.nguyen.yf@renesas.com>
This commit is contained in:
The Nguyen 2024-12-25 06:15:00 +00:00 committed by Benjamin Cabé
commit b72b271682
19 changed files with 246 additions and 1 deletions

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -35,4 +40,12 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
bsp_clock_init(); bsp_clock_init();
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -27,6 +27,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -34,8 +39,14 @@ volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
*/ */
void soc_early_init_hook(void) void soc_early_init_hook(void)
{ {
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -26,6 +26,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -59,4 +64,12 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -26,6 +26,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -59,4 +64,12 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -26,6 +26,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -59,4 +64,12 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -144,6 +144,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -158,5 +163,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
irq_unlock(key); irq_unlock(key);
} }

View file

@ -26,6 +26,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -59,4 +64,12 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -26,6 +26,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -59,4 +64,12 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -26,6 +26,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -35,4 +40,12 @@ void soc_early_init_hook(void)
{ {
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -63,5 +68,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
irq_unlock(key); irq_unlock(key);
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -63,5 +68,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
irq_unlock(key); irq_unlock(key);
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -39,5 +44,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
irq_unlock(key); irq_unlock(key);
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -39,5 +44,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
irq_unlock(key); irq_unlock(key);
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -39,5 +44,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif
irq_unlock(key); irq_unlock(key);
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -63,5 +68,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif
irq_unlock(key); irq_unlock(key);
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -63,5 +68,13 @@ void soc_early_init_hook(void)
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif
irq_unlock(key); irq_unlock(key);
} }

View file

@ -29,6 +29,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -61,4 +66,12 @@ void soc_early_init_hook(void)
sys_cache_data_enable(); sys_cache_data_enable();
#endif #endif
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -34,4 +39,12 @@ void soc_early_init_hook(void)
{ {
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }

View file

@ -25,6 +25,11 @@ uint32_t SystemCoreClock BSP_SECTION_EARLY_INIT;
volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT; volatile uint32_t g_protect_pfswe_counter BSP_SECTION_EARLY_INIT;
#ifdef CONFIG_RUNTIME_NMI
extern bsp_grp_irq_cb_t g_bsp_group_irq_sources[];
extern void NMI_Handler(void);
#endif /* CONFIG_RUNTIME_NMI */
/** /**
* @brief Perform basic hardware initialization at boot. * @brief Perform basic hardware initialization at boot.
* *
@ -34,4 +39,12 @@ void soc_early_init_hook(void)
{ {
SystemCoreClock = BSP_MOCO_HZ; SystemCoreClock = BSP_MOCO_HZ;
g_protect_pfswe_counter = 0; g_protect_pfswe_counter = 0;
#ifdef CONFIG_RUNTIME_NMI
for (uint32_t i = 0; i < 16; i++) {
g_bsp_group_irq_sources[i] = 0;
}
z_arm_nmi_set_handler(NMI_Handler);
#endif /* CONFIG_RUNTIME_NMI */
} }