[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALNFmy3Sbdk49hFAfabz-VYhdDMHHmyJHz8mmMdDr=wcSgCVUA@mail.gmail.com>
Date: Tue, 15 Oct 2024 09:11:30 +0200
From: Patrick Rudolph <patrick.rudolph@...ements.com>
To: Moritz Fischer <moritzf@...gle.com>
Cc: u-boot@...ts.denx.de, linux-kernel@...r.kernel.org,
Simon Glass <sjg@...omium.org>, Tom Rini <trini@...sulko.com>
Subject: Re: [PATCH v8 20/37] arm: gic-v3-its: Implement of_xlate
Hi Moritz,
On Tue, Oct 15, 2024 at 3:30 AM Moritz Fischer <moritzf@...gle.com> wrote:
>
> Hi Patrick,
>
> On Mon, Oct 14, 2024 at 6:16 AM Patrick Rudolph
> <patrick.rudolph@...ements.com> wrote:
> >
> > 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>
> > ---
> > Changelog v6:
> > - Update header order
> >
> > ---
> > 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..0d5545bfb2 100644
> > --- a/arch/arm/lib/gic-v3-its.c
> > +++ b/arch/arm/lib/gic-v3-its.c
> > @@ -4,6 +4,7 @@
> > */
> > #include <cpu_func.h>
> > #include <dm.h>
> > +#include <irq.h>
> > #include <asm/gic.h>
> > #include <asm/gic-v3.h>
> > #include <asm/io.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;
> > + }
> Aren't gicv3 at least #interrupt-cells = 3; to distinguish PPI / SPI?
Yes, you are right. I missed that since qemu SBSA uses #interrupt-cells=1.
> > +
> > + if (args->args_count > 0)
> > + irq->id = args->args[0];
> > + if (args->args_count > 1)
> > + irq->flags = args->args[1];
>
> Don't you have to distinguish PPI and SPIs here? You'll use
> args->args[0] as PPI vs SPI and args[1] is either 1:1 (PPI) or offset
> by 32 for SPIs or am I misunderstanding something?
Yes, that's correct. Will send an updated version.
> > +
> > + 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.2
> >
>
> Cheers,
> Moritz
Powered by blists - more mailing lists