I have a Rockchip RK3308-based board and try to figure out how to handle interrupts. In general, the idea is clear to me, but I don't completely understand how to get GIC registers offsets.
From RK3308 tech documentation, I found that GIC-400 is used in the SoC and it is mapped to address `0xff580000`.
In a device tree file I found details about GIC mapping, but I don't understand what I see:
gic: interrupt-controller@ff580000 { compatible = "arm,gic-400"; #interrupt-cells = <3>; #address-cells = <0>; interrupt-controller; reg = <0x0 0xff581000 0x0 0x1000>, <0x0 0xff582000 0x0 0x2000>, <0x0 0xff584000 0x0 0x2000>, <0x0 0xff586000 0x0 0x2000>; interrupts = <GIC_PPI 9 IRQ_TYPE_LEVEL_HIGH>; };
I know there're sets of Distributor registers and CPU interface registers for each CPU core.
How to determine base offset for each register set so that they can be accessed by application?
https://elixir.bootlin.com/linux/v4.3/source/Documentation/devicetree/bindings/arm/gic.txt
- reg : Additional regions specifying the base physical address and size of the VGIC registers. The first additional region is the GIC virtual interface control register base and size. The 2nd additional region is the GIC virtual cpu interface register base and size. reg = <0x0 0xff581000 0x0 0x1000>, //GICD_ <0x0 0xff582000 0x0 0x2000>, //GICC_ <0x0 0xff584000 0x0 0x2000>, //GICH_ <0x0 0xff586000 0x0 0x2000>; //GICV_