blob: 1ac1eab83518cc0ab444c277ffd3350601bf3cc2 [file] [log] [blame]
Aaron Durbin27ce0942014-09-11 16:07:02 -05001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2014 Google Inc
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Aaron Durbin27ce0942014-09-11 16:07:02 -050014 */
15
16#ifndef GIC_H
17#define GIC_H
18
19#if IS_ENABLED(CONFIG_GIC)
20
21/* Initialize the GIC on the currently processor, including GICD and GICC. */
22void gic_init(void);
Furquan Shaikh1e2abe02015-04-13 19:57:54 -070023void gic_disable(void);
24void gic_enable(void);
Aaron Durbin27ce0942014-09-11 16:07:02 -050025
26/* Return a pointer to the base of the GIC distributor mmio region. */
27void *gicd_base(void);
28
29/* Return a pointer to the base of the GIC cpu mmio region. */
30void *gicc_base(void);
31
32#else /* CONFIG_GIC */
33
34static inline void gic_init(void) {}
Furquan Shaikh1e2abe02015-04-13 19:57:54 -070035static inline void gic_disable(void) {}
Aaron Durbin27ce0942014-09-11 16:07:02 -050036
37#endif /* CONFIG_GIC */
38
39#endif /* GIC_H */