OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [src/] [platform/] [beagle/] [irq.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Support for generic irq handling using platform irq controller (PL190)
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
#include <l4/generic/platform.h>
7
#include <l4/generic/irq.h>
8
#include <l4/generic/time.h>
9
#include INC_PLAT(irq.h)
10
#include INC_PLAT(platform.h)
11
#include INC_PLAT(timer.h)
12
#include INC_ARCH(exception.h)
13
#include <l4/drivers/irq/omap3/omap3_intc.h>
14
 
15
struct irq_chip irq_chip_array[IRQ_CHIPS_MAX] = {
16
        [0] = {
17
                .name = "OMAP 3 irq controller",
18
                .level = 0,
19
                .cascade = IRQ_NIL,
20
                .start = 0,
21
                .end = IRQS_MAX,
22
                .ops = {
23
                        .init = omap3_intc_init,
24
                        .read_irq = omap3_intc_read_irq,
25
                        .ack_and_mask = omap3_intc_ack_and_mask,
26
                        .unmask = omap3_intc_unmask_irq,
27
                },
28
        },
29
};
30
 
31
static int platform_timer_handler(struct irq_desc *desc)
32
{
33
        timer_irq_clear(PLATFORM_TIMER0_VBASE);
34
 
35
        return do_timer_irq();
36
}
37
 
38
/*
39
 * Timer handler for userspace
40
 */
41
static int platform_timer_user_handler(struct irq_desc *desc)
42
{
43
        /* Ack the device irq */
44
        timer_irq_clear(PLATFORM_TIMER1_VBASE);
45
 
46
        /* Notify the userspace */
47
        irq_thread_notify(desc);
48
 
49
        return 0;
50
}
51
 
52
/* Built-in irq handlers initialised at compile time.
53
 * Else register with register_irq() */
54
struct irq_desc irq_desc_array[IRQS_MAX] = {
55
        [IRQ_TIMER0] = {
56
                .name = "Timer0",
57
                .chip = &irq_chip_array[0],
58
                .handler = platform_timer_handler,
59
        },
60
        [IRQ_TIMER1] = {
61
                .name = "Timer1",
62
                .chip = &irq_chip_array[0],
63
                .handler = platform_timer_user_handler,
64
        },
65
};
66
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.