summaryrefslogtreecommitdiffstats
path: root/sys/arm
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-12-19 17:34:17 +0000
committerimp <imp@FreeBSD.org>2007-12-19 17:34:17 +0000
commit93ea7f35941531199bafe14cc0f05096516fe4ad (patch)
tree2221166ecef87224bbda1dacc7a9b26321058306 /sys/arm
parentc805d7131a5064deb7c2ceef67c34a6f9305b251 (diff)
downloadFreeBSD-src-93ea7f35941531199bafe14cc0f05096516fe4ad.zip
FreeBSD-src-93ea7f35941531199bafe14cc0f05096516fe4ad.tar.gz
Actually program the interrupt controller for priorities. As we
support more AT91 platforms, we'll need to move this into some platform init routine.
Diffstat (limited to 'sys/arm')
-rw-r--r--sys/arm/at91/at91.c46
1 files changed, 43 insertions, 3 deletions
diff --git a/sys/arm/at91/at91.c b/sys/arm/at91/at91.c
index c37a0eb..00d5c91 100644
--- a/sys/arm/at91/at91.c
+++ b/sys/arm/at91/at91.c
@@ -396,6 +396,48 @@ at91_cpu_add_builtin_children(device_t dev, struct at91_softc *sc)
#define NORMDEV 50
+/*
+ * Standard priority levels for the system. 0 is lowest and 7 is highest.
+ * These values are the ones Atmel uses for its Linux port, which differ
+ * a little form the ones that are in the standard distribution. Also,
+ * the ones marked with 'TWEEK' are different based on experience.
+ */
+static int irq_prio[32] =
+{
+ 7, /* Advanced Interrupt Controller (FIQ) */
+ 7, /* System Peripherals */
+ 1, /* Parallel IO Controller A */
+ 1, /* Parallel IO Controller B */
+ 1, /* Parallel IO Controller C */
+ 1, /* Parallel IO Controller D */
+ 5, /* USART 0 */
+ 5, /* USART 1 */
+ 5, /* USART 2 */
+ 5, /* USART 3 */
+ 0, /* Multimedia Card Interface */
+ 2, /* USB Device Port */
+ 4, /* Two-Wire Interface */ /* TWEEK */
+ 5, /* Serial Peripheral Interface */
+ 4, /* Serial Synchronous Controller 0 */
+ 6, /* Serial Synchronous Controller 1 */ /* TWEEK */
+ 4, /* Serial Synchronous Controller 2 */
+ 0, /* Timer Counter 0 */
+ 6, /* Timer Counter 1 */ /* TWEEK */
+ 0, /* Timer Counter 2 */
+ 0, /* Timer Counter 3 */
+ 0, /* Timer Counter 4 */
+ 0, /* Timer Counter 5 */
+ 2, /* USB Host port */
+ 3, /* Ethernet MAC */
+ 0, /* Advanced Interrupt Controller (IRQ0) */
+ 0, /* Advanced Interrupt Controller (IRQ1) */
+ 0, /* Advanced Interrupt Controller (IRQ2) */
+ 0, /* Advanced Interrupt Controller (IRQ3) */
+ 0, /* Advanced Interrupt Controller (IRQ4) */
+ 0, /* Advanced Interrupt Controller (IRQ5) */
+ 0 /* Advanced Interrupt Controller (IRQ6) */
+};
+
static int
at91_attach(device_t dev)
{
@@ -432,13 +474,11 @@ at91_attach(device_t dev)
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SVR +
i * 4, i);
/* Priority. */
- /* XXX: Give better priorities to IRQs */
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SMR + i * 4,
- 0);
+ irq_prio[i]);
if (i < 8)
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_EOICR,
1);
-
}
bus_space_write_4(sc->sc_st, sc->sc_sys_sh, IC_SPU, 32);
/* No debug. */
OpenPOWER on IntegriCloud