From mboxrd@z Thu Jan 1 00:00:00 1970 From: Holger Brunck Date: Thu, 09 Aug 2012 09:57:23 +0200 Subject: [U-Boot] [PATCH] mtd/cfi_flash: fix write problems for Numonyx P33/30 32 MBit flashs In-Reply-To: <5023542F.6060807@denx.de> References: <1344437526-12348-1-git-send-email-holger.brunck@keymile.com> <5023542F.6060807@denx.de> Message-ID: <50236D63.5060309@keymile.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Stefan, On 08/09/2012 08:09 AM, Stefan Roese wrote: > On 08/08/2012 04:52 PM, Holger Brunck wrote: >> commit 54652991 >> Work around bug in Numonyx P33/P30 256-Mbit 65nm flash chips >> >> fixes a problem for Numonyx P33/P30 flashes for 256-Mbit, but this leads >> to problems for smaller versions of this chip e.g. the 32Mbit version >> with deviceid 0x16 on mgcoge. So move the code for this work around to >> an own function and check previously manufacturer id and device id to >> not break support for other flashes where this work around is not needed. >> >> Signed-off-by: Holger Brunck >> Signed-off-by: Heiko Schocher >> cc: Stefan Roese >> cc: Philippe De Muyter >> cc: Gerlando Falauto >> --- >> drivers/mtd/cfi_flash.c | 70 +++++++++++++++++++++++++++++++--------------- >> 1 files changed, 47 insertions(+), 23 deletions(-) >> >> diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c >> index 35294bc..690748d 100644 >> --- a/drivers/mtd/cfi_flash.c >> +++ b/drivers/mtd/cfi_flash.c >> @@ -1391,6 +1391,43 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) >> */ >> #ifdef CONFIG_SYS_FLASH_PROTECTION >> >> +#define INTEL_COMPAT 0x89 >> +#define DEV_ID_NUMONYX_256MBIT 0x8922 > > Adding defines in the middle of the source is frowned upon. > > Why don't you use INTEL_MANUFACT from flash.h instead. And add the > device id in this header as well? I would prefer this. > agreed, I'll prepare a v2. Thanks. Regards Holger