[U-Boot] CONFIG_ENV_ADDR incorrect in MPC8313ERDB.h

I built the latest u-boot for MPC8313E-RDB, flashed it, and ran into trouble after saving my environment to flash.
I'm using git://git.denx.de/u-boot-nand-flash.git (I believe the "problem" is in other gits as well). I'm booting from NOR flash ('make MPC8313ERDB_33_config')
The problem is CONFIG_ENV_ADDR in MPC8313ERDB.h, it says: #define CONFIG_SYS_MONITOR_BASE TEXT_BASE /* start of monitor */ #define CONFIG_SYS_MONITOR_LEN (256 * 1024) /* Reserve 256 kB for Mon */ #define CONFIG_ENV_ADDR (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN)
I'm not sure what 'monitor' is, but the above makes CONFIG_ENV_ADDR = 0xfe040000. This is incorrect since the resulting u-boot.bin is (in my case) 265356=0x40c8c bytes.
So the saveenv overwrites u-boot itself (in my case the av_ variable, causing (k)malloc to crash every next reboot).
Although it is only a customization, setting the default CONFIG_ENV_ADDR to a correct value would save 8313E-RDB u-boot users like me the trouble finding this.
"#define CONFIG_ENV_ADDR 0xfe080000" works fine for me.
participants (1)
-
Norbert van Bolhuis