Re: omap2-mcspi multi mode

From: Louis Chauvet
Date: Thu Jun 06 2024 - 04:06:26 EST


Le 04/06/24 - 22:04, Colin Foster a écrit :
> Hi Louis,

Hi,

> I found that commit e64d3b6fc9a3 ("spi: omap2-mcpsi: Enable MULTI-mode
> in more situations") caused a regression in the ocelot_mfd driver. It
> essentially causes the boot to hang during probe of the SPI device.

I don't know what can cause this. My patch can "compact" few words into
only a bigger one, so the signal on the cable can change, but it follows
the SPI specification and the device should have the same behavior.

Instead of two very distinct words (for example two 8 bits words):

<-- first word --> <-- second word -->
_ _ _ _ _ _ _ _ _ _
__| |_| |_| ... |_| |____________| |_| |_| ... |_| |_

The signal on the wire will be merged into one bigger (one 16 bits word):

<-- first word --> <-- second word -->
_ _ _ _ _ _ _ _ _ _
__| |_| |_| ... |_| |_| |_| |_| ... |_| |_

> The following patch restores functionality. I can hook up a logic
> analyzer tomorrow to get some more info, but I wanted to see if you had
> any ideas.

I don't understand the link between the solution and my patch, can you
share the logic analyzer results?

Maybe the issue is the same as [1]? Does it solves the issue?

[1]: https://lore.kernel.org/all/20240506-fix-omap2-mcspi-v2-1-d9c77ba8b9c7@xxxxxxxxxxx/

> --- a/drivers/mfd/ocelot-spi.c
> +++ b/drivers/mfd/ocelot-spi.c
> @@ -225,6 +228,8 @@ static int ocelot_spi_probe(struct spi_device *spi)
> }
>
> spi->bits_per_word = 8;
> + spi->word_delay.value = 1;
> + spi->word_delay.unit = SPI_DELAY_UNIT_NSECS;
>
> err = spi_setup(spi);
> if (err)
>
>
> Colin Foster
>
>

--
Louis Chauvet, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com