From be4565f1fe3de7e16a48688ab8da39c433f0fee3 Mon Sep 17 00:00:00 2001 From: Bradley Morgan Date: Sun, 4 Oct 2026 02:24:47 +0000 Subject: tashaboot: gic init and the devicetree reg walker The interrupt controller state the kernel inherits is the bootloader's to define. On real hardware the secure world owns which interrupts the non-secure kernel will ever see, and a distributor left with random enables or secure group bits can fire before the kernel's irqchip driver is up. The gic goes into the defined state here, distributor off, every line in the non-secure group, per interrupt enables, pending and active cleared, cpu interface off. The kernel programs everything it runs with itself, it starts from zero instead of from whatever the last stage left. The controller is found in the devicetree, no hardcoded address. The new walker locates a node by name at any depth and decodes the first reg pair with the root cell counts, the same parse the kernel does. The node's own begin token starts the walk at depth zero, starting at one skips every prop in the node, the first version matched nothing. receipt: gic 8000000 off, root irq handler gic_handle_irq, smp brought up 1 node 4 cpus, run /init, busybox shell, the uart console driven by irq 14 through the gic the kernel reprogrammed over our off state. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 78cad75..6112249 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ OBJS := arch/arm64/kernel/start.o \ arch/arm64/kernel/halt.o \ arch/arm64/kernel/boot.o \ arch/arm64/lib/cache.o \ - arch/arm64/lib/semihosting.o \ + arch/arm64/lib/semihosting.o arch/arm64/lib/gic.o \ arch/arm64/lib/mmu.o \ arch/arm64/lib/psci.o \ arch/arm64/lib/system.o \ @@ -31,7 +31,7 @@ OBJS := arch/arm64/kernel/start.o \ arch/arm64/lib/timer.o \ common/main.o common/console.o common/image.o common/load.o \ common/mmutest.o common/dtb_patch.o common/dtb_reloc.o \ - common/dtb_grow.o \ + common/dtb_grow.o common/dtb_find.o \ lib/printf.o lib/itoa.o lib/semihosting.o \ $(patsubst %.c,%.o,$(wildcard lib/string/*.c)) -- cgit v1.2.3