[PATCH v1 1/1] soft_spi performance enhancement

neil.armstrong at linaro.org neil.armstrong at linaro.org
Tue Jun 10 18:50:02 CEST 2025


On 10/06/2025 18:38, verdun at hpe.com wrote:
> From: Jean-Marie Verdun <verdun at hpe.com>
> 
> Add a test when delay is set to 0 to improve performances
> by 20% on ARM based systems
> 
> Signed-off-by: Jean-Marie Verdun <verdun at hpe.com>
> ---
>   drivers/spi/soft_spi.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/soft_spi.c b/drivers/spi/soft_spi.c
> index 50bd7be5640..e97352000f8 100644
> --- a/drivers/spi/soft_spi.c
> +++ b/drivers/spi/soft_spi.c
> @@ -173,7 +173,8 @@ static int soft_spi_xfer(struct udevice *dev, unsigned int bitlen,
>   			soft_spi_scl(dev, !cidle);
>   		if ((txrx & SPI_MASTER_NO_TX) == 0)
>   			soft_spi_sda(dev, !!(tmpdout & 0x80));
> -		udelay(plat->spi_delay_us);
> +		if (plat->spi_delay_us)
> +			udelay(plat->spi_delay_us);
>   
>   		/*
>   		 * sample bit
> @@ -190,7 +191,8 @@ static int soft_spi_xfer(struct udevice *dev, unsigned int bitlen,
>   							    &plat->mosi :
>   							    &plat->miso);
>   		tmpdout	<<= 1;
> -		udelay(plat->spi_delay_us);
> +		if (plat->spi_delay_us)
> +			udelay(plat->spi_delay_us);
>   
>   		/*
>   		 * drive bit

Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>


More information about the U-Boot mailing list