2023-07-31 11:39:53

by Sai Krishna Potthuri

[permalink] [raw]
Subject: [PATCH v3 0/4] pinctrl: 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.

changes in v3:
- Used GENMASK for Family and SubFamily macros instead of individual LSB
and MSB macros as suggested by Michal Simek.

changes in v2:
- Updated commit description in 3/4 patch as suggested by Conor Dooley.

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 | 49 +++++++++++++++++++
drivers/pinctrl/pinctrl-zynqmp.c | 9 ++++
include/linux/firmware/xlnx-zynqmp.h | 13 +++++
4 files changed, 75 insertions(+)

--
2.25.1



2023-07-31 12:03:49

by Sai Krishna Potthuri

[permalink] [raw]
Subject: [PATCH v3 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"").

Support for configuring these properties added in Xilinx ZynqMP Platform
Management firmware(PMUFW) Configuration Set version 2.0. Linux firmware
driver checks if the configuration is supported by the PMUFW when it gets
request for TRISTATE configuration from pinctrl driver. If it supports,
then calls will be made otherwise it returns error.

Signed-off-by: Sai Krishna Potthuri <[email protected]>
Acked-by: Conor Dooley <[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-31 12:08:09

by Sai Krishna Potthuri

[permalink] [raw]
Subject: [PATCH v3 4/4] pinctrl: pinctrl-zynqmp: Add support for output-enable and bias-high impedance

Add support to handle 'output-enable' and 'bias-high-impedance'
configurations.

Using these pinctrl properties observed hang issues with older PMUFW(Xilinx
ZynqMP Platform Management Firmware), hence reverted the patch.
Commit 9989bc33c4894e075167 ("Revert "pinctrl: pinctrl-zynqmp: Add support
for output-enable and bias-high-impedance"").

Support for configuring these properties added in PMUFW Configuration Set
version 2.0. When there is a request for these configurations from pinctrl
driver for ZynqMP platform, xilinx firmware driver checks for this version
before configuring these properties to avoid the hang issue and proceeds
further only when firmware version is >=2 otherwise it returns error.

Signed-off-by: Sai Krishna Potthuri <[email protected]>
---
drivers/pinctrl/pinctrl-zynqmp.c | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/drivers/pinctrl/pinctrl-zynqmp.c b/drivers/pinctrl/pinctrl-zynqmp.c
index 8d2cb0999f2f..f2be341f73e1 100644
--- a/drivers/pinctrl/pinctrl-zynqmp.c
+++ b/drivers/pinctrl/pinctrl-zynqmp.c
@@ -415,6 +415,10 @@ static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev,

break;
case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
+ param = PM_PINCTRL_CONFIG_TRI_STATE;
+ arg = PM_PINCTRL_TRI_STATE_ENABLE;
+ ret = zynqmp_pm_pinctrl_set_config(pin, param, arg);
+ break;
case PIN_CONFIG_MODE_LOW_POWER:
/*
* These cases are mentioned in dts but configurable
@@ -423,6 +427,11 @@ static int zynqmp_pinconf_cfg_set(struct pinctrl_dev *pctldev,
*/
ret = 0;
break;
+ case PIN_CONFIG_OUTPUT_ENABLE:
+ param = PM_PINCTRL_CONFIG_TRI_STATE;
+ arg = PM_PINCTRL_TRI_STATE_DISABLE;
+ ret = zynqmp_pm_pinctrl_set_config(pin, param, arg);
+ break;
default:
dev_warn(pctldev->dev,
"unsupported configuration parameter '%u'\n",
--
2.25.1


2023-08-07 09:33:40

by Linus Walleij

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

On Mon, Jul 31, 2023 at 11:50 AM Sai Krishna Potthuri
<[email protected]> wrote:

> 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.

Patches applied to the pinctrl tree, this looks fine to me, firmware
patches ACKed by
Michal so I'm happy to take these in the set.

Yours,
Linus Walleij