powerpc/fsl_lbc: Explicitly populate bus
PATCH 1/1 powerpc/fsl_lbc: Explicitly populate bus
Historically, devicetree nodes representing the Freescale Enhanced Local Bus Controller (eLBC) have compatible strings such as:
compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";
The "simple-bus" string causes the bus to be populated, and the memory devices contained within it to be discovered. The eLBC bus (as represented in device trees) differs from a simple-bus in a few ways, though:
- Addresses are not simple/linear: The first cell of an address is a chip select, the second is an linear address within the space thus selected. Representing 1,0 as 100000000, for example, would decrease readability[1].
- It is expected that the devices on a simple-bus "can be accessed directly without additional configuration required"[2], but the eLBC needs some configuration.
To accommodate devicetrees that declare an eLBC without "simple-bus", explicitly populate the bus in the eLBC driver.
[1]: dtc makes such a suggestion opon encountering an eLBC [2]: Quoting the Devicetree Specification Release v0.3
--- arch/powerpc/sysdev/fsl_lbc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/powerpc/sysdev/fsl_lbc.c +2 -1
@@ -20,6 +20,7 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/of_platform.h> #include <linux/slab.h> #include <linux/sched.h> #include <linux/platform_device.h>
@@ -336,7 +337,7 @@ static int fsl_lbc_ctrl_probe(struct platform_device *dev)/* Enable interrupts for any detected events */ out_be32 (&fsl_lbc_ctrl_dev->regs->lteir,LTEIR_ENABLE ); -return 0 ; +return devm_of_platform_populate (&dev->dev); err1:free_irq (fsl_lbc_ctrl_dev->irq[0 ], fsl_lbc_ctrl_dev);
---
base-commit: 7ccde445dddcca030cd6ed66974bb80915ad9dd5
change-id: 20250209-localbus-94a6ebb04c12
Best regards,
Signature · 1 line
J. Neuschäfer <[email protected]>
Quoted 20 lines · On Sun, Feb 09, 2025 at 10:58:50PM +0100, J. Neuschäfer via B4 Relay wrote:
From: "J. Neuschäfer" <[email protected]>
Historically, devicetree nodes representing the Freescale Enhanced Local Bus Controller (eLBC) have compatible strings such as:
compatible = "fsl,mpc8313-elbc", "fsl,elbc", "simple-bus";The "simple-bus" string causes the bus to be populated, and the memory devices contained within it to be discovered. The eLBC bus (as represented in device trees) differs from a simple-bus in a few ways, though:
- Addresses are not simple/linear: The first cell of an address is a chip select, the second is an linear address within the space thus selected. Representing 1,0 as 100000000, for example, would decrease readability[1].
- It is expected that the devices on a simple-bus "can be accessed directly without additional configuration required"[2], but the eLBC needs some configuration.
Quoted 8 lines
To accommodate devicetrees that declare an eLBC without "simple-bus", explicitly populate the bus in the eLBC driver.
[1]: dtc makes such a suggestion opon encountering an eLBC [2]: Quoting the Devicetree Specification Release v0.3
Signed-off-by J. Neuschäfer <[email protected]>---
Due to advice from Crystal Wood and Rob Herring[1], I reached the conclusion that this patch is not necessary.
[1]: https://lore.kernel.org/lkml/Z7ILej_AJYot_wKP@probook/
Quoted 34 lines
arch/powerpc/sysdev/fsl_lbc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/powerpc/sysdev/fsl_lbc.c +2
-2@@ -20,6 +20,7 @@#include <linux/of.h> #include <linux/of_address.h> #include <linux/of_irq.h> +#include <linux/of_platform.h> #include <linux/slab.h> #include <linux/sched.h> #include <linux/platform_device.h> @@ -336,7 +337,7 @@ static int fsl_lbc_ctrl_probe(struct platform_device *dev)/* Enable interrupts for any detected events */ out_be32 (&fsl_lbc_ctrl_dev->regs->lteir,LTEIR_ENABLE ); -return 0 ; +return devm_of_platform_populate (&dev->dev); err1:free_irq (fsl_lbc_ctrl_dev->irq[0 ], fsl_lbc_ctrl_dev); ---base-commit:
7ccde445dddcca030cd6ed66974bb80915ad9dd5
change-id: 20250209-localbus-94a6ebb04c12Best regards,
Signature · 1 line
J. Neuschäfer <[email protected]>