Skip to contentSkip to conversation

pinctrl: nxp: scu: Check the pad partition before set pinmux

PATCH New Peng Fan 2 participants 2 messages May 3, 2020 – May 11, 2020

Subsystems (3)
lore
Share & tools
lore

Peng Fan

author
#0 lore raw

PATCH 1/1 pinctrl: nxp: scu: Check the pad partition before set pinmux

From: Ye Li <[email protected]>

If a pad is not owned by current partition we should not set its pinmux.

---
 drivers/pinctrl/nxp/pinctrl-scu.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/pinctrl/nxp/pinctrl-scu.c +7 -2
index aa11075e0a..c032be782a 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright 2018 NXP
+ * Copyright 2018-2019 NXP
  */
 
 #include <common.h>
@@ -29,6 +29,11 @@ static int imx_pinconf_scu_set(struct imx_pinctrl_soc_info *info, u32 pad,
 	 * to handle that in scfw, so config it in pad conf func
 	 */
 
+	if (!sc_rm_is_pad_owned(-1, pad)) {
+		debug("Pad[%u] is not owned by curr partition\n", pad);
+		return -EPERM;
+	}
+
 	val |= PADRING_IFMUX_EN_MASK;
 	val |= PADRING_GP_EN_MASK;
 	val |= (mux << PADRING_IFMUX_SHIFT) & PADRING_IFMUX_MASK;
@@ -57,7 +62,7 @@ int imx_pinctrl_scu_conf_pins(struct imx_pinctrl_soc_info *info, u32 *pin_data,
 		config_val = pin_data[j++];
 
 		ret = imx_pinconf_scu_set(info, pin_id, mux, config_val);
-		if (ret)
+		if (ret && ret != -EPERM)
 			printf("Set pin %d, mux %d, val %d, error\n", pin_id,
 			       mux, config_val);
 	}
Signature · 1 line
2.16.4
#1 lore raw

PATCH 1/1 pinctrl: nxp: scu: Check the pad partition before set pinmux

Quoted 5 lines

From: Ye Li <[email protected]>
If a pad is not owned by current partition we should not set its pinmux.

Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================