Clean up SE TODOs, implement GIC nonsecure init

This commit is contained in:
Michael Scire 2018-02-27 19:58:56 -08:00
parent 1463266190
commit 0508ee29d8
5 changed files with 17 additions and 6 deletions

View file

@ -28,6 +28,18 @@ void intr_initialize_gic(void) {
GICC_BPR = 7;
}
/* Initializes Interrupt Groups 1-7 in the GIC. Called by pk2ldr. */
void intr_initialize_gic_nonsecure(void) {
for (unsigned int i = 1; i < 8; i++) {
GICD_IGROUPR[i] = 0xFFFFFFFF
}
for (unsigned int i = 0x20; i < 0xE0; i++) {
GICD_IPRIORITYR[i] = GIC_PRI_HIGHEST_NONSECURE;
}
GICD_CTLR = 1;
}
/* Sets GICC_CTLR to appropriate pre-sleep value. */
void intr_prepare_gicc_for_sleep(void) {
GICC_CTLR = 0x1E0;