On Wed, Feb 20, 2019 at 10:09 AM Lokesh Vutla <lokeshvu...@ti.com> wrote: > > > > On 2/20/2019 8:46 PM, Adam Ford wrote: > > On Wed, Feb 20, 2019 at 7:49 AM Lokesh Vutla <lokeshvu...@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@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@209c000 > > - gpio0, /soc/aips-bus@2000000/gpio@209c000 > > Found seq 0 > > Looking for 'pinctrl' at 1700, name iomuxc@20e0000 > > - gpio0, /soc/aips-bus@2000000/gpio@209c000 > > - mmc0, /soc/aips-bus@2100000/usdhc@2190000 > > - mmc1, /soc/aips-bus@2100000/usdhc@2194000 > > - serial0, /soc/aips-bus@2000000/spba-bus@2000000/serial@2020000 > > Not found > > fdtdec_get_int_array: ranges > > get_prop_check_min_len: ranges > > Looking for 'mmc' at 2940, name usdhc@2190000 > > - gpio0, /soc/aips-bus@2000000/gpio@209c000 > > - mmc0, /soc/aips-bus@2100000/usdhc@2190000 > > Found seq 0 > > Looking for 'mmc' at 3200, name usdhc@2194000 > > - gpio0, /soc/aips-bus@2000000/gpio@209c000 > > - mmc0, /soc/aips-bus@2100000/usdhc@2190000 > > - mmc1, /soc/aips-bus@2100000/usdhc@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?
I tried forcing the DM_FLAG_PRE_RELOC and I tried making various nodes in the device tree u-boot,dm-pre-reloc instead of just u-boot,dm-spl; Either way I still can't get it to load. U-Boot SPL 2019.04-rc2-03218-gace08a038c-dirty (Feb 20 2019 - 11:30:08 -0600) fdtdec_get_int_array: ranges get_prop_check_min_len: ranges 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 1324, name gpio@209c000 - gpio0, /soc/aips-bus@2000000/gpio@209c000 Found seq 0 Looking for 'pinctrl' at 1800, name iomuxc@20e0000 - gpio0, /soc/aips-bus@2000000/gpio@209c000 - mmc0, /soc/aips-bus@2100000/usdhc@2190000 - mmc1, /soc/aips-bus@2100000/usdhc@2194000 - serial0, /soc/aips-bus@2000000/spba-bus@2000000/serial@2020000 Not found fdtdec_get_int_array: ranges get_prop_check_min_len: ranges Looking for 'mmc' at 3040, name usdhc@2190000 - gpio0, /soc/aips-bus@2000000/gpio@209c000 - mmc0, /soc/aips-bus@2100000/usdhc@2190000 Found seq 0 Looking for 'mmc' at 3300, name usdhc@2194000 - gpio0, /soc/aips-bus@2000000/gpio@209c000 - mmc0, /soc/aips-bus@2100000/usdhc@2190000 - mmc1, /soc/aips-bus@2100000/usdhc@2194000 Found seq 1 Trying to boot from USB SDP SDP: initialize... SDP: handle requests... Downloading file of size 613090 to 0x177fffc0... done Jumping to header at 0x177fffc0 Header Tag is not an IMX image I still get nothing. Any thought as to why the 'pinctrl' node would be missing? I would expect something like '/soc/aips-bus@2000000/iomuxc@20e0000' to appear in the list. Does it need an alias somehow? adam > > 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@20e0000 > > - ethernet0, /soc/aips-bus@2100000/ethernet@2188000 > > ... [bunch of entries deleted] > > - spi4, /soc/aips-bus@2000000/spba-bus@2000000/spi@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@2188000 address not set. > > fdtdec_get_int_array: fsl,pins > > get_prop_check_min_len: fsl,pins > > > > Error: ethernet@2188000 address not set. > > eth-1: ethernet@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@lists.denx.de > >>> https://lists.denx.de/listinfo/u-boot > >>> _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot