Commit 1beee210 authored by Daniel Glöckner's avatar Daniel Glöckner Committed by Chris Zankel

xtensa: allow variant to initialize own irq chips

There was already a PLATFORM_NR_IRQS define, which is now accompanied
by a VARIANT_NR_IRQS. To be able to initialize these interrupts,
init_IRQ now calls a variant specific hook.

Changes compared to v1:
- adapted to new CONFIG_VARIANT_IRQ_EXT
- removed definition and call of platform_init_IRQ as there already
  is a platform_init_irq defined in asm/platform.h with a weak default
  in kernel/platform.c
- renamed variant_init_IRQ to variant_init_irq

Note that I could not find the call site of platform_init_irq although
it is stated in platform.h that it is called from init_IRQ.
Signed-off-by: default avatarDaniel Glöckner <dg@emlix.com>
Signed-off-by: default avatarChris Zankel <chris@zankel.net>
parent bd974240
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#ifndef _XTENSA_IRQ_H #ifndef _XTENSA_IRQ_H
#define _XTENSA_IRQ_H #define _XTENSA_IRQ_H
#include <linux/init.h>
#include <platform/hardware.h> #include <platform/hardware.h>
#include <variant/core.h> #include <variant/core.h>
...@@ -21,11 +22,20 @@ static inline void variant_irq_enable(unsigned int irq) { } ...@@ -21,11 +22,20 @@ static inline void variant_irq_enable(unsigned int irq) { }
static inline void variant_irq_disable(unsigned int irq) { } static inline void variant_irq_disable(unsigned int irq) { }
#endif #endif
#ifndef VARIANT_NR_IRQS
# define VARIANT_NR_IRQS 0
#endif
#ifndef PLATFORM_NR_IRQS #ifndef PLATFORM_NR_IRQS
# define PLATFORM_NR_IRQS 0 # define PLATFORM_NR_IRQS 0
#endif #endif
#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS #define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
#define NR_IRQS (XTENSA_NR_IRQS + PLATFORM_NR_IRQS) #define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS)
#if VARIANT_NR_IRQS == 0
static inline void variant_init_irq(void) { }
#else
void variant_init_irq(void) __init;
#endif
static __inline__ int irq_canonicalize(int irq) static __inline__ int irq_canonicalize(int irq)
{ {
......
...@@ -197,4 +197,6 @@ void __init init_IRQ(void) ...@@ -197,4 +197,6 @@ void __init init_IRQ(void)
} }
cached_irq_mask = 0; cached_irq_mask = 0;
variant_init_irq();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment