Path: blob/master/arch/xtensa/variants/s6000/irq.c
10818 views
/*1* s6000 irq crossbar2*3* Copyright (c) 2009 emlix GmbH4* Authors: Johannes Weiner <[email protected]>5* Oskar Schirmer <[email protected]>6*/7#include <linux/io.h>8#include <asm/irq.h>9#include <variant/hardware.h>1011/* S6_REG_INTC */12#define INTC_STATUS 0x00013#define INTC_RAW 0x01014#define INTC_STATUS_AG 0x10015#define INTC_CFG(n) (0x200 + 4 * (n))1617/*18* The s6000 has a crossbar that multiplexes interrupt output lines19* from the peripherals to input lines on the xtensa core.20*21* We leave the mapping decisions to the platform as it depends on the22* actually connected peripherals which distribution makes sense.23*/24extern const signed char *platform_irq_mappings[NR_IRQS];2526static unsigned long scp_to_intc_enable[] = {27#define TO_INTC_ENABLE(n) (((n) << 1) + 1)28TO_INTC_ENABLE(0),29TO_INTC_ENABLE(1),30TO_INTC_ENABLE(2),31TO_INTC_ENABLE(3),32TO_INTC_ENABLE(4),33TO_INTC_ENABLE(5),34TO_INTC_ENABLE(6),35TO_INTC_ENABLE(7),36TO_INTC_ENABLE(8),37TO_INTC_ENABLE(9),38TO_INTC_ENABLE(10),39TO_INTC_ENABLE(11),40TO_INTC_ENABLE(12),41-1,42-1,43TO_INTC_ENABLE(13),44-1,45TO_INTC_ENABLE(14),46-1,47TO_INTC_ENABLE(15),48#undef TO_INTC_ENABLE49};5051static void irq_set(unsigned int irq, int enable)52{53unsigned long en;54const signed char *m = platform_irq_mappings[irq];5556if (!m)57return;58en = enable ? scp_to_intc_enable[irq] : 0;59while (*m >= 0) {60writel(en, S6_REG_INTC + INTC_CFG(*m));61m++;62}63}6465void variant_irq_enable(unsigned int irq)66{67irq_set(irq, 1);68}6970void variant_irq_disable(unsigned int irq)71{72irq_set(irq, 0);73}747576