Message ID | ba20e078a0b5ac55510f321b282dbff192ffba15.1302272395.git.valentin.longchamp@keymile.com |
---|---|
State | Superseded |
Headers | show |
Dear Valentin Longchamp, In message <ba20e078a0b5ac55510f321b282dbff192ffba15.1302272395.git.valentin.longchamp@keymile.com> you wrote: > From: Holger Brunck <holger.brunck@keymile.com> > > The pnvram size was used later from start scripts in linux. Therefore > it must be set inside u-boot. How does this work? A plain setenv() here just adds an entry to the hash table where U-Boot stores the variables. This data is not accessable in Linux ("start scripts in linux" being init scripts?) Best regards, Wolfgang Denk
Hi Mr. Denk, On 04/30/2011 10:32 AM, Wolfgang Denk wrote: > Dear Valentin Longchamp, > > In message <ba20e078a0b5ac55510f321b282dbff192ffba15.1302272395.git.valentin.longchamp@keymile.com> you wrote: >> From: Holger Brunck <holger.brunck@keymile.com> >> >> The pnvram size was used later from start scripts in linux. Therefore >> it must be set inside u-boot. > > How does this work? A plain setenv() here just adds an entry to the > hash table where U-Boot stores the variables. This data is not > accessable in Linux ("start scripts in linux" being init scripts?) > Argh. Good catch. It actually works because we do initially one time a saveenv when we start a boot with the "release environment". But it isn't good to be dependent to a previously saveenv. I will remove it there and add this variable to the default environment. Best regards Holger Brunck
diff --git a/board/keymile/common/common.c b/board/keymile/common/common.c index 72278a0..da73f66 100644 --- a/board/keymile/common/common.c +++ b/board/keymile/common/common.c @@ -100,6 +100,9 @@ int set_km_env(void) sprintf((char *)buf, "0x%x", pnvramaddr); setenv("pnvramaddr", (char *)buf); + sprintf((char *)buf, "0x%x", CONFIG_KM_PNVRAM); + setenv("pnvramsize", (char *)buf); + pram = (CONFIG_KM_RESERVED_PRAM + CONFIG_KM_PHRAM + CONFIG_KM_PNVRAM) / 0x400; sprintf((char *)buf, "0x%x", pram);