[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20240926080021.148031-21-patrick.rudolph@9elements.com>
Date: Thu, 26 Sep 2024 09:59:08 +0200
From: Patrick Rudolph <patrick.rudolph@...ements.com>
To: u-boot@...ts.denx.de,
linux-kernel@...r.kernel.org
Cc: Patrick Rudolph <patrick.rudolph@...ements.com>,
Simon Glass <sjg@...omium.org>,
Tom Rini <trini@...sulko.com>
Subject: [PATCH v5 20/36] arm: gic-v3-its: Implement of_xlate
Translate IRQs by implementing of_xlate() as required by
irq_get_by_index() to parse interrupt properties.
TEST: Booted on qemu sbsa-ref that has a GICV3.
Signed-off-by: Patrick Rudolph <patrick.rudolph@...ements.com>
Reviewed-by: Simon Glass <sjg@...omium.org>
---
arch/arm/lib/gic-v3-its.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/arch/arm/lib/gic-v3-its.c b/arch/arm/lib/gic-v3-its.c
index 22fa46a341..54dbff434c 100644
--- a/arch/arm/lib/gic-v3-its.c
+++ b/arch/arm/lib/gic-v3-its.c
@@ -7,6 +7,7 @@
#include <asm/gic.h>
#include <asm/gic-v3.h>
#include <asm/io.h>
+#include <irq.h>
#include <linux/bitops.h>
#include <linux/printk.h>
#include <linux/sizes.h>
@@ -163,8 +164,28 @@ static const struct udevice_id gic_v3_ids[] = {
{}
};
+static int arm_gic_v3_of_xlate(struct irq *irq, struct ofnode_phandle_args *args)
+{
+ if (args->args_count > 2) {
+ log_debug("Invalid args_count: %d\n", args->args_count);
+ return -EINVAL;
+ }
+
+ if (args->args_count > 0)
+ irq->id = args->args[0];
+ if (args->args_count > 1)
+ irq->flags = args->args[1];
+
+ return 0;
+}
+
+static const struct irq_ops arm_gic_v3_ops = {
+ .of_xlate = arm_gic_v3_of_xlate,
+};
+
U_BOOT_DRIVER(arm_gic_v3) = {
.name = "gic-v3",
.id = UCLASS_IRQ,
.of_match = gic_v3_ids,
+ .ops = &arm_gic_v3_ops,
};
--
2.46.0
Powered by blists - more mailing lists