
In message 20030620014530.GA21955@zumanetworks.com you wrote:
The current FADS code does not seem to restore the environment properly, and i can't figure out what it SHOULD do.
It _should_ work, of course :-)
Right now, relocate_code only relocates up to the end of text (_init_end), and since CFG_MONITOR_BASE + CONFIG_MONITOR_LEN is after CFG_ENV_ADDR, ENV_IS_EMBEDDED is set.
This is probably a result of our attempt to get rid of CONFIG_MONITOR_LEN as far as possible. Now it is ONLY used to determine if the environment is embedded, or not.
Since ENV_IS_EMBEDDED is set, env_reloca_spec in flash.c does NOT memcpy(env_addr,CFG_ENV_ADDR,CFG_ENV_SIZE).
Correcnt.
There are several refereces to environment[] in start.S that are ifdefed out if CONFIG_FADS or CONFIG_ICU862, which don't look right.
Why not? I cannot speak for the FADS, of course. Won't touch no F*** ADS...
My fix is to remove those ifdefs, and make sure that ENV_IS_EMBEDDED is NOT set by reducing CFG_MONITOR_LEN to not include the environment.
What is the correct behavior?
Setting CFG_MONITOR_LEN correctly is correct. But why removing which #ifdefs ?
Best regards,
Wolfgang Denk