drivers : interrupt: alignment of cascaded IRQs

The base irq of the first created cascaded struct is currently equal to
PLATFORM_IRQ_HW_NUM, which is 32 on HIFI4.

On IMX platform the number of children per such a struct is equal to 64
(as per IMX steer IRQ mapping).

Since steer irq in range [0-63] are not routed to the DSP on IMX8 it is
possible to create the cascaded structs only from 64.

Starting them from 32 creates a bias in the management of interrupts,
making the storing of the irq-handlers un-natural and complicated.

This commit wants to replace the initialization of cascade_root.last_irq
by a new constant PLATFORM_IRQ_FIRST_CHILD which would be defined at
platform level.

In the case of IMX it takes value 0, while in all other platform it takes
the value PLATFORM_IRQ_HW_NUM in order to keep things as they are.

Signed-off-by: Jerome Laclavere <jerome.laclavere@nxp.com>
This commit is contained in:
Jerome Laclavere 2019-10-15 11:13:57 +02:00 committed by Daniel Baluta
parent decd206460
commit f004d11f30
9 changed files with 11 additions and 2 deletions

View File

@ -142,7 +142,7 @@ struct irq_cascade_desc *interrupt_get_parent(uint32_t irq)
void interrupt_init(void)
{
cascade_root.last_irq = PLATFORM_IRQ_HW_NUM - 1;
cascade_root.last_irq = PLATFORM_IRQ_FIRST_CHILD - 1;
dcache_writeback_region(&cascade_root, sizeof(cascade_root));
spinlock_init(&cascade_lock);
}

View File

@ -15,6 +15,7 @@
#include <config.h>
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 32
/* IRQ numbers - wrt Tensilica DSP */

View File

@ -96,6 +96,7 @@
/* no nested interrupts */
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 0
#endif /* __PLATFORM_DRIVERS_INTERRUPT_H__ */

View File

@ -16,6 +16,7 @@
#include <config.h>
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 32
/* IRQ numbers - wrt Tensilica DSP */

View File

@ -14,6 +14,7 @@
#include <config.h>
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 0
/* IRQ numbers */

View File

@ -16,6 +16,7 @@
#include <config.h>
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 32
/* IRQ numbers - wrt Tensilica DSP */

View File

@ -60,7 +60,9 @@
/* 32 HW interrupts + 8 IRQ_STEER lines each with 64 interrupts */
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_CHILDREN 64
#define PLATFORM_IRQ_CHILDREN 64 /* Each cascaded struct covers 64 IRQs */
/* IMX: Covered steer IRQs are modulo-64 aligned. */
#define PLATFORM_IRQ_FIRST_CHILD 0
/* irqstr_get_sof_int() - Convert IRQ_STEER interrupt to SOF logical
* interrupt

View File

@ -17,6 +17,7 @@
#include <config.h>
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 32
/* IRQ numbers - wrt Tensilica DSP */

View File

@ -16,6 +16,7 @@
#include <config.h>
#define PLATFORM_IRQ_HW_NUM XCHAL_NUM_INTERRUPTS
#define PLATFORM_IRQ_FIRST_CHILD PLATFORM_IRQ_HW_NUM
#define PLATFORM_IRQ_CHILDREN 32
/* IRQ numbers - wrt Tensilica DSP */