Aaron Durbin | 27ce094 | 2014-09-11 16:07:02 -0500 | [diff] [blame] | 1 | /* |
| 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 Durbin | 27ce094 | 2014-09-11 16:07:02 -0500 | [diff] [blame] | 14 | */ |
| 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. */ |
| 22 | void gic_init(void); |
Furquan Shaikh | 1e2abe0 | 2015-04-13 19:57:54 -0700 | [diff] [blame] | 23 | void gic_disable(void); |
| 24 | void gic_enable(void); |
Aaron Durbin | 27ce094 | 2014-09-11 16:07:02 -0500 | [diff] [blame] | 25 | |
| 26 | /* Return a pointer to the base of the GIC distributor mmio region. */ |
| 27 | void *gicd_base(void); |
| 28 | |
| 29 | /* Return a pointer to the base of the GIC cpu mmio region. */ |
| 30 | void *gicc_base(void); |
| 31 | |
| 32 | #else /* CONFIG_GIC */ |
| 33 | |
| 34 | static inline void gic_init(void) {} |
Furquan Shaikh | 1e2abe0 | 2015-04-13 19:57:54 -0700 | [diff] [blame] | 35 | static inline void gic_disable(void) {} |
Aaron Durbin | 27ce094 | 2014-09-11 16:07:02 -0500 | [diff] [blame] | 36 | |
| 37 | #endif /* CONFIG_GIC */ |
| 38 | |
| 39 | #endif /* GIC_H */ |