From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Tue, 13 Jun 2006 12:49:46 -0400 Subject: [U-Boot-Users] Using at91 with a different parallel flash, request for help In-Reply-To: <448EC287.4030409@randrlabs.com> References: <20060613070511.AAD25353C1B@atlas.denx.de> <448EC287.4030409@randrlabs.com> Message-ID: <448EECAA.2050508@smiths-aerospace.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de A: We hate "JEOPARDY! America's Favorite Quiz Show(R)." Q: Why should I not top-post? Your hardware is configured for little endian or big endian. That is a hardware issue and it is your hardware, not ours, so it is your issue. Your driver is apparently writing "wrong endian." That is a software bug. It is almost always better to fix your software than try to change the endian of your hardware. I'm not familiar with the at91 (ARM) CPU, but typically changing endian is either impossible or causes major problems if you pick the "wrong" endianness. Steps: 1) Find your CPU's reference manual(s) and see what it supports (it appears to be little endian) 2) Pick the native/best supported endianess - Since u-boot runs, it implies that whatever your flash programmer uses is "right endian". Conform, it is your only hope. 3) Make sure your hardware is configured for that endianess (assuming it is configurable) - Since u-boot runs, this should be OK 4) Make sure your software writes bytes in the correct endian - This is your bug Wolfgang refers to below. Fix it. Hardware designers have been known to do us software jocks "favors" when hooking up flash chips, resulting in the control byte being in an unconventional byte location (e.g. big endian in a little endian world or vice versa). That is no big deal, your flash driver can handle this (easiest is to treat all the bytes as control/status when in programming mode) and the processor really doesn't care one whit when it is executing, as long as you wrote the data bytes in the "right endian" (which is exactly your problem). gvb P.S. Netiquette links on (not) top posting: http://www.netmeister.org/news/learn2quote2.html#ss2.3 http://www.netmeister.org/news/learn2quote.html Roman Kolesnikov wrote: > Hello everyone, > I have been testing my driver, and I ofund that my driver writes litttle > endian. I have not found so far, how I can set UBoot to read little > endian from the flash. However, that is the trouble in my case. This is > also the reason why I can load Uboot from flash, but nothing past uboot > can be retrieved or saved without any corruption. > > I am not sure, where I can find more information about the little-endian > or big-endian settings. Please advice, > > Thanks in advance, > Roman > > > Wolfgang Denk wrote: > >> In message <448E475F.90705@randrlabs.com> you wrote: >> >> >>> I copy uboot 1.1.4(low level present) into flash at 10000000 >>> I reset with external boot juped >>> uboot 1.1.4 loads fine >>> I saveenv >>> I reboot >>> I get errors about crc and stdin,out and error >>> I do printenv, I get 65K of . >>> At this point I see that my env variables are corrupted. >>> >>> >> So either the configuration in your board config file is wrong, and >> does not match the layout of your image, and/or your flash driver is >> broken. >> >> >> >>> Somehow my data is corrupted. But why and how does the original uboot >>> saved to flash is loading fine? >>> >>> >> So probably your flash driver is broken. >> >> Best regards, >> >> Wolfgang Denk