2 * linux/arch/arm/mach-ebsa110/core.c
4 * Copyright (C) 1998-2001 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Extra MM routines for the EBSA-110 architecture
12 #include <linux/kernel.h>
14 #include <linux/init.h>
16 #include <asm/hardware.h>
19 #include <asm/setup.h>
20 #include <asm/mach-types.h>
21 #include <asm/pgtable.h>
23 #include <asm/system.h>
25 #include <asm/mach/arch.h>
26 #include <asm/mach/irq.h>
27 #include <asm/mach/map.h>
29 #define IRQ_MASK 0xfe000000 /* read */
30 #define IRQ_MSET 0xfe000000 /* write */
31 #define IRQ_STAT 0xff000000 /* read */
32 #define IRQ_MCLR 0xff000000 /* write */
34 static void ebsa110_mask_irq(unsigned int irq)
36 __raw_writeb(1 << irq, IRQ_MCLR);
39 static void ebsa110_unmask_irq(unsigned int irq)
41 __raw_writeb(1 << irq, IRQ_MSET);
44 static struct irqchip ebsa110_irq_chip = {
45 .ack = ebsa110_mask_irq,
46 .mask = ebsa110_mask_irq,
47 .unmask = ebsa110_unmask_irq,
50 static void __init ebsa110_init_irq(void)
55 local_irq_save(flags);
56 __raw_writeb(0xff, IRQ_MCLR);
57 __raw_writeb(0x55, IRQ_MSET);
58 __raw_writeb(0x00, IRQ_MSET);
59 if (__raw_readb(IRQ_MASK) != 0x55)
61 __raw_writeb(0xff, IRQ_MCLR); /* clear all interrupt enables */
62 local_irq_restore(flags);
64 for (irq = 0; irq < NR_IRQS; irq++) {
65 set_irq_chip(irq, &ebsa110_irq_chip);
66 set_irq_handler(irq, do_level_IRQ);
67 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
71 static struct map_desc ebsa110_io_desc[] __initdata = {
73 * sparse external-decode ISAIO space
75 { IRQ_STAT, TRICK4_PHYS, PGDIR_SIZE, MT_DEVICE }, /* IRQ_STAT/IRQ_MCLR */
76 { IRQ_MASK, TRICK3_PHYS, PGDIR_SIZE, MT_DEVICE }, /* IRQ_MASK/IRQ_MSET */
77 { SOFT_BASE, TRICK1_PHYS, PGDIR_SIZE, MT_DEVICE }, /* SOFT_BASE */
78 { PIT_BASE, TRICK0_PHYS, PGDIR_SIZE, MT_DEVICE }, /* PIT_BASE */
81 * self-decode ISAIO space
83 { ISAIO_BASE, ISAIO_PHYS, ISAIO_SIZE, MT_DEVICE },
84 { ISAMEM_BASE, ISAMEM_PHYS, ISAMEM_SIZE, MT_DEVICE }
87 static void __init ebsa110_map_io(void)
89 iotable_init(ebsa110_io_desc, ARRAY_SIZE(ebsa110_io_desc));
92 MACHINE_START(EBSA110, "EBSA110")
93 MAINTAINER("Russell King")
94 BOOT_MEM(0x00000000, 0xe0000000, 0xe0000000)
95 BOOT_PARAMS(0x00000400)
100 INITIRQ(ebsa110_init_irq)