[U-Boot] [PATCH v2] spi: omap3: Fix timeout handling

Andy Pont andy.pont at sdcsystems.com
Wed Apr 1 17:21:50 CEST 2015


Hi David,

<snipped for brevity>

>  	for (i = 0; i < len; i++) {
>  		/* wait till TX register is empty (TXS == 1) */
> +		start = get_timer(0);
>  		while (!(readl(&ds->regs->channel[ds->slave.cs].chstat) &
>  			 OMAP3_MCSPI_CHSTAT_TXS)) {
> -			if (--timeout <= 0) {
> +			if (get_timer(start) > SPI_WAIT_TIMEOUT) {
>  				printf("SPI TXS timed out, status=0x%08x\n",
>  				       readl(&ds->regs->channel[ds-
> >slave.cs].chstat));
>  				return -1;

I have a couple of questions...

Firstly, when in SPL is there access to the get_timer() function?

Secondly, when using Falcon mode to load Linux directly from SPI (Falcon
mode) then we want to maximise the throughput and save every CPU cycle we
possibly can.  Adding yet another function call into the for loop and hence
calling it a couple of million times seems, on the face of it, like it is
going to slow things down.

Regards,

Andy.



More information about the U-Boot mailing list