summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurz <akurz@blala.de>2018-06-10 07:04:08 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2018-07-13 08:21:50 +0200
commit87c08ac664272a5a440be1b9323612d30b5bd64e (patch)
tree4077c7cc538abff249174bad53b2bbce657ea4db
parent542a50d4ebc72f50ff443780ecd8fca8e02d5340 (diff)
downloadbarebox-87c08ac664272a5a440be1b9323612d30b5bd64e.tar.gz
i.MX: iomuxv3: restore NO_PAD_CTRL semantic
A NO_PAD_CTRL flag used to keep a pad configuration untouched. With commit 094820a63bfd ("i.MX: iomuxv3: Use helper functions in iomux-v3.h") the NO_PAD_CTRL semantic changed to set a pad configurations to zero, which breaks non-DT boards, where NO_PAD_CTRL is freqently used to keep a boot-up default pad configuration, which often is non zero. Restore the old semantic, dont write PAD_CTRL when NO_PAD_CTRL is set. Signed-off-by: Alexander Kurz <akurz@blala.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/mach-imx/include/mach/iomux-v3.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/include/mach/iomux-v3.h b/arch/arm/mach-imx/include/mach/iomux-v3.h
index 994c15c..d1a72a2 100644
--- a/arch/arm/mach-imx/include/mach/iomux-v3.h
+++ b/arch/arm/mach-imx/include/mach/iomux-v3.h
@@ -159,14 +159,16 @@ static inline void iomux_v3_setup_pad(void __iomem *iomux, unsigned int flags,
static inline void imx_setup_pad(void __iomem *iomux, iomux_v3_cfg_t pad)
{
- uint32_t pad_ctrl;
+ uint32_t conf_reg, pad_ctrl;
+ /* dont write PAD_CTRL when NO_PAD_CTRL is set */
pad_ctrl = IOMUX_PAD_CTRL(pad);
- pad_ctrl = (pad_ctrl & NO_PAD_CTRL) ? 0 : pad_ctrl,
+ conf_reg = IOMUX_PAD_CTRL_OFS(pad);
+ conf_reg = (pad_ctrl & NO_PAD_CTRL) ? 0 : conf_reg,
iomux_v3_setup_pad(iomux, 0,
IOMUX_CTRL_OFS(pad),
- IOMUX_PAD_CTRL_OFS(pad),
+ conf_reg,
IOMUX_SEL_INPUT_OFS(pad),
IOMUX_MODE(pad),
pad_ctrl,