2023-07-17 10:01:04

by Sai Krishna Potthuri

[permalink] [raw]
Subject: [PATCH 0/4] ipinctrl: pinctrl-zynqmp: Add tri-state configuration support

Add pinctrl driver support to handle 'output-enable' and
'bias-high-impedance' configurations with proper Configuration Set version
check. This will ensure system not to crash even if older Xilinx ZynqMP
Platform Management Firmware is used.
Initial Commit details:
Commit 133ad0d9af99bdca9070 ("dt-bindings: pinctrl-zynqmp: Add
output-enable configuration").
Commit ad2bea79ef0144043721 ("pinctrl: pinctrl-zynqmp: Add support
for output-enable and bias-high-impedance").

With the above patches, using these pinctrl properties in the device-tree
cause system hang issues with older Xilinx ZynqMP Platform Management
Firmware, hence reverted the patches.
Reverted Commit details:
Commit ff8356060e3a5e126abb ("Revert "dt-bindings: pinctrl-zynqmp: Add
output-enable configuration"").
Commit 9989bc33c4894e075167 ("Revert "pinctrl: pinctrl-zynqmp: Add support
for output-enable and bias-high-impedance"").
With the latest firmware and driver changes, driver will ask firmware if
that feature is supported or not by checking the version. This way it
works with all Xilinx firmwares.

Dhaval Shah (1):
firmware: xilinx: Add support to get platform information

Sai Krishna Potthuri (3):
firmware: xilinx: Add version check for TRISTATE configuration
dt-bindings: pinctrl-zynqmp: Add output-enable configuration
pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high
impedance

.../bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml | 4 ++
drivers/firmware/xilinx/zynqmp.c | 51 +++++++++++++++++++
drivers/pinctrl/pinctrl-zynqmp.c | 9 ++++
include/linux/firmware/xlnx-zynqmp.h | 15 ++++++
4 files changed, 79 insertions(+)

--
2.25.1



2023-07-17 10:02:55

by Sai Krishna Potthuri

[permalink] [raw]
Subject: [PATCH 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable configuration

Add 'output-enable' configuration parameter to the properties list.

Using these pinctrl properties observed hang issues with older Xilinx
ZynqMP Platform Management Firmware, hence reverted the patch previously.
Commit ff8356060e3a5e126abb ("Revert "dt-bindings: pinctrl-zynqmp: Add
output-enable configuration"").

Signed-off-by: Sai Krishna Potthuri <[email protected]>
---
.../devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
index 2722dc7bb03d..1e2b9b627b12 100644
--- a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
+++ b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
@@ -274,6 +274,10 @@ patternProperties:
slew-rate:
enum: [0, 1]

+ output-enable:
+ description:
+ This will internally disable the tri-state for MIO pins.
+
drive-strength:
description:
Selects the drive strength for MIO pins, in mA.
--
2.25.1


2023-07-17 10:28:11

by Sai Krishna Potthuri

[permalink] [raw]
Subject: [PATCH 2/4] firmware: xilinx: Add version check for TRISTATE configuration

Support for configuring TRISTATE parameter is added in ZYNQMP PMUFW(Xilinx
ZynqMP Platform Management Firmware) Configuration Param Set version 2.0.
If the requested configuration is TRISTATE and platform is ZYNQMP then
check the version before requesting Xilinx firmware to set the
configuration.

Signed-off-by: Sai Krishna Potthuri <[email protected]>
---
drivers/firmware/xilinx/zynqmp.c | 9 +++++++++
include/linux/firmware/xlnx-zynqmp.h | 2 ++
2 files changed, 11 insertions(+)

diff --git a/drivers/firmware/xilinx/zynqmp.c b/drivers/firmware/xilinx/zynqmp.c
index f9498e7ea694..307717f24a98 100644
--- a/drivers/firmware/xilinx/zynqmp.c
+++ b/drivers/firmware/xilinx/zynqmp.c
@@ -1150,6 +1150,15 @@ EXPORT_SYMBOL_GPL(zynqmp_pm_pinctrl_get_config);
int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param,
u32 value)
{
+ int ret;
+
+ if (pm_family_code == ZYNQMP_FAMILY_CODE &&
+ param == PM_PINCTRL_CONFIG_TRI_STATE) {
+ ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET);
+ if (ret < PM_PINCTRL_PARAM_SET_VERSION)
+ return -EOPNOTSUPP;
+ }
+
return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin,
param, value, 0, NULL);
}
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index d7f94b42ad4c..6359eeea8dd7 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -34,6 +34,8 @@
/* PM API versions */
#define PM_API_VERSION_2 2

+#define PM_PINCTRL_PARAM_SET_VERSION 2
+
#define ZYNQMP_FAMILY_CODE 0x23
#define VERSAL_FAMILY_CODE 0x26

--
2.25.1


2023-07-18 16:18:40

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable configuration

On Mon, Jul 17, 2023 at 03:03:46PM +0530, Sai Krishna Potthuri wrote:
> Add 'output-enable' configuration parameter to the properties list.
>
> Using these pinctrl properties observed hang issues with older Xilinx
> ZynqMP Platform Management Firmware, hence reverted the patch previously.
> Commit ff8356060e3a5e126abb ("Revert "dt-bindings: pinctrl-zynqmp: Add
> output-enable configuration"").

And what has changed since then that makes it okay to add?
Is the old firmware not still in the wild?

Thanks,
Conor.

