From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Frysinger Date: Wed, 1 Aug 2012 13:53:04 -0400 Subject: [U-Boot] [PATCH 1/2] sf: stmicro: support JEDEC standard two-byte signature In-Reply-To: <1342202839-6110-1-git-send-email-linz@li-pro.net> References: <1342202839-6110-1-git-send-email-linz@li-pro.net> Message-ID: <201208011353.05315.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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] -> -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: