aboutsummaryrefslogtreecommitdiff
path: root/plat/rpi
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2019-07-21 01:45:31 +0100
committerAndre Przywara <andre.przywara@arm.com>2019-09-25 11:45:35 +0100
commit3903a8cd108188dc2dcfc5b3cb820b639c5fce01 (patch)
tree9a6d3e59277e9815a514794f8eb00e6535155c35 /plat/rpi
parent882c0ff6ba65800046a851735cc848b76810196a (diff)
downloadtrusted-firmware-a-3903a8cd108188dc2dcfc5b3cb820b639c5fce01.tar.gz
rpi4: Add GIC maintenance interrupt to GIC DT node
For being able to use the virtualisation support the GIC offers, we need to know the interrupt number of the maintenance interrupt. This information is missing from the official RPi4 device tree. Use libfdt to add the "interrupts" property to the GIC node, which allows hypervisors like KVM or Xen to be able to use the GIC's help on virtualising interrupts. Change-Id: Iab84f0885a5bf29fb84ca8f385e8a39d27700c75 Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'plat/rpi')
-rw-r--r--plat/rpi/rpi4/rpi4_bl31_setup.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/plat/rpi/rpi4/rpi4_bl31_setup.c b/plat/rpi/rpi4/rpi4_bl31_setup.c
index f8bc259f23..39aa3e45d7 100644
--- a/plat/rpi/rpi4/rpi4_bl31_setup.c
+++ b/plat/rpi/rpi4/rpi4_bl31_setup.c
@@ -222,7 +222,8 @@ static uint32_t dtb_size(const void *dtb)
static void rpi4_prepare_dtb(void)
{
void *dtb = (void *)rpi4_get_dtb_address();
- int ret;
+ uint32_t gic_int_prop[3];
+ int ret, offs;
/* Return if no device tree is detected */
if (fdt_check_header(dtb) != 0)
@@ -248,6 +249,12 @@ static void rpi4_prepare_dtb(void)
if (fdt_add_reserved_memory(dtb, "atf@0", 0, 0x80000))
WARN("Failed to add reserved memory nodes to DT.\n");
+ offs = fdt_node_offset_by_compatible(dtb, 0, "arm,gic-400");
+ gic_int_prop[0] = cpu_to_fdt32(1); // PPI
+ gic_int_prop[1] = cpu_to_fdt32(9); // PPI #9
+ gic_int_prop[2] = cpu_to_fdt32(0x0f04); // all cores, level high
+ fdt_setprop(dtb, offs, "interrupts", gic_int_prop, 12);
+
ret = fdt_pack(dtb);
if (ret < 0)
ERROR("Failed to pack Device Tree at %p: error %d\n", dtb, ret);