4 * Copyright (c) 2009 emlix GmbH
5 * Authors: Johannes Weiner <jw@emlix.com>
6 * Oskar Schirmer <os@emlix.com>
10 #include <variant/hardware.h>
13 #define INTC_STATUS 0x000
14 #define INTC_RAW 0x010
15 #define INTC_STATUS_AG 0x100
16 #define INTC_CFG(n) (0x200 + 4 * (n))
19 * The s6000 has a crossbar that multiplexes interrupt output lines
20 * from the peripherals to input lines on the xtensa core.
22 * We leave the mapping decisions to the platform as it depends on the
23 * actually connected peripherals which distribution makes sense.
25 extern const signed char *platform_irq_mappings[NR_IRQS];
27 static unsigned long scp_to_intc_enable[] = {
28 #define TO_INTC_ENABLE(n) (((n) << 1) + 1)
52 static void irq_set(unsigned int irq, int enable)
55 const signed char *m = platform_irq_mappings[irq];
59 en = enable ? scp_to_intc_enable[irq] : 0;
61 writel(en, S6_REG_INTC + INTC_CFG(*m));
66 void variant_irq_enable(unsigned int irq)
71 void variant_irq_disable(unsigned int irq)