SPI NOR w25q128 "flash operation timed out"

Alexander Shiyan eagle.alexander923 at gmail.com
Thu Mar 9 09:52:52 PST 2023


Hello.

чт, 9 мар. 2023 г. в 20:39, Klotz, Oliver <Oliver.Klotz at knorr-bremse.com>:
>
> Hello Ahmad,
>
> while doing the bisecting it turned out, that the issue with w25q128 is not related to a specific Barebox version
> but to 2nd chip select of the SPI bus.
>
> In older products we are using Barebox-2016.07.0 and there is just the SPI NOR as single SPI slave (spi0_cs0).
> In the pinmux only spi0_cs0 is multiplexed. And this binary works fine on SOM with n25q128a13 as well as w25q128.
>
> In newer products we are using Barebox-2021.07.0 and there we have a TPM (spi0_cs1) as 2nd SPI slave.
> Since Barebox doesn´t support TPM I have removed the TPM slave node from spi0, but sp0_cs1 is still pinmuxed.
> This is just because I reuse pinmux section from the Linux dts.
>
> Whenever sp0_cs1 is pinmuxed I observe timeouts with w25q128.
> Strange thing here is that exactly the same binary works without issues on SOM with n25q128a13.
>
> Also in the Linux dts the spi0_cs1 doesn´t cause any issue and TPM as well as w25q128 are working perfectly fine.
>
> So removing the spi0_cs1 from the Barebox dts fixes my issue - please refer to dts below.
>
> Although I have a working solution I would appreciate your thoughts on this.
>
> Best regards,
> Oliver
>
>
> spi0_pins_default: spi0_pins_default {
>         pinctrl-single,pins = <
>                 AM33XX_IOPAD(0x950, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (A17) spi0_sclk.spi0_sclk */
>                 AM33XX_IOPAD(0x954, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (B17) spi0_d0.spi0_d0 */
>                 AM33XX_IOPAD(0x958, PIN_INPUT_PULLDOWN | MUX_MODE0) /* (B16) spi0_d1.spi0_d1 */
>                 AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0) /* (A16) spi0_cs0.spi0_cs0 */
> #if 0
>                 /* Do not mux spi0_cs1 which is for TPM, but causes timeouts to Winbond w25q128 SPI flash. */
>                 AM33XX_IOPAD(0x960, PIN_OUTPUT_PULLUP | MUX_MODE0) /* (C15) spi0_cs1.spi0_cs1 */
> #endif
>         >;
> };
...

A click on the SCLK on the chipselect switch may have an effect.
Try this:
AM33XX_IOPAD(0x950, PIN_INPUT | MUX_MODE0)
AM33XX_IOPAD(0x954, PIN_OUTPUT | MUX_MODE0)
AM33XX_IOPAD(0x958, PIN_INPUT | MUX_MODE0)
AM33XX_IOPAD(0x95c, PIN_OUTPUT_PULLUP | MUX_MODE0)



More information about the barebox mailing list