Re: [U-Boot] Redundant Env
opps! defined DEVICE2_OFFSET as #define DEVICE2_OFFSET DEVICE1_OFFSET+ENV1_SIZE Thanks S From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Tuesday, August 14, 2012 11:09 PM Subject: Redundant Env When enabling HAVE_REDUND in uboot-tools, will it work if i have the redundant partition in the same sector #define DEVICE1_NAME "/dev/mtd1" #define DEVICE2_NAME "/dev/mtd1" #define DEVICE1_OFFSET 0x0 #define ENV1_SIZE 0x1 #define DEVICE1_ESIZE 0x2 #define DEVICE1_ENVSECTORS 1 #define DEVICE2_OFFSET 0x0 #define ENV2_SIZE 0x1 #define DEVICE2_ESIZE 0x2 // erase size is 128K #define DEVICE2_ENVSECTORS 1 Thanks Sridhar___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Redundant Env
When enabling HAVE_REDUND in uboot-tools, will it work if i have the redundant partition in the same sector #define DEVICE1_NAME "/dev/mtd1" #define DEVICE2_NAME "/dev/mtd1" #define DEVICE1_OFFSET 0x0 #define ENV1_SIZE 0x1 #define DEVICE1_ESIZE 0x2 #define DEVICE1_ENVSECTORS 1 #define DEVICE2_OFFSET 0x0 #define ENV2_SIZE 0x1 #define DEVICE2_ESIZE 0x2 // erase size is 128K #define DEVICE2_ENVSECTORS 1 Thanks Sridhar ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] u-boot script question
I'm using spare bytes of the nvram of the RTC chip to determine which of my two kernels should be booted. Trying to scrip that in u-boot script I'm doing the following. 1. Load 200010 with 0 (mw.b 200010 0) 2. Load 200014 with value from nvram (i2c read 68 15 1 200014) 3. if cmp.b 200010 200014 1; then run boot0; else run boot1;fi Is it possible to compare the contents of the memory location with a constant like if test #200010 == 1; then run boot0; else run boot1;fi Thanks S___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] u-boot script "test"
For now i got around this problem with a negative test set x if test $x != 1 then echo "No"; else echo "Yes"; fi with this if x is not present i get No, even in the case when x is present and set any other value (not 1) when i do "set x 1" and run the test again i get "Yes" Thanks Sridhar ________ From: Wolfgang Denk To: Sridhar Addagada Cc: "u-boot@lists.denx.de" Sent: Tuesday, January 24, 2012 4:13 PM Subject: Re: [U-Boot] u-boot script "test" Dear Sridhar Addagada, In message <1327396047.99588.yahoomail...@web120201.mail.ne1.yahoo.com> you wrote: > > What is the behavior of test command when the variable is not present in the > uboot env It should be the same as in any other bourne compatible shell. > set x Note that "set" for "setenv" may or may not work, depending on your command selection. > if test $x = 1; then echo "Yes"; else echo "No"; fi This should provoke an error from the "test" command which misses an argument. > in the above case I get Yes echoed back. That's a bug then. Patches welcome... > Is there any way to test the presence of a variable in uboot script? This should be possible like in any other shell... 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: w...@denx.de Alan Turing thought about criteria to settle the question of whether machines can think, a question of which we now know that it is about as relevant as the question of whether submarines can swim. -- Edsger Dijkstra___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] u-boot script "test"
What is the behavior of test command when the variable is not present in the uboot env set x if test $x = 1; then echo "Yes"; else echo "No"; fi in the above case I get Yes echoed back. Is there any way to test the presence of a variable in uboot script? Thanks Sridhar ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] usage of i2c command in hush script
Hello, Is it possible to use i2c output in a u-boot script something like if test "i2c md.0 68 f = 0x80";then; echo "Watchdog Triggered";else; echo "Power Cycle"; fi the only problem is that i2c command outputs something like=> i2c md 68 f 000f: 00 . and comparing the entire string is not working. Any inputs would help. I can try this in the main_loop, but if i can do it in shell then i would want to avoid that. Thanks Sridhar ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Boot Count Support for MPC8377E
Freescale folks! no suggestions:( From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Tuesday, December 20, 2011 8:59 AM Subject: Boot Count Support for MPC8377E It's been almost a month and have not heard any suggestions from anyone.. Can Freescale folks on the list suggest some reg's or memory location where boot count value can be saved across reboots. Thanks S ____ From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Friday, November 25, 2011 5:24 PM Subject: CONFIG_BOOTCOUNT_LIMIT I' need to enable CONFIG_BOOTCOUNT_LIMIT, which is based one MPC8377ERDB, and am looking for recommended address for CONFIG_BOOTCOUNT_ADDR, any suggestions. Thanks S___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] avoid flash writes for new keys, with no values with fw_setenv
This will avoid flash writes for fw_setenv command where the key is not present the environment and no value has been provided. Signed-off-by: Sridhar Addagada --- tools/env/fw_env.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/env/fw_env.c b/tools/env/fw_env.c index 996682e..68597a5 100644 --- a/tools/env/fw_env.c +++ b/tools/env/fw_env.c @@ -366,7 +366,7 @@ int fw_env_close(void) */ int fw_env_write(char *name, char *value) { - int len; + int len, found = 0; char *env, *nxt; char *oldval = NULL; @@ -415,7 +415,7 @@ int fw_env_write(char *name, char *value) /* Delete only ? */ if (!value || !strlen(value)) - return 0; + return (found ? 0 : -1); /* * Append new definition at the end @@ -460,7 +460,7 @@ int fw_env_write(char *name, char *value) */ int fw_setenv(int argc, char *argv[]) { - int i, len; + int r, i, len; char *name; char *value = NULL; char *tmpval = NULL; @@ -501,12 +501,13 @@ int fw_setenv(int argc, char *argv[]) *tmpval++ = *val++; } - fw_env_write(name, value); + r = fw_env_write(name, value); if (value) free(value); - return fw_env_close(); +// avoid flash write for new keys, with no values. + return ((-1 == r) ? r : fw_env_close()); } /* -- 1.7.3.GIT___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Reset Status on MPC83xx
Thought so, i was looking at the wrong manual 837x, hence did not find the section Thanks S From: Wolfgang Denk To: Sridhar Addagada Cc: "u-boot@lists.denx.de" Sent: Tuesday, December 20, 2011 5:18 PM Subject: Re: [U-Boot] Reset Status on MPC83xx Dear Sridhar Addagada, In message <1324360794.59571.yahoomail...@web120203.mail.ne1.yahoo.com> you wrote: > > In an effort to find the cause of reboot from linux userspace, which > was always returning hardreset, i traced the reason for the reset > status register being cleared is from file > arch/powerpc/cpu/mpc83xx/cpu_init.c, > > /* RSR - Reset Status Register - clear all status (4.6.1.3) */ > gd->reset_status __raw_readl(&im->reset.rsr); > __raw_writel(~(RSR_RES), &im->reset.rsr); > > > Can anyone throw some light why it is getting cleared and what is 4.6.1.3 "(4.6.1.3)" usually means the relevant section in the respective user's manual (MPC8349E PowerQUICC II Pro Integrated Host Processor Family Reference Manual, Rev. 1), here section "4.6.1.3 Reset Status Register (RSR)" on page 4-37 ff. The Note also explains why it makes sense to clear the register (so you can get a sane state for only the next reset/reboot). 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: w...@denx.de What can it profit a man to gain the whole world and to come to his property with a gastric ulcer, a blown prostate, and bifocals? -- John Steinbeck, _Cannery Row U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Reset Status on MPC83xx
In an effort to find the cause of reboot from linux userspace, which was always returning hardreset, i traced the reason for the reset status register being cleared is from file arch/powerpc/cpu/mpc83xx/cpu_init.c, /* RSR - Reset Status Register - clear all status (4.6.1.3) */ gd->reset_status = __raw_readl(&im->reset.rsr); __raw_writel(~(RSR_RES), &im->reset.rsr); Can anyone throw some light why it is getting cleared and what is 4.6.1.3 Thanks S ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Boot Count Support for MPC8377E
It's been almost a month and have not heard any suggestions from anyone.. Can Freescale folks on the list suggest some reg's or memory location where boot count value can be saved across reboots. Thanks S ____ From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Friday, November 25, 2011 5:24 PM Subject: CONFIG_BOOTCOUNT_LIMIT I' need to enable CONFIG_BOOTCOUNT_LIMIT, which is based one MPC8377ERDB, and am looking for recommended address for CONFIG_BOOTCOUNT_ADDR, any suggestions. Thanks S___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] uboot to load uboot
The board is based on MPC8377ERDB S From: Mike Frysinger To: u-boot@lists.denx.de; Sridhar Addagada Sent: Tuesday, November 29, 2011 11:20 AM Subject: Re: [U-Boot] uboot to load uboot On Tuesday 29 November 2011 00:38:40 Sridhar Addagada wrote: > Here is a scenario, i have a working version of the u-boot on my board, and > am trying my changes. Am not sure it is going to freeze the board, so > would like the present version to load the new version for testing before > it can be burned to flash. Is it possible to do this or is it already > done? i think it depends on the architecture. most cannot do this. what arch/cpu/SoC/board exactly are you using ? please fix your e-mail client to wrap long lines -mike___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] uboot to load uboot
Here is a scenario, i have a working version of the u-boot on my board, and am trying my changes. Am not sure it is going to freeze the board, so would like the present version to load the new version for testing before it can be burned to flash. Is it possible to do this or is it already done? Thanks S ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] CONFIG_BOOTCOUNT_LIMIT
Sorry! my mistake, the code is in main.c : : bootcount_store(bootcount); sprintf (bcs_set, "%lu", bootcount); setenv("bootcount", bcs_set); : : ____ From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Tuesday, November 29, 2011 9:03 AM Subject: Re: CONFIG_BOOTCOUNT_LIMIT Any recommendations for the scratch pad memory area. I noticed in bootcount.c that even though the configured memory area is updated, even the environment variable is also being update. My question is that will it got lost when the kernel takes control. Thanks S ________ From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Friday, November 25, 2011 5:24 PM Subject: CONFIG_BOOTCOUNT_LIMIT I' need to enable CONFIG_BOOTCOUNT_LIMIT, which is based one MPC8377ERDB, and am looking for recommended address for CONFIG_BOOTCOUNT_ADDR, any suggestions. Thanks S___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] CONFIG_BOOTCOUNT_LIMIT
Any recommendations for the scratch pad memory area. I noticed in bootcount.c that even though the configured memory area is updated, even the environment variable is also being update. My question is that will it got lost when the kernel takes control. Thanks S From: Sridhar Addagada To: "u-boot@lists.denx.de" Sent: Friday, November 25, 2011 5:24 PM Subject: CONFIG_BOOTCOUNT_LIMIT I' need to enable CONFIG_BOOTCOUNT_LIMIT, which is based one MPC8377ERDB, and am looking for recommended address for CONFIG_BOOTCOUNT_ADDR, any suggestions. Thanks S___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] CONFIG_BOOTCOUNT_LIMIT
I' need to enable CONFIG_BOOTCOUNT_LIMIT, which is based one MPC8377ERDB, and am looking for recommended address for CONFIG_BOOTCOUNT_ADDR, any suggestions. Thanks S ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot