From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alon Bar-Lev Date: Sun, 10 Jul 2016 23:50:48 +0300 Subject: [U-Boot] [mips][cfi] Unable to write into flash under qemu In-Reply-To: <577BDBF4.8010807@gmail.com> References: <577BDBF4.8010807@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 5 July 2016 at 19:10, Daniel Schwierzeck wrote: > > Hi Alon, > > +cc Paul, Stefan > > Am 05.07.2016 um 14:04 schrieb Alon Bar-Lev: > > Hi, > > > > Found the debug setting. > > > > When I try to erase flash under qemu I get the following error, the > > erase actually succeeds in the backed file, I see sector as 0xff. > > > > Can anyone check if problem is within u-boot or qemu? > > > > Thanks! > > I've found the problem. Paul sent a fix [1] for pflash in June 2013 > to make 32 Bit access working with YAMON bootloader. > > The fix mirrors the flash status value in the upper 16 Bits of the return > value. Thus U-Boot gets a value of 0x800080 in flash_full_status_check() > after a block erase command. U-Boot compares the status value in > flash_isequal() with the expected value of 0x80 but that fails. > > Because of this I think pflash support for Malta is broken since Qemu 1.6.0. > > A possible fix could be this: Hi, Thanks again. How do we merge this fix? Regards, Alon --- > --- a/drivers/mtd/cfi_flash.c > +++ b/drivers/mtd/cfi_flash.c > @@ -608,7 +608,7 @@ static int flash_full_status_check (flash_info_t * info, flash_sect_t sector, > case CFI_CMDSET_INTEL_EXTENDED: > case CFI_CMDSET_INTEL_STANDARD: > if ((retcode == ERR_OK) > - && !flash_isequal (info, sector, 0, FLASH_STATUS_DONE)) { > + && !flash_isset (info, sector, 0, FLASH_STATUS_DONE)) { > retcode = ERR_INVAL; > printf ("Flash %s error at address %lx\n", prompt, > info->start[sector]); >