From: "J. Neuschäfer" <j.ne@posteo.net>
To: Rob Herring <robh@kernel.org>
Cc: j.ne@posteo.net, Michael Ellerman <mpe@ellerman.id.au>,
Nicholas Piggin <npiggin@gmail.com>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Naveen N Rao <naveen@kernel.org>,
Madhavan Srinivasan <maddy@linux.ibm.com>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>, Frank Li <Frank.Li@nxp.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 14/19] powerpc: mpc83xx: Switch to of_platform_populate
Date: Sat, 4 Jan 2025 14:50:16 +0000 [thread overview]
Message-ID: <Z3lKqLXphxeI1Gvo@probook> (raw)
In-Reply-To: <CAL_JsqKU0AQ+ym_iDZSN5hNUTMF0bgjqu-aAVtG792Mw_eZTbg@mail.gmail.com>
On Thu, Jan 02, 2025 at 12:51:47PM -0600, Rob Herring wrote:
> On Thu, Jan 2, 2025 at 12:32 PM J. Neuschäfer via B4 Relay
> <devnull+j.ne.posteo.net@kernel.org> wrote:
> >
> > From: "J. Neuschäfer" <j.ne@posteo.net>
> >
> > Quoting from drivers/of/platform.c:
> >
> > > of_platform_populate() - [...]
> > > Similar to of_platform_bus_probe(), this function walks the device
> > > tree and creates devices from nodes. It differs in that it follows
> > > the modern convention of requiring all device nodes to have a
> > > 'compatible' property, and it is suitable for creating devices which
> > > are children of the root node (of_platform_bus_probe will only create
> > > children of the root which are selected by the @matches argument).
> >
> > This is useful for new board ports because it means that the C code does
> > not have to anticipate every node that is placed directly under the root.
> >
> > As a consequence, the of_bus_ids list can be much shorter, and I've
> > trimmed it to the necessary parts:
> >
> > - device-type = "soc" and compatible = "simple-bus" for the SoC bus
> > - compatible = "gianfar" for the Ethernet controller (TSEC), which
> > may contain an MDIO bus, which needs to be probed, as a subnode
> >
> > Signed-off-by: J. Neuschäfer <j.ne@posteo.net>
> > ---
> > arch/powerpc/platforms/83xx/misc.c | 6 +-----
> > 1 file changed, 1 insertion(+), 5 deletions(-)
> >
> > diff --git a/arch/powerpc/platforms/83xx/misc.c b/arch/powerpc/platforms/83xx/misc.c
> > index 1135c1ab923cc120f377a0d98767fef686cad1fe..bf522ee007bbb1429233355f668fc8563d8ca4e2 100644
> > --- a/arch/powerpc/platforms/83xx/misc.c
> > +++ b/arch/powerpc/platforms/83xx/misc.c
> > @@ -94,18 +94,14 @@ void __init mpc83xx_ipic_init_IRQ(void)
> >
> > static const struct of_device_id of_bus_ids[] __initconst = {
> > { .type = "soc", },
>
> of_platform_populate() won't work on this match unless there's a
> compatible in the node, too. Can we use compatible instead or are
> there a bunch of them?
In arch/powerpc/boot/dts, I can find the following cases of device_type
= "soc" without compatible = "simple-bus":
- arch/powerpc/boot/dts/tqm8xx.dts (MPC8xx)
- arch/powerpc/boot/dts/mpc885ads.dts (MPC8xx)
- arch/powerpc/boot/dts/mpc866ads.dts (MPC8xx)
- arch/powerpc/boot/dts/ep88xc.dts (MPC8xx)
- arch/powerpc/boot/dts/kuroboxHG.dts (MPC82xx)
- arch/powerpc/boot/dts/kuroboxHD.dts (MPC82xx)
- arch/powerpc/boot/dts/storcenter.dts (MPC82xx)
- arch/powerpc/boot/dts/asp834x-redboot.dts (MPC83xx!)
- arch/powerpc/boot/dts/ksi8560.dts (MPC85xx)
i.e. there is one affected devicetree. I can simply patch that one in
the next iteration.
>
> > - { .compatible = "soc", },
> > { .compatible = "simple-bus" },
> > { .compatible = "gianfar" },
> > - { .compatible = "gpio-leds", },
> > - { .type = "qe", },
> > - { .compatible = "fsl,qe", },
>
> Better still would be if we could move the remaining ones to the
> default table and just call of_platform_default_populate().
of_platform_default_populate does sound preferable.
I'll investigate why exactly the "gianfar" match is necessary and how to
fix it in the corresponding driver (I don't think it's general enough to
warrant being listed in of_default_bus_match_table).
Best regards,
jn
next prev parent reply other threads:[~2025-01-04 14:50 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-02 18:31 [PATCH 00/19] powerpc: MPC83xx cleanup and LANCOM NWAPP2 board J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 01/19] powerpc: Generalize MPC831x platform support J. Neuschäfer via B4 Relay
2025-01-06 13:50 ` Christophe Leroy
2025-01-07 22:45 ` J. Neuschäfer
2025-01-08 6:38 ` Christophe Leroy
2025-01-02 18:31 ` [PATCH 02/19] powerpc: dts: Extract mpc8315e.dtsi from mpc8315erdb.dts J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 03/19] powerpc: dts: mpc8315e: Use IRQ_TYPE_* macros J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 04/19] powerpc: dts: mpc8315e: Add labels to peripherals J. Neuschäfer via B4 Relay
2025-01-10 15:19 ` Krzysztof Kozlowski
2025-01-10 16:17 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 05/19] powerpc: dts: mpc8315e: Disable peripherals by default J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 06/19] powerpc: dts: mpc8315e: Add missing #cells properties to SPI bus J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 07/19] powerpc: dts: mpc8315erdb: Add missing model property J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 08/19] powerpc: boot: Enable FIT image generation J. Neuschäfer via B4 Relay
2025-01-06 13:52 ` Christophe Leroy
2025-01-07 23:00 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 09/19] powerpc: boot: Build devicetrees when CONFIG_MPC831x=y J. Neuschäfer via B4 Relay
2025-01-06 13:55 ` Christophe Leroy
2025-01-07 23:24 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 10/19] powerpc: dts: Add MPC8314E devicetree J. Neuschäfer via B4 Relay
2025-01-10 15:21 ` Krzysztof Kozlowski
2025-01-10 16:28 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 11/19] dt-bindings: gpio: fsl,qoriq-gpio: Add compatible string fsl,mpc8314-gpio J. Neuschäfer via B4 Relay
2025-01-02 21:37 ` Linus Walleij
2025-01-03 8:13 ` Krzysztof Kozlowski
2025-01-02 18:31 ` [PATCH 12/19] powerpc: dts: mpc8315e: Add GPIO controller node J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 13/19] gpio: mpc8xxx: Add MPC8314 support J. Neuschäfer via B4 Relay
2025-01-02 21:38 ` Linus Walleij
2025-01-04 14:21 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 14/19] powerpc: mpc83xx: Switch to of_platform_populate J. Neuschäfer via B4 Relay
2025-01-02 18:51 ` Rob Herring
2025-01-04 14:50 ` J. Neuschäfer [this message]
2025-01-05 20:28 ` Rob Herring
2025-01-10 14:45 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 15/19] dt-bindings: vendor-prefixes: Add LANCOM Systems GmbH J. Neuschäfer via B4 Relay
2025-01-03 8:12 ` Krzysztof Kozlowski
2025-01-02 18:31 ` [PATCH 16/19] powerpc: dts: Add LANCOM NWAPP2 board devicetree J. Neuschäfer via B4 Relay
2025-01-10 15:24 ` Krzysztof Kozlowski
2025-01-10 17:10 ` J. Neuschäfer
2025-01-19 22:03 ` J. Neuschäfer
2025-01-02 18:31 ` [PATCH 17/19] powerpc: Regenerate mpc83xx_defconfig J. Neuschäfer via B4 Relay
2025-01-02 18:31 ` [PATCH 18/19] powerpc: mpc83xx_defconfig: Enable NWAPP2 board features J. Neuschäfer via B4 Relay
2025-01-02 18:32 ` [PATCH 19/19] MAINTAINERS: Add entry for LANCOM board support J. Neuschäfer via B4 Relay
2025-01-03 15:20 ` [PATCH 00/19] powerpc: MPC83xx cleanup and LANCOM NWAPP2 board Rob Herring (Arm)
2025-01-06 20:23 ` (subset) " Bartosz Golaszewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z3lKqLXphxeI1Gvo@probook \
--to=j.ne@posteo.net \
--cc=Frank.Li@nxp.com \
--cc=brgl@bgdev.pl \
--cc=christophe.leroy@csgroup.eu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=naveen@kernel.org \
--cc=npiggin@gmail.com \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).