[U-Boot] [PATCH 1/3] imx-common: fix iomux settings

Benoît Thébaudeau benoit.thebaudeau.dev at gmail.com
Sun Sep 20 13:33:20 CEST 2015


Hi Stefano, Peng, Fabio, all,

Sorry for seeing this only now, but...

On Sun, Sep 20, 2015 at 9:43 AM, Stefano Babic <sbabic at denx.de> wrote:
>
>
> On 14/09/2015 07:34, Peng Fan wrote:
>> When setting iomux for a pin mux, there is no need to check mux_ctrl_ofs.

This assumption is wrong. This check was there for a reason. Some i.MX
SoCs have some registers controlling pads but not muxes, either for a
single pin or for groups of pins:
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=arch/arm/include/asm/arch-mx25/iomux-mx25.h;h=220cf4ef2e94aa69482557852ed0cc0690a79cec;hb=HEAD
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=arch/arm/include/asm/arch-mx35/iomux-mx35.h;h=5898b46f4720088b18882e21d0d2424fff987ab5;hb=HEAD
http://git.denx.de/?p=u-boot/u-boot-imx.git;a=blob;f=arch/arm/include/asm/arch-mx5/iomux-mx51.h;h=b7b169505f91c4a213be59efca47e8a5aed770e7;hb=HEAD

I have not checked whether these cases are currently used in-tree by
U-Boot, but they have to be possible anyway in order to support these
SoCs.

>> Also If still checking mux_ctrl_ofs, we have no chance to set iomux
>> for i.MX7D IOMUXC_LPSR_SW_MUX_CTL_PAD_GPIO1_IO00, because the mux_ctrl_ofs
>> for this register is 0.

The need is clear, but then the test mechanism should be changed, not
removed. You could find a free bit in mux_ctrl_ofs or in mux_mode or
elsewhere in IOMUX_PAD (e.g. bit 63, which is currently reserved),
something like NO_PAD_CTRL, or create a reserved value other than
__NA_ for mux_ctrl_ofs/mux_mode.

>> Signed-off-by: Peng Fan <Peng.Fan at freescale.com>
>> Cc: Stefano Babic <sbabic at denx.de>
>> Cc: Fabio Estevam <fabio.estevam at freescale.com>
>> ---
>>  arch/arm/imx-common/iomux-v3.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/arch/arm/imx-common/iomux-v3.c b/arch/arm/imx-common/iomux-v3.c
>> index b4f481f..9b9cf58 100644
>> --- a/arch/arm/imx-common/iomux-v3.c
>> +++ b/arch/arm/imx-common/iomux-v3.c
>> @@ -53,8 +53,7 @@ void imx_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
>>       }
>>  #endif
>>
>> -     if (mux_ctrl_ofs)
>> -             __raw_writel(mux_mode, base + mux_ctrl_ofs);
>> +     __raw_writel(mux_mode, base + mux_ctrl_ofs);
>>
>>       if (sel_input_ofs)
>>               __raw_writel(sel_input, base + sel_input_ofs);
>>
>
> Applied (whole series) to u-boot-imx, thanks !

Please fix.

Best regards,
Benoît


More information about the U-Boot mailing list