[U-Boot] [PATCH 1/2] sf: stmicro: support JEDEC standard two-byte signature

Mike Frysinger vapier at gentoo.org
Wed Aug 1 19:53:04 CEST 2012


On Friday 13 July 2012 14:07:18 Stephan Linz wrote:
> There are more than the M25Pxx serial flashs that can be
> used with the stmicro driver, for example: the M25PXxx or
> N25Qxx serie. All these chips have burned in the original
> stmicro manufacture id 0x20 together with a standard
> two-byte signature.

can you rebase onto mainline and re-post ?

> --- a/drivers/mtd/spi/stmicro.c
> +++ b/drivers/mtd/spi/stmicro.c
> 
>  	for (i = 0; i < ARRAY_SIZE(stmicro_spi_flash_table); i++) {
>  		params = &stmicro_spi_flash_table[i];
> -		if (params->idcode1 == idcode[2]) {
> +		if (params->id == ((idcode[1] << 8) | idcode[2]))
>  			break;
> -		}
>  	}

can you add a local u16 variable and store the computation of the idcode here 
to that above the for loop ?

>  	if (i == ARRAY_SIZE(stmicro_spi_flash_table)) {
> -		debug("SF: Unsupported STMicro ID %02x\n", idcode[1]);
> +		debug("SF: Unsupported STMicro ID %02x%02x\n",
> +				idcode[1], idcode[2]);

then here you can simply change:
	%02x -> %04x
	idcode[1] -> <new var>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120801/96268ffa/attachment.pgp>


More information about the U-Boot mailing list