Re: [PATCH RFC] of: Add of_parse_map_iter() helper for nexus node map iteration
From: Herve Codina
Date: Tue Nov 25 2025 - 02:58:01 EST
Hi Kevin,
On Mon, 24 Nov 2025 17:50:11 -0800
Kevin Hilman <khilman@xxxxxxxxxxxx> wrote:
> >
> > There's also this in flight for interrupt-map:
> >
> > https://lore.kernel.org/all/20251027123601.77216-2-herve.codina@xxxxxxxxxxx/
> >
> > There's probably enough quirks with interrupt-map that we can't use
> > the same code. Though it may boil down to handling #address-cells and
> > how the parent is looked up.
>
> Hmm, I wasn't aware of this, thanks for point it out. It looks very
> similar to what i need, except for it's hard-coding the properties as
> "#interrupt-*".
>
> Seems like this should be generalized to handle the generic nexus-node
> map. But it also seems to rely on an existing function
> of_irq_parse_imap_parent() which is also specific to interrupt maps.
>
> That being said, I'm not sure if interrupt-maps are really special, or
> if they are just a specific case of the nexus node map. This drivers/of
> code is breaking my brain, so it's more likely that I simply don't
> understand enough of it to know how to do this correctly.
>
The main difference between interrupt-map [1] and the other nexus node maps
is that in interrupt-map a child unit address is involved and translated to
the parent unit address of the matched interrupt-map item.
This child unit address is simply not present in other nexus node maps [2].
[1] https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#interrupt-map
[2] https://devicetree-specification.readthedocs.io/en/latest/chapter2-devicetree-basics.html#nexus-node-properties
Best regards,
Hervé