>
> Signed-off-by: Sai Krishna Potthuri <[email protected]>
> ---
> .../devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
> index 2722dc7bb03d..1e2b9b627b12 100644
> --- a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
> +++ b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
> @@ -274,6 +274,10 @@ patternProperties:
> slew-rate:
> enum: [0, 1]
>
> + output-enable:
> + description:
> + This will internally disable the tri-state for MIO pins.
> +
> drive-strength:
> description:
> Selects the drive strength for MIO pins, in mA.
> --
> 2.25.1
>


Attachments:
(No filename) (1.43 kB)
signature.asc (235.00 B)
Download all attachments

2023-07-19 07:10:59

by Sai Krishna Potthuri

[permalink] [raw]
Subject: RE: [PATCH 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable configuration

Hi Conor,

> -----Original Message-----
> From: Conor Dooley <[email protected]>
> Sent: Tuesday, July 18, 2023 9:20 PM
> To: Potthuri, Sai Krishna <[email protected]>
> Cc: Linus Walleij <[email protected]>; Simek, Michal
> <[email protected]>; Rob Herring <[email protected]>; Krzysztof
> Kozlowski <[email protected]>; Conor Dooley
> <[email protected]>; Mathieu Poirier <[email protected]>; Shah,
> Tanmay <[email protected]>; Levinsky, Ben <[email protected]>;
> Marek Vasut <[email protected]>; Roman Gushchin <[email protected]>;
> Arnd Bergmann <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]; [email protected];
> [email protected]; git (AMD-Xilinx) <[email protected]>
> Subject: Re: [PATCH 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable
> configuration
>
> On Mon, Jul 17, 2023 at 03:03:46PM +0530, Sai Krishna Potthuri wrote:
> > Add 'output-enable' configuration parameter to the properties list.
> >
> > Using these pinctrl properties observed hang issues with older Xilinx
> > ZynqMP Platform Management Firmware, hence reverted the patch previously.
> > Commit ff8356060e3a5e126abb ("Revert "dt-bindings: pinctrl-zynqmp: Add
> > output-enable configuration"").
>
> And what has changed since then that makes it okay to add?
> Is the old firmware not still in the wild?
This time when Linux firmware driver get the request for TRISTATE configuration
from pinctrl driver, it checks if that configuration is supported by the Xilinx ZynqMP
Platform Management firmware. If yes, then calls will be made otherwise it returns error.

Regards
Sai Krishna
>
> Thanks,
> Conor.
>
> >
> > Signed-off-by: Sai Krishna Potthuri <[email protected]>
> > ---
> > .../devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git
> > a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
> > b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
> > index 2722dc7bb03d..1e2b9b627b12 100644
> > ---
> > a/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.yaml
> > +++ b/Documentation/devicetree/bindings/pinctrl/xlnx,zynqmp-pinctrl.ya
> > +++ ml
> > @@ -274,6 +274,10 @@ patternProperties:
> > slew-rate:
> > enum: [0, 1]
> >
> > + output-enable:
> > + description:
> > + This will internally disable the tri-state for MIO pins.
> > +
> > drive-strength:
> > description:
> > Selects the drive strength for MIO pins, in mA.
> > --
> > 2.25.1
> >

2023-07-19 16:28:13

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable configuration

On Wed, Jul 19, 2023 at 06:49:43AM +0000, Potthuri, Sai Krishna wrote:
> Hi Conor,
>
> > -----Original Message-----
> > From: Conor Dooley <[email protected]>
> > Sent: Tuesday, July 18, 2023 9:20 PM
> > To: Potthuri, Sai Krishna <[email protected]>
> > Cc: Linus Walleij <[email protected]>; Simek, Michal
> > <[email protected]>; Rob Herring <[email protected]>; Krzysztof
> > Kozlowski <[email protected]>; Conor Dooley
> > <[email protected]>; Mathieu Poirier <[email protected]>; Shah,
> > Tanmay <[email protected]>; Levinsky, Ben <[email protected]>;
> > Marek Vasut <[email protected]>; Roman Gushchin <[email protected]>;
> > Arnd Bergmann <[email protected]>; [email protected]; linux-
> > [email protected]; [email protected]; [email protected];
> > [email protected]; git (AMD-Xilinx) <[email protected]>
> > Subject: Re: [PATCH 3/4] dt-bindings: pinctrl-zynqmp: Add output-enable
> > configuration
> >
> > On Mon, Jul 17, 2023 at 03:03:46PM +0530, Sai Krishna Potthuri wrote:
> > > Add 'output-enable' configuration parameter to the properties list.
> > >
> > > Using these pinctrl properties observed hang issues with older Xilinx
> > > ZynqMP Platform Management Firmware, hence reverted the patch previously.
> > > Commit ff8356060e3a5e126abb ("Revert "dt-bindings: pinctrl-zynqmp: Add
> > > output-enable configuration"").
> >
> > And what has changed since then that makes it okay to add?
> > Is the old firmware not still in the wild?
> This time when Linux firmware driver get the request for TRISTATE configuration
> from pinctrl driver, it checks if that configuration is supported by the Xilinx ZynqMP
> Platform Management firmware. If yes, then calls will be made otherwise it returns error.

Please put that information in your commit message. With that done,
Acked-by: Conor Dooley <[email protected]>

Thanks,
Conor.


Attachments:
(No filename) (1.94 kB)
signature.asc (235.00 B)
Download all attachments