[flashrom] [PATCH] Move SB600 SPI initialization to sb600spi.c

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Jul 22 19:28:24 CEST 2010


On 22.07.2010 18:56, Michael Karcher wrote:
> Signed-off-by: Michael Karcher <flashrom at mkarcher.dialup.fu-berlin.de>
>
> --- a/sb600spi.c
> +++ b/sb600spi.c
> @@ -152,4 +152,80 @@ int sb600_spi_send_command(unsigned int writecnt, unsigned int readcnt,
>  	return 0;
>  }
>  
> +int sb600_probe_spi(struct pci_dev *dev)
> +{
> [...]
> +	msg_pdbg("GPIO11 used for %s\n", (reg & (1 << 6)) ? "GPIO" : "SPI_DO");
> +	msg_pdbg("GPIO12 used for %s\n", (reg & (1 << 7)) ? "GPIO" : "SPI_DI");
> +	if (reg != 0x00)
> +		return 0;
> [...]
> +	msg_pdbg("GPIO31 used for %s\n", (reg & (1 << 6)) ? "GPIO" : "SPI_HOLD");
> +	msg_pdbg("GPIO32 used for %s\n", (reg & (1 << 7)) ? "GPIO" : "SPI_CS");
> +	if ((reg & 0x80) != 0x00)
> +		return 0;
> [...]
> +	msg_pdbg("GPIO47 used for %s\n", (reg & (1 << 6)) ? "GPIO" : "SPI_CLK");
> +	if (reg != 0x00)
> +		return 0;
>   

We might want to print a short msg_pdbg("Not enabling SPI"); in each of
the cases where we return 0, but that's not strictly required and I want
to get this patch in now. Please go ahead.

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list