2022-01-28 11:25:56

by Vladimir Oltean

[permalink] [raw]
Subject: [PATCH 0/3] Use sl28cpld driver for the LS1028A-QDS QIXIS FPGA

Patches 1-2 are intended for Lee Jones (mfd) and patch 3 for Shawn Guo
(devicetree). Included all in the same patchset because they're small
and depend on each other.

With these changes, the mdio mux on the NXP LS1028A-QDS boards, which is
controlled through the QIXIS FPGA, works properly without the need for
any additional driver.

Vladimir Oltean (3):
mfd: simple-mfd-i2c: add compatible string for LS1028A-QDS FPGA
dt-bindings: mfd: add "fsl,ls1028a-qds-qixis-i2c" compatible to
sl28cpld
arm64: dts: ls1028a-qds: make the QIXIS CPLD use the simple-mfd-i2c.c
driver

.../devicetree/bindings/mfd/kontron,sl28cpld.yaml | 4 +++-
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts | 9 +++++----
drivers/mfd/simple-mfd-i2c.c | 1 +
3 files changed, 9 insertions(+), 5 deletions(-)

--
2.25.1


2022-01-28 11:26:20

by Vladimir Oltean

[permalink] [raw]
Subject: [PATCH 1/3] mfd: simple-mfd-i2c: add compatible string for LS1028A-QDS FPGA

As Michael mentions in the description of commit 3abee4579484 ("mfd: Add
simple regmap based I2C driver"), "If a device wants to use this as its
MFD core driver, it has to add an individual compatible string."

The QIXIS FPGA on the LS1028A-QDS boards has a similar purpose to the
Kontron SL28 CPLD: it deals with board power-on reset timing, muxing,
etc.

Signed-off-by: Vladimir Oltean <[email protected]>
---
drivers/mfd/simple-mfd-i2c.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/mfd/simple-mfd-i2c.c b/drivers/mfd/simple-mfd-i2c.c
index 51536691ad9d..fee709fed97a 100644
--- a/drivers/mfd/simple-mfd-i2c.c
+++ b/drivers/mfd/simple-mfd-i2c.c
@@ -63,6 +63,7 @@ static int simple_mfd_i2c_probe(struct i2c_client *i2c)
}

static const struct of_device_id simple_mfd_i2c_of_match[] = {
+ { .compatible = "fsl,ls1028a-qds-qixis-i2c" },
{ .compatible = "kontron,sl28cpld" },
{}
};
--
2.25.1

2022-01-28 11:26:27

by Vladimir Oltean

[permalink] [raw]
Subject: [PATCH 2/3] dt-bindings: mfd: add "fsl,ls1028a-qds-qixis-i2c" compatible to sl28cpld

The LS1028A-QDS QIXIS FPGA has no problem working with the
simple-mfd-i2c.c driver, so extend the list of compatible strings to
include that part.

Signed-off-by: Vladimir Oltean <[email protected]>
---
Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
index eb3b43547cb6..8c1216eb36ee 100644
--- a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
+++ b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
@@ -16,7 +16,9 @@ description: |

properties:
compatible:
- const: kontron,sl28cpld
+ enum:
+ - fsl,ls1028a-qds-qixis-i2c
+ - kontron,sl28cpld

reg:
description:
--
2.25.1

2022-01-28 11:26:32

by Vladimir Oltean

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: ls1028a-qds: make the QIXIS CPLD use the simple-mfd-i2c.c driver

The MDIO mux on the LS1028A-QDS never worked in mainline. The device
tree was submitted as-is, and there is a downstream driver for the QIXIS
FPGA:
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/tree/drivers/soc/fsl/qixis_ctrl.c?h=lf-5.10.72-2.2.0

That driver is very similar to the already existing drivers/mfd/simple-mfd-i2c.c,
and the hardware works with the simple-mfd-i2c driver, so there isn't
any reason to upstream the other one.

This change adapts the compatible string and child node format of the
FPGA node, so that the simple-mfd-i2c driver accepts it.

Signed-off-by: Vladimir Oltean <[email protected]>
---
arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
index 177bc1405f0f..6bd58fd9c90f 100644
--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
+++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a-qds.dts
@@ -314,17 +314,18 @@ sgtl5000: audio-codec@a {
};

fpga@66 {
- compatible = "fsl,ls1028aqds-fpga", "fsl,fpga-qixis-i2c",
- "simple-mfd";
+ compatible = "fsl,ls1028a-qds-qixis-i2c";
reg = <0x66>;
+ #address-cells = <1>;
+ #size-cells = <0>;

- mux: mux-controller {
+ mux: mux-controller@54 {
compatible = "reg-mux";
+ reg = <0x54>;
#mux-control-cells = <1>;
mux-reg-masks = <0x54 0xf0>; /* 0: reg 0x54, bits 7:4 */
};
};
-
};

&i2c1 {
--
2.25.1

2022-01-30 16:15:51

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH 1/3] mfd: simple-mfd-i2c: add compatible string for LS1028A-QDS FPGA

On Thu, 27 Jan 2022, Vladimir Oltean wrote:

> As Michael mentions in the description of commit 3abee4579484 ("mfd: Add
> simple regmap based I2C driver"), "If a device wants to use this as its
> MFD core driver, it has to add an individual compatible string."
>
> The QIXIS FPGA on the LS1028A-QDS boards has a similar purpose to the
> Kontron SL28 CPLD: it deals with board power-on reset timing, muxing,
> etc.
>
> Signed-off-by: Vladimir Oltean <[email protected]>
> ---
> drivers/mfd/simple-mfd-i2c.c | 1 +
> 1 file changed, 1 insertion(+)

For my own reference (apply this as-is to your sign-off block):

Acked-for-MFD-by: Lee Jones <[email protected]>

--
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

2022-02-11 13:36:07

by Michael Walle

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: mfd: add "fsl,ls1028a-qds-qixis-i2c" compatible to sl28cpld

Am 2022-02-11 14:24, schrieb Vladimir Oltean:
> On Fri, Feb 11, 2022 at 07:01:42AM -0600, Rob Herring wrote:
>> On Thu, Jan 27, 2022 at 07:21:04PM +0200, Vladimir Oltean wrote:
>> > The LS1028A-QDS QIXIS FPGA has no problem working with the
>> > simple-mfd-i2c.c driver, so extend the list of compatible strings to
>> > include that part.
>> >
>> > Signed-off-by: Vladimir Oltean <[email protected]>
>> > ---
>> > Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml | 4 +++-
>> > 1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
>> > index eb3b43547cb6..8c1216eb36ee 100644
>> > --- a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
>> > +++ b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
>> > @@ -16,7 +16,9 @@ description: |
>> >
>> > properties:
>> > compatible:
>> > - const: kontron,sl28cpld
>> > + enum:
>> > + - fsl,ls1028a-qds-qixis-i2c
>> > + - kontron,sl28cpld
>>
>> Is there some relationship between these besides happening to use the
>> same driver? Sharing a generic driver is not a reason to have the same
>> binding doc.

Ahh didn't notice this. Yes that should probably go into an own binding.

>> Your DT has a mux-controller which is undocuemnted in this binding.
>>
>> Rob
>
> I'd guess they are both programmable FPGA's/CPLD's that are used for
> board control. What I don't know is whether the sources for the Kontron
> bit stream are derived in any way from the QIXIS.

I can 100% guarantee that is not the case ;)

> I can look into adding a separate binding doc for the QIXIS anyway.

-michael

2022-02-11 14:32:52

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: mfd: add "fsl,ls1028a-qds-qixis-i2c" compatible to sl28cpld

On Thu, Jan 27, 2022 at 07:21:04PM +0200, Vladimir Oltean wrote:
> The LS1028A-QDS QIXIS FPGA has no problem working with the
> simple-mfd-i2c.c driver, so extend the list of compatible strings to
> include that part.
>
> Signed-off-by: Vladimir Oltean <[email protected]>
> ---
> Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
> index eb3b43547cb6..8c1216eb36ee 100644
> --- a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
> +++ b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
> @@ -16,7 +16,9 @@ description: |
>
> properties:
> compatible:
> - const: kontron,sl28cpld
> + enum:
> + - fsl,ls1028a-qds-qixis-i2c
> + - kontron,sl28cpld

Is there some relationship between these besides happening to use the
same driver? Sharing a generic driver is not a reason to have the same
binding doc.

Your DT has a mux-controller which is undocuemnted in this binding.

Rob

2022-02-11 16:19:20

by Vladimir Oltean

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: mfd: add "fsl,ls1028a-qds-qixis-i2c" compatible to sl28cpld

On Fri, Feb 11, 2022 at 07:01:42AM -0600, Rob Herring wrote:
> On Thu, Jan 27, 2022 at 07:21:04PM +0200, Vladimir Oltean wrote:
> > The LS1028A-QDS QIXIS FPGA has no problem working with the
> > simple-mfd-i2c.c driver, so extend the list of compatible strings to
> > include that part.
> >
> > Signed-off-by: Vladimir Oltean <[email protected]>
> > ---
> > Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
> > index eb3b43547cb6..8c1216eb36ee 100644
> > --- a/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
> > +++ b/Documentation/devicetree/bindings/mfd/kontron,sl28cpld.yaml
> > @@ -16,7 +16,9 @@ description: |
> >
> > properties:
> > compatible:
> > - const: kontron,sl28cpld
> > + enum:
> > + - fsl,ls1028a-qds-qixis-i2c
> > + - kontron,sl28cpld
>
> Is there some relationship between these besides happening to use the
> same driver? Sharing a generic driver is not a reason to have the same
> binding doc.
>
> Your DT has a mux-controller which is undocuemnted in this binding.
>
> Rob

I'd guess they are both programmable FPGA's/CPLD's that are used for
board control. What I don't know is whether the sources for the Kontron
bit stream are derived in any way from the QIXIS.

I can look into adding a separate binding doc for the QIXIS anyway.