[U-Boot] Pincontroller not getting initialized on imx6 in SPL with SPL_PINCTRL and OF_CONTROL
Lokesh Vutla
lokeshvutla at ti.com
Wed Feb 20 16:09:21 UTC 2019
On 2/20/2019 8:46 PM, Adam Ford wrote:
> On Wed, Feb 20, 2019 at 7:49 AM Lokesh Vutla <lokeshvutla at ti.com> wrote:
>>
>> Hi Adam,
>>
>> On 20/02/19 7:01 PM, Adam Ford wrote:
>>> I am trying to remove the manual pinmuxing code from the board file.
>>> In an effort to accomplish this, I am trying to get SPL_OF_CONTROL and
>>> SPL_PINCTRL to let me use the device tree(s) to initialize pin muxing.
>>>
>>> I have the following defined:
>>>
>>> CONFIG_SPL_PINCTRL=y
>>> CONFIG_SPL_PINCTRL_FULL=y
>>> CONFIG_SPL_PINCTRL_GENERIC=y
>>> CONFIG_SPL_PINMUX=y
>>>
>>> along with
>>> CONFIG_PINCTRL_IMX=y
>>> CONFIG_PINCTRL_IMX6=y
>>>
>>> I put some debugging code into the imx6 pinctrl and I can see that
>>> U-Boot initializes it, but that same debug message doesn't appear in
>>> SPL.
>>>
>>> I looked through the spl build directory, and I can see the drivers
>>> have been built, and the map file shows they exist, but for some
>>> reason, it doesn't initalize. If I remove the UART pin-muxing from my
>>> board file, the text for SPL doesn't' appear at all, so it's clear
>>> pinctrl isn't setting up the proper muxing yet.
>>>
>>> I am trying to figure out how/where the pinctrl system gets
>>> initialized in SPL, and I was hoping someone might have some insight.
>>
>> Pinctrl will be set as part of device_probe() call[1] for each device.
>
> Thanks for the quick reply. I took your suggestion and did a little
> more digging.
>
>>
>> Have you added u-boot,dm-spl for your pinctrl nodes? Try de-compiling spl dts
>> and check if all required nodes are available.
>
> u-boot,dm-spl is setup in a common imx6qdl-u-boot.dtsi file. The spl
> decompiled device tree show it.
>
> iomuxc at 20e0000 {
> compatible = "fsl,imx6q-iomuxc";
> reg = < 0x20e0000 0x4000 >;
> pinctrl-names = "default";
> pinctrl-0 = < 0x2b >;
> u-boot,dm-spl;
> phandle = < 0x21 >;
>
> uart1grp {
> fsl,pins = < 0x2ac 0x694 0x920 0x01 0x03 0x1b0b1 0x2a8 0x690
> 0x00 0x01 0x00 0x1b0b1 >;
> u-boot,dm-spl;
> phandle = < 0x1d >;
> };
> };
>
> With some debugging enabled during the fdtdec, I can see some chatter
> and references to it, but it looks like it cannot find it.
>
> U-Boot SPL 2019.04-rc2-03217-g2d08aa679e-dirty (Feb 20 2019 - 08:15:13 -0600)
> fdtdec_get_int_array: ranges
> get_prop_check_min_len: ranges
> fdtdec_get_int_array: ranges
> get_prop_check_min_len: ranges
> Looking for 'gpio' at 1224, name gpio at 209c000
> - gpio0, /soc/aips-bus at 2000000/gpio at 209c000
> Found seq 0
> Looking for 'pinctrl' at 1700, name iomuxc at 20e0000
> - gpio0, /soc/aips-bus at 2000000/gpio at 209c000
> - mmc0, /soc/aips-bus at 2100000/usdhc at 2190000
> - mmc1, /soc/aips-bus at 2100000/usdhc at 2194000
> - serial0, /soc/aips-bus at 2000000/spba-bus at 2000000/serial at 2020000
> Not found
> fdtdec_get_int_array: ranges
> get_prop_check_min_len: ranges
> Looking for 'mmc' at 2940, name usdhc at 2190000
> - gpio0, /soc/aips-bus at 2000000/gpio at 209c000
> - mmc0, /soc/aips-bus at 2100000/usdhc at 2190000
> Found seq 0
> Looking for 'mmc' at 3200, name usdhc at 2194000
> - gpio0, /soc/aips-bus at 2000000/gpio at 209c000
> - mmc0, /soc/aips-bus at 2100000/usdhc at 2190000
> - mmc1, /soc/aips-bus at 2100000/usdhc at 2194000
> Found seq 1
> Trying to boot from USB SDP
> SDP: initialize...
> SDP: handle requests...
> Downloading file of size 613070 to 0x177fffc0... done
> Jumping to header at 0x177fffc0
> Header Tag is not an IMX image
>
> What's interesting is that when looking for gpio and the two various
> mmc's, the above function returns 'Found seq x' in SPL whereas the
> pinctrl returns 'Not found'
Okay, most likely your pinctrl driver is not ready yet.
Your driver does not enables DM_FLAG_PRE_RELOC.
52 #if !CONFIG_IS_ENABLED(OF_CONTROL)
53 .flags = DM_FLAG_PRE_RELOC,
54 #endif
Can you enable it and try again?
Thanks and regards,
Lokesh
>
> I looked at the U-Boot part of the log and it also returns 'Not Found'
> but later in the sequence it initializes anyway.
>
> Looking for 'pinctrl' at 19064, name iomuxc at 20e0000
> - ethernet0, /soc/aips-bus at 2100000/ethernet at 2188000
> ... [bunch of entries deleted]
> - spi4, /soc/aips-bus at 2000000/spba-bus at 2000000/spi at 2018000
> Not found
>
> Late this picks up, and we start initializing pins. It seems like
> something is manually calling the pinmux since the driver probe fails,
> but it's not clear to me why it might fail.
>
>
> Found seq 2
> fdtdec_get_addr_size_fixed: reg: addr=020e0000, size=4000
> fdtdec_get_bool: fsl,input-sel
>
> (see my added debug line)
> initialized IMX pinctrl driver
>
> fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
> fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
> fdtdec_get_bool: fsl,dte-modes ʊ� �1024 MiB
> MMC: fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
> fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
> fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
> FSL_SDHC: 0, FSL_SDHC: 1, FSL_SDHC: 2
> fdtdec_get_config_int: load-environment
> Loading Environment from NAND... OK
> In: serial
> Out: serial
> Err: serial
> Net: fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
> fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
>
> Error: ethernet at 2188000 address not set.
> fdtdec_get_int_array: fsl,pins
> get_prop_check_min_len: fsl,pins
>
> Error: ethernet at 2188000 address not set.
> eth-1: ethernet at 2188000
> fdtdec_get_config_int: bootdelay
> fdtdec_get_config_int: kernel-offset
> fdtdec_get_config_int: rootdisk-offset
> fdtdec_get_config_string: bootcmd
> fdtdec_get_config_int: bootsecure
> Hit any key to stop autoboot: 0
> i.MX6 Logic #
>
>
> adam
>>
>>
>> [1]
>> http://git.denx.de/?p=u-boot.git;a=blob;f=drivers/core/device.c;h=0d15e5062b66123cd364bd9803e076db7e7dd97c;hb=HEAD#l383
>>
>> Thanks and regards,
>> Lokesh
>>
>>>
>>> thanks,
>>>
>>> adam
>>> _______________________________________________
>>> U-Boot mailing list
>>> U-Boot at lists.denx.de
>>> https://lists.denx.de/listinfo/u-boot
>>>
More information about the U-Boot
mailing list