[U-Boot] Saving environment question

Wolfgang Denk wd at denx.de
Fri Apr 1 07:19:15 CEST 2011


Dear Charles Krinke,

In message <AANLkTikJFQLX4LrA7BZsAQ2nJy0EhinH+Evwe8Csorkf at mail.gmail.com> you wrote:
>
>     up_data = (end_addr + 1 - ((long)flash_addr + CONFIG_ENV_SIZE));
>     debug("2 Data to save 0x%lx  end:%lx new:%lx\n", up_data, end_addr,
> flash_addr);
>     if (up_data) {
>         if ((saved_data = malloc(up_data)) == NULL) {
>             printf("Unable to save the rest of sector (%ld)\n",
>                 up_data);
>             goto done;
>         }
> 
> At the debug statement, up_data = 0x1E000, end_addr = 0xFE07FFFF and
> flash_addr = 0xFE060000. The end_addr and flash_addr seem reasonable to me
> as the flash in 128Kb sectors in the MPC8323ERDB so the first few sectors
> are:

Hmm...

	up_data = (end_addr + 1 - ((long)flash_addr + CONFIG_ENV_SIZE));

so

	CONFIG_ENV_SIZE = up_data + flash_addr - end_addr - 1
			= 0x1E000 + 0xFE060000 - 0xFE07FFFF - 1
			= -8192

The values you give here make no sense to me, as CONFIG_ENV_SIZE is
supposed to be a positive number.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If something is different, it's either better or worse,  and  usually
both.                                                    - Larry Wall


More information about the U-Boot mailing list