From: Sebastian Siewior Date: Tue, 15 Jul 2008 11:57:53 +0200 Subject: [U-Boot-Users] [PATCH] cfi_flash: fix flash on Big Endian machines. In-Reply-To: <200807151148.12166.sr@denx.de> References: <20080714101829.GA11938@www.tglx.de> <200807151046.33294.sr@denx.de> <20080715093626.GD30428@www.tglx.de> <200807151148.12166.sr@denx.de> Message-ID: <20080715095753.GG30428@www.tglx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de * Stefan Roese | 2008-07-15 11:48:11 [+0200]: >OK, I'll await a separate patch for this. Could be in your inbox allready :) >> >And to you main patch: >> > >> >NAK. After applying this, CFI support on kilauea (PPC405EX with 1* >> > Spansion S29GL512N, 16bit wide) breaks: >> >> Is this big endian + CFG_WRITE_SWAPPED_DATA? Did it work before the >> patch? > >This is big endian and CFG_WRITE_SWAPPED_DATA *not* defined. You can check >this yourself, the port is officially available. And yes, of course it worked >before the patch. So I might have an idea where the bug is. >> >FLASH: CFI: Unknown command set 0x0 >> >> The command has not been sent but MSB which was 0x00. >> >> >## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB >> >> That's the message I got before my patch. There is probably still >> something wrong. >> >> >Please explain what exactly you need to fix, perhaps with an example. The >> >current version breaks other boards. >> >> I attached a file which can be used for testing. On your little endian >> machine you should have __LITTLE_ENDIAN > >Little endian? Why should I have this defined on my PPC system. It's not. nevermid... >> defined and your result should >> be 0xf0 in the case i = 0. Right now, I get 0x00 on my BE machine while >> LE case is working fine. > >I have to admit that I don't have the time to test anything right now. It >seems that you have a problem with the #else path in flash_make_cmd(). Do you >have access to a big endian platform which doesn't define >CFG_WRITE_SWAPPED_DATA? If yes, you could test both cases. No I don't, but I have an idea how I could test this assuming that it has work after the patch in question and didn't after mine. >Stefan Sebastian