From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Mon, 9 Aug 2010 15:52:03 +0200 Subject: [U-Boot] [PATCHv2 CFI flash]: Workaround for Numonyx Axcell P33/P30 256-Mbit 65nm bug In-Reply-To: <20100806231102.8307D1524E4@gemini.denx.de> References: <20100623115701.GA17625@frolo.macqel> <20100623131040.GA23209@frolo.macqel> <20100806231102.8307D1524E4@gemini.denx.de> Message-ID: <201008091552.03923.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 Hi Philippe, first sorry for the late review (thanks Wolfgang for reminding). On Saturday 07 August 2010 01:11:02 Wolfgang Denk wrote: > Dear Stefan, > > In message <20100623131040.GA23209@frolo.macqel> Philippe De Muyter wrote: > > Hello Wolfgang & list, > > > > This is a revised patch, with comments and indentation fixed, I hope. > > Minor note: Such commentary lines should be moved below the "---" line below. They shouldn't appear in the git history. > diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c > index 3267c5d..4bf0807 100644 > --- a/drivers/mtd/cfi_flash.c > +++ b/drivers/mtd/cfi_flash.c > @@ -1347,17 +1347,34 @@ int flash_real_protect (flash_info_t * info, long > sector, int prot) > > switch (info->vendor) { > > case CFI_CMDSET_INTEL_PROG_REGIONS: > > case CFI_CMDSET_INTEL_STANDARD: > - case CFI_CMDSET_INTEL_EXTENDED: > - flash_write_cmd (info, sector, 0, > - FLASH_CMD_CLEAR_STATUS); > - flash_write_cmd (info, sector, 0, FLASH_CMD_PROTECT); > + case CFI_CMDSET_INTEL_EXTENDED: { > + unsigned short cmd; > + > > if (prot) > > - flash_write_cmd (info, sector, 0, > - FLASH_CMD_PROTECT_SET); > + cmd = FLASH_CMD_PROTECT_SET; > > else > > + cmd = FLASH_CMD_PROTECT_CLEAR; Please move this variable declaration of "cmd" and assignment further down (see below). You can remove the "{" "}" of this block then. > + /* > + * see errata called > + * "Numonyx Axcell P33/P30 Specification Update" :) > + */ > + flash_write_cmd (info, sector, 0, FLASH_CMD_READ_ID); > + if (!flash_isequal (info, sector, FLASH_OFFSET_PROTECT, > + prot)) { > + int flag = disable_interrupts (); Declare and assign "cmd" here please. Please change and resubmit. Thanks. Cheers, 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 at denx.de