]> rtime.felk.cvut.cz Git - jailhouse.git/blob - inmates/lib/arm/gic-v2.c
inmates: arm: Flatten include path
[jailhouse.git] / inmates / lib / arm / gic-v2.c
1 /*
2  * Jailhouse, a Linux-based partitioning hypervisor
3  *
4  * Copyright (c) ARM Limited, 2014
5  *
6  * Authors:
7  *  Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
8  *
9  * This work is licensed under the terms of the GNU GPL, version 2.  See
10  * the COPYING file in the top-level directory.
11  */
12 #include <asm/gic_common.h>
13 #include <asm/gic_v2.h>
14 #include <mach/gic_v2.h>
15 #include <gic.h>
16
17 void gic_enable(unsigned int irqn)
18 {
19         mmio_write32(GICD_BASE + GICD_ISENABLER, 1 << irqn);
20 }
21
22 int gic_init(void)
23 {
24         mmio_write32(GICC_BASE + GICC_CTLR, GICC_CTLR_GRPEN1);
25         mmio_write32(GICC_BASE + GICC_PMR, GICC_PMR_DEFAULT);
26
27         return 0;
28 }
29
30 void gic_write_eoi(u32 irqn)
31 {
32         mmio_write32(GICC_BASE + GICC_EOIR, irqn);
33 }
34
35 u32 gic_read_ack(void)
36 {
37         return mmio_read32(GICC_BASE + GICC_IAR);
38 }