Enables the GIC distributor.  This needs to be done if we want to boot
inmate on bare-metal without jailhouse and doesn't hurt regular
jailhouse inmates.

Signed-off-by: Ralf Ramsauer <[email protected]>
---
 inmates/lib/arm-common/gic-v2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/inmates/lib/arm-common/gic-v2.c b/inmates/lib/arm-common/gic-v2.c
index 2123c72a..23d5b5f6 100644
--- a/inmates/lib/arm-common/gic-v2.c
+++ b/inmates/lib/arm-common/gic-v2.c
@@ -17,6 +17,8 @@
 #define GICC_PMR               0x0004
 #define GICC_IAR               0x000c
 #define GICC_EOIR              0x0010
+#define GICD_CTLR              0x0000
+#define  GICD_CTLR_ENABLE      (1 << 0)
 
 #define GICC_CTLR_GRPEN1       (1 << 0)
 
@@ -32,6 +34,7 @@ int gic_init(void)
 {
        mmio_write32(GICC_V2_BASE + GICC_CTLR, GICC_CTLR_GRPEN1);
        mmio_write32(GICC_V2_BASE + GICC_PMR, GICC_PMR_DEFAULT);
+       mmio_write32(GICD_V2_BASE + GICD_CTLR, GICD_CTLR_ENABLE);
 
        return 0;
 }
-- 
2.12.2

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to