From: =?ISO-8859-1?Q?Frank_Svendsb=F8e?= Date: Tue, 24 Feb 2009 14:07:58 +0100 Subject: [U-Boot] saveenv command erases flash u-boot In-Reply-To: <49A3E194.3070901@aimvalley.nl> References: <22156928.post@talk.nabble.com> <49A3B945.9030909@aimvalley.nl> <1ba63b520902240156n15e613f0x61f2fd7be460d85c@mail.gmail.com> <49A3E194.3070901@aimvalley.nl> Message-ID: <1ba63b520902240507m4b9c2ae2y63baeca44ce3e8ef@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Feb 24, 2009 at 1:01 PM, Norbert van Bolhuis wrote: > Hi Frank, > > You're right. > At the time I discovered this, I wasn't sure what 'monitor' exactly > is (I feared there was more to it than just the u-boot binary code itself). > So I decided to fix it this way, let the list know and not submit a patch. > > If you want, you can submit a patch. I think correcting > CONFIG_SYS_MONITOR_LEN > will suffice. The other options sound OK to me. But you should ask > the list for opinions/approval. > Ok. Btw, I did a few shortcuts when explaining the procedure. Of course we cannot extract the content of the MONITOR_LEN variable from the map file, but we extract its address from it, then subtract TEXT_BASE, and use this address to locate its content in u-boot.bin. Reg. approval. I'm sure there is a good reason why this, or a similar technique, is not already being used by u-boot. Best regards, Frank > --- > N. van Bolhuis. > > > Frank Svendsb?e wrote: >> >> Hi Norbert, >> I just looked at your comment in the gmane archive. You shouldn't >> hardcode a new CONFIG_ENV_ADDR. Instead, you should correct the >> CONFIG_SYS_MONITOR_LEN, which is the number of bytes the U-Boot >> image uses rounded up to the next flash sector address. >> >> Maybe we should define this in terms of new CONFIG variables, say >> CONFIG_SYS_FLASH_SECT_SIZE and >> CONFIG_SYS_NUM_U_BOOT_SECTS, and then compute the new *_LEN >> based on these? Alternatively, we can avoid using defines and instead make >> it >> a "const volatile unsigned long". Then we could use a post build >> script to extract >> the image length from u-boot.map and compare it with u-boot.bin. If the >> value >> extracted from the map file is less than the u-boot.bin size, we could >> generate >> an error/warning. Any comments? >> >> Best regards, >> Frank >> >> On Tue, Feb 24, 2009 at 10:09 AM, Norbert van Bolhuis >> wrote: >>> >>> rudresh wrote: >>>> >>>> i'm using u-boot -1.3.0 in MPC8313 evaluation board, it having a NAND , >>>> NOR >>>> Flash , u-boot stored in NOR flash. when i do the saveenv , reset >>>> command >>>> the u-boot is erased. i'm not able to fix ?this issue. ?help me to fix >>>> this >>>> issue >>>> >>>> Thanks >>>> Rudresh >>>> >>>> >>>> >>>> >>> I had a similar problem, see: >>> >>> >>> http://article.gmane.org/gmane.comp.boot-loaders.u-boot/51703/match=config%5fenv%5faddr+incorrect+mpc8313erdb+h >>> >>> --- >>> N. van Bolhuis. >>> >>> _______________________________________________ >>> U-Boot mailing list >>> U-Boot at lists.denx.de >>> http://lists.denx.de/mailman/listinfo/u-boot >>> >> > >