From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Wed, 22 Jul 2009 10:01:51 +0200 Subject: [U-Boot] [PATCH] Add some second source legacy flash chips 256x8 In-Reply-To: <1248244909-7085-1-git-send-email-niklaus.giger@member.fsf.org> References: <1248244909-7085-1-git-send-email-niklaus.giger@member.fsf.org> Message-ID: <200907221001.51146.sr@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wednesday 22 July 2009 08:41:49 Niklaus Giger wrote: > Signed-off-by: Niklaus Giger Apart from Wolfgang's comments, please find some minor coding style comments below. > We tested some boot flashes as possible second source. > As some had ids above 0x7f, we had to implement JEDEC JEP106Z in > cfi_flash.c. I now that I just missed the merge window, but the patches are > not urgent and I was away for a three week > > drivers/mtd/cfi_flash.c | 16 +++++++++-- > drivers/mtd/jedec_flash.c | 67 > +++++++++++++++++++++++++++++++++++++++++++++ include/flash.h | > 10 ++++++- > 3 files changed, 89 insertions(+), 4 deletions(-) > > diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c > index 81ac5d3..4cd0116 100644 > --- a/drivers/mtd/cfi_flash.c > +++ b/drivers/mtd/cfi_flash.c > @@ -106,6 +106,8 @@ > #define ATM_CMD_SOFTLOCK_START 0x80 > #define ATM_CMD_LOCK_SECT 0x40 > > +#define FLASH_CONTINUATION_CODE 0x7F > + > #define FLASH_OFFSET_MANUFACTURER_ID 0x00 > #define FLASH_OFFSET_DEVICE_ID 0x01 > #define FLASH_OFFSET_DEVICE_ID2 0x0E > @@ -1541,13 +1543,21 @@ static int cmdset_intel_init(flash_info_t *info, > struct cfi_qry *qry) > > static void cmdset_amd_read_jedec_ids(flash_info_t *info) > { > - flash_write_cmd(info, 0, 0, AMD_CMD_RESET); > + ushort bankId = 0; > + uchar manuId; > + > + flash_write_cmd(info, 0, 0, AMD_CMD_RESET); > flash_unlock_seq(info, 0); > flash_write_cmd(info, 0, info->addr_unlock1, FLASH_CMD_READ_ID); > udelay(1000); /* some flash are slow to respond */ > > - info->manufacturer_id = flash_read_uchar (info, > - FLASH_OFFSET_MANUFACTURER_ID); > + manuId = flash_read_uchar (info, FLASH_OFFSET_MANUFACTURER_ID); > + /* JEDEC JEP106Z specifies ID codes up to bank 7 */ > + while(manuId == FLASH_CONTINUATION_CODE && bankId < 0x800) { Space before "(". Thanks. Best regards, Stefan ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office@denx.de =====================================================================