Which version of Yocto BSP are you using?
Do you set the pinmux setting for the gpio pin?
e.g. in this u-boot imx6qdl-sabresd.dtsi, there is cs-gpios setting under the node &ecspi1.
in this example, it use the gpio4_io09
cs-gpios = <&gpio4 9 0>;
And the pinmux setting of the gpio pin under pinctrl_ecspi1.
MX6QDL_PAD_KEY_ROW1__GPIO4_IO09 0x1b0b0
Hi Jimmychan,
am using Yocto dunfell for my build.
and the issue is not in the pin muxing for the cs pin, because that is correctly set in my DTB. In fact, if I replace mxcs->cs_gpios[cs] by mxcs->cs_gpios[0] in above code, everything works fine ! but that should be the value of the cs variable automatically... The slave_plat->cs should return the number 0 as am defining only one cs gpio in the DTB e.g. cs-gpios = <&gpio4 24 0>;.
Best regards
--
Abder
i.MX6Q SabreSD board and the u-boot version rel_imx_5.4.70_2.3.2. We don't meet the issue. It should not be a driver problem. Please double check the dts compare with the SabreSD board.
Log from i.MX6Q SabreSD board:
U-Boot 2020.04-dirty
CPU: i.MX6Q rev1.2 996 MHz (running at 792 MHz)
CPU: Extended Commercial temperature grade (-20C to 105C) at 44C
Reset cause: POR
Model: i.MX6 Quad SABRE Smart Device Board
Board: MX6-SabreSD
DRAM: 1 GiB
dev m25p80@0 spi_child_post_bind
spi_slave_ofdata_to_platdata cs 0
Normal Boot
Hit any key to stop autoboot: 0
=>
=> sf probe
spi_find_bus_and_cs: No bus 0
spi_find_chip_select: plat=4df6c480, cs=0
mxc_spi_cs_activate m25p80@0 cs 0
SF: Detected m25p32 with page size 256 Bytes, erase size 64 KiB, total 4 MiB
spi_get_bus_and_cs: bus=4df6c318, slave=4df75d08