mirror of https://github.com/thesofproject/sof.git
irq: Add separate PLATFORM_IRQ_HW_NUM define
On some platforms, you can have a number of hardware interrupts but a different number of child interrupts per cascaded interrupt controller. This commit exposes this separation but does not take advantage of it yet. On most platforms, the definitions PLATFORM_IRQ_HW_NUM and PLATFORM_IRQ_CHILDREN are equal. Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
This commit is contained in:
parent
a704c7a5a6
commit
e9b155690e
|
@ -12,6 +12,7 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#define PLATFORM_IRQ_HW_NUM 0
|
||||
#define PLATFORM_IRQ_CHILDREN 0
|
||||
|
||||
static inline int arch_interrupt_register(int irq,
|
||||
|
|
|
@ -121,7 +121,7 @@ struct irq_cascade_desc *interrupt_get_parent(uint32_t irq)
|
|||
struct irq_cascade_desc *cascade, *c = NULL;
|
||||
unsigned long flags;
|
||||
|
||||
if (irq < PLATFORM_IRQ_CHILDREN)
|
||||
if (irq < PLATFORM_IRQ_HW_NUM)
|
||||
return NULL;
|
||||
|
||||
spin_lock_irq(cascade_lock, flags);
|
||||
|
@ -142,7 +142,7 @@ struct irq_cascade_desc *interrupt_get_parent(uint32_t irq)
|
|||
|
||||
void interrupt_init(void)
|
||||
{
|
||||
cascade_root.last_irq = PLATFORM_IRQ_CHILDREN - 1;
|
||||
cascade_root.last_irq = PLATFORM_IRQ_HW_NUM - 1;
|
||||
dcache_writeback_region(&cascade_root, sizeof(cascade_root));
|
||||
spinlock_init(&cascade_lock);
|
||||
}
|
||||
|
|
|
@ -128,10 +128,10 @@ void interrupt_unmask(uint32_t irq, unsigned int cpu);
|
|||
|
||||
/*
|
||||
* On platforms, supporting cascading interrupts cascaded interrupt numbers
|
||||
* are greater than or equal to PLATFORM_IRQ_CHILDREN
|
||||
* are greater than or equal to PLATFORM_IRQ_HW_NUM
|
||||
*/
|
||||
#define interrupt_is_dsp_direct(irq) (!PLATFORM_IRQ_CHILDREN || \
|
||||
irq < PLATFORM_IRQ_CHILDREN)
|
||||
irq < PLATFORM_IRQ_HW_NUM)
|
||||
|
||||
void interrupt_init(void);
|
||||
int interrupt_cascade_register(const struct irq_cascade_tmpl *tmpl);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
#define __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 32
|
||||
|
||||
/* IRQ numbers - wrt Tensilica DSP */
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
#define IRQ_MASK_EXT_DMAC2 (1 << IRQ_NUM_EXT_DMAC2)
|
||||
|
||||
/* no nested interrupts */
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 0
|
||||
|
||||
#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
#define __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 32
|
||||
|
||||
/* IRQ numbers - wrt Tensilica DSP */
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
#define __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 0
|
||||
|
||||
/* IRQ numbers */
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#ifndef __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
#define __PLATFORM_DRIVERS_INTERRUPT_H__
|
||||
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 32
|
||||
|
||||
/* IRQ numbers - wrt Tensilica DSP */
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#define IRQ_MASK_IRQSTR_DSP7 (1 << IRQ_NUM_IRQSTR_DSP7)
|
||||
|
||||
/* no nested interrupts */
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 0
|
||||
|
||||
#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
#include <sof/drivers/interrupt-map.h>
|
||||
|
||||
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
|
||||
#define PLATFORM_IRQ_CHILDREN 32
|
||||
|
||||
/* IRQ numbers - wrt Tensilica DSP */
|
||||
|
|
Loading…
Reference in New Issue