[u-boot] SPI imx8mp problem

Elmar Psilog epsi at gmx.de
Mon Feb 6 17:31:48 CET 2023


Hello,
do have some problems with SPI at an IMX8MP. I tried latest 2023.01.

I have a device attached to SPI, that needs to be configured with an
SSPI command at u-boot level. Please help me debug that, I am clueless.

sspi command returns: Invalid bus 0

my config file:
CONFIG_SPL_DM_SPI=y
CONFIG_CMD_SPI=y
CONFIG_SPI=y
CONFIG_DM_SPI=y
CONFIG_MXC_SPI=y

dt: (tested with both types of cs-gpios)
&ecspi1 {
         pinctrl-names = "default";
         pinctrl-0 = <&pinctrl_ecspi1>;
         cs-gpios = <0>, <&gpio5 9 GPIO_ACTIVE_LOW>;
//      cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
         status = "okay";
};

         pinctrl_ecspi1: ecspi1grp {
                 fsl,pins = <
                         MX8MP_IOMUXC_ECSPI1_MISO__ECSPI1_MISO 0x00000104
                         MX8MP_IOMUXC_ECSPI1_MOSI__ECSPI1_MOSI 0x00000104
                         MX8MP_IOMUXC_ECSPI1_SCLK__ECSPI1_SCLK 0x00000104
                         MX8MP_IOMUXC_ECSPI1_SS0__GPIO5_IO09 0x00000104
                 >;
         };


Turning on the log-level:

drivers/core/lists.c:201-      lists_bind_fdt() bind node spi at 30820000
drivers/core/lists.c:222-      lists_bind_fdt()    - attempt to match
compatible string 'fsl,imx8mp-ecspi'
drivers/core/lists.c:222-      lists_bind_fdt()    - attempt to match
compatible string 'fsl,imx51-ecspi'
drivers/core/lists.c:250-      lists_bind_fdt()    - found match at
'mxc_spi': 'fsl,imx51-ecspi' matches 'fsl,imx51-ecspi'

u-boot=> sspi
drivers/core/uclass.c:338-uclass_find_device_by_seq() 0
drivers/core/uclass.c:346-uclass_find_device_by_seq()    - 1 'spi at 30820000'
drivers/core/uclass.c:353-uclass_find_device_by_seq()    - not found
drivers/spi/spi-uclass.c:431- _spi_get_bus_and_cs() Invalid bus 0 (err=-19)

What am I doing wrong or is this a bug? Thanks ahead for any hint.

Best regards,
Elmar

PS: Got SPI working at v2022.04 but an other issues occur, not sure how
severe it is. At v2022.04 the SPI command is send, but at very first
call I get "Enable clock-controller at 30380000 failed".


More information about the U-Boot mailing list