From 49921a37843518435f103c1239143a32302d4cf1 Mon Sep 17 00:00:00 2001 From: Brandon Perez Date: Thu, 16 Jul 2015 10:52:31 -0400 Subject: [PATCH 4/6] This commit makes the static crossbar mapping support a Kernel configuration option, able to be turned off and on. The option can be manually added to the .config file, and build with "make olddefconfig", or it can be added using the menu configuration. --- drivers/irqchip/Kconfig | 9 +++++++++ drivers/irqchip/irq-crossbar.c | 7 ++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig index 1110687..6824853 100644 --- a/drivers/irqchip/Kconfig +++ b/drivers/irqchip/Kconfig @@ -77,3 +77,12 @@ config IRQ_CROSSBAR The primary irqchip invokes the crossbar's callback which inturn allocates a free irq and configures the IP. Thus the peripheral interrupts are routed to one of the free irqchip interrupt lines. + +config IRQ_CROSSBAR_STATIC_MAPPING + bool "IRQ crossbar static mapping support" + depends on IRQ_CROSSBAR + help + Support for a static CROSSBAR mapping. This means that the kernel accepts + the mapping of peripherals on the crossbar to IRQ lines on the chip, and + not attempt to map peripherals to IRQ lines at runtime. Either the system + default is used, or the mapping is setup by the bootloader. diff --git a/drivers/irqchip/irq-crossbar.c b/drivers/irqchip/irq-crossbar.c index 4d58650..cf48296 100644 --- a/drivers/irqchip/irq-crossbar.c +++ b/drivers/irqchip/irq-crossbar.c @@ -22,9 +22,6 @@ #define IRQ_SKIP -3 #define GIC_IRQ_START 32 -// FIXME: -#define CONFIG_DRA7_CROSSBAR_STATIC_MAPPING - /** * struct crossbar_device - crossbar device description * @int_max: maximum number of supported interrupts @@ -103,7 +100,7 @@ static inline bool needs_crossbar_write(irq_hw_number_t hw) static int crossbar_domain_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw) { -#ifndef CONFIG_DRA7_CROSSBAR_STATIC_MAPPING +#ifndef CONFIG_IRQ_CROSSBAR_STATIC_MAPPING if (needs_crossbar_write(hw)) cb->write(hw - GIC_IRQ_START, cb->irq_map[hw - GIC_IRQ_START]); #endif @@ -288,7 +285,7 @@ static int __init crossbar_of_init(struct device_node *node) } of_property_read_u32(node, "ti,irqs-safe-map", &cb->safe_map); -#ifndef CONFIG_DRA7_CROSSBAR_STATIC_MAPPING +#ifndef CONFIG_IRQ_CROSSBAR_STATIC_MAPPING /* Initialize the crossbar with safe map to start with */ for (i = 0; i < max; i++) { if (cb->irq_map[i] == IRQ_RESERVED || cb->irq_map[i] == IRQ_SKIP) -- 1.7.9.5