casaroli commented on code in PR #21504:
URL: https://github.com/apache/nuttx/pull/21504#discussion_r4507987751
##########
arch/tricore/src/common/tricore_irq.c:
##########
@@ -74,26 +79,42 @@ static inline void tricore_color_intstack(void)
* Private Data
****************************************************************************/
-static const IfxSrc_Tos g_tricore_tos[] =
-{
- IfxSrc_Tos_cpu0,
- IfxSrc_Tos_cpu1,
- IfxSrc_Tos_cpu2,
- IfxSrc_Tos_cpu3,
- IfxSrc_Tos_cpu4,
- IfxSrc_Tos_cpu5,
-#ifdef CONFIG_ARCH_CHIP_TC4XX
- IfxSrc_Tos_csrm,
-#endif
-};
-
static spinlock_t g_irqlock = SP_UNLOCKED;
static int g_irqmap_count = 1;
/****************************************************************************
* Private Functions
****************************************************************************/
+/****************************************************************************
+ * Name: tricore_src_init
+ *
+ * Description:
+ * Route a service request to a core with a priority and clear a pending
+ * request. The enable bit is left as it is.
+ *
+ ****************************************************************************/
+
+static void tricore_src_init(volatile uint32_t *src, int cpu, int srpn)
+{
+ uint32_t regval = *src;
+
+ regval &= ~(TRICORE_SRC_SRPN_MASK | TRICORE_SRC_TOS_MASK);
+#ifdef TRICORE_SRC_VM_MASK
+ regval &= ~TRICORE_SRC_VM_MASK;
+#endif
+#ifdef TRICORE_SRC_CS
+ if (up_cpu_index() == 6)
Review Comment:
`up_cpu_index()` is always 0 on TriCore: the arch does not select
`ARCH_HAVE_MULTICPU`, so `include/nuttx/arch.h` defines it as 0, and this
branch never sets CS. The iLLD `IfxSrc_init()` it replaces tested the real core
with `IfxCpu_getCoreIndex()`.
Fix: remove the `#ifdef TRICORE_SRC_CS` block, as no image runs on the CSRM
core (`TRAPTAB` and `INTVEC` stop at core 5), or read the core from the CORE_ID
register.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]