Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <sai.krishna.potthuri@amd.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20230731095026.3766675-3-sai.krishna.potthuri@amd.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Sai Krishna Potthuri and committed by
Linus Walleij
aa5ed7b3 03ffa9af

+11
+9
drivers/firmware/xilinx/zynqmp.c
··· 1156 1156 int zynqmp_pm_pinctrl_set_config(const u32 pin, const u32 param, 1157 1157 u32 value) 1158 1158 { 1159 + int ret; 1160 + 1161 + if (pm_family_code == ZYNQMP_FAMILY_CODE && 1162 + param == PM_PINCTRL_CONFIG_TRI_STATE) { 1163 + ret = zynqmp_pm_feature(PM_PINCTRL_CONFIG_PARAM_SET); 1164 + if (ret < PM_PINCTRL_PARAM_SET_VERSION) 1165 + return -EOPNOTSUPP; 1166 + } 1167 + 1159 1168 return zynqmp_pm_invoke_fn(PM_PINCTRL_CONFIG_PARAM_SET, pin, 1160 1169 param, value, 0, NULL); 1161 1170 }
+2
include/linux/firmware/xlnx-zynqmp.h
··· 34 34 /* PM API versions */ 35 35 #define PM_API_VERSION_2 2 36 36 37 + #define PM_PINCTRL_PARAM_SET_VERSION 2 38 + 37 39 #define ZYNQMP_FAMILY_CODE 0x23 38 40 #define VERSAL_FAMILY_CODE 0x26 39 41