All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] a few questions about saving bootcount in the environment
@ 2016-07-23 17:29 Robert P. J. Day
  2016-07-25  4:57 ` Wolfgang Denk
  0 siblings, 1 reply; 16+ messages in thread
From: Robert P. J. Day @ 2016-07-23 17:29 UTC (permalink / raw)
  To: u-boot


  a few quick questions about this feature before i move on to the
more widely-used stuff involving bootcount.

  first, it seems that there's not a lot of saving bootcount in the
environment ... as i see it, there's the taurus board, and there's the
boards that include "siemens-am33x-common.h", of which i see six:

include/configs/rut.h:#include "siemens-am33x-common.h"
include/configs/draco.h:#include "siemens-am33x-common.h"
include/configs/etamin.h:#include "siemens-am33x-common.h"
include/configs/rastaban.h:#include "siemens-am33x-common.h"
include/configs/pxm2.h:#include "siemens-am33x-common.h"
include/configs/thuban.h:#include "siemens-am33x-common.h"

so this tells me that there's not a whole lot of that feature being
used, so i won't spend much time on it.

  also, just to confirm, the "upgrade_available" variable is used
*exclusively* for the case of bootcount in the environment and nowhere
else, correct? so, again, if i'm not using the environment, i don't
care about it.

  finally, i read this in the README:

  CONFIG_BOOTCOUNT_ENV
  If no softreset save registers are found on the hardware
  "bootcount" is stored in the environment. To prevent a
  saveenv on all reboots, the environment variable
  "upgrade_available" is used. If "upgrade_available" is
  0, "bootcount" is always 0, if "upgrade_available" is
  1 "bootcount" is incremented in the environment.
  So the Userspace Applikation must set the "upgrade_available"
  and "bootcount" variable to 0, if a boot was successfully.

now, i can see where one wants to reset "bootcount" to zero once you
boot successfully, but why would you also set "upgrade_available" to
zero? don't you want to keep using that feature when you boot in the
future?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [U-Boot] a few questions about saving bootcount in the environment
@ 2016-07-25 14:36 Wolfgang Denk
  0 siblings, 0 replies; 16+ messages in thread
From: Wolfgang Denk @ 2016-07-25 14:36 UTC (permalink / raw)
  To: u-boot

Dear Tom,

I wrote:

> Agreed.  Let me rephrase the warning, then: it is always a good idea
> to minimize the number of writes to the environment, especially when
> done automagically.  One should at least avoid to re-write it on every
> boot, especially when storage is some (flash based) storage device
> with a limited number of erase/write cycles.  And even on other stoage
> each write access includes the risk of errors.

And of course access to the environment in inherently much slower than
a register write. This may not matter in many cases, but when
optimizing boot time it may be important, too.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
Some people march to the beat of a different drummer. And some people
tango!

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [U-Boot] confused by "upgrade_available=0\0" in include/configs/taurus.h
@ 2016-07-22 19:36 Robert P. J. Day
  2016-07-22 22:01 ` Wolfgang Denk
  0 siblings, 1 reply; 16+ messages in thread
From: Robert P. J. Day @ 2016-07-22 19:36 UTC (permalink / raw)
  To: u-boot


  never embarrassed to make a fool of myself, i have to admit that,
while crawling through examples of u-boot boards that define dual
partitions, i am confused by the following in
include/configs/taurus.h (only some lines reproduced):

  #define CONFIG_BOOTARGS_AXM                                           \
        "\0"    \
        "flash_nfs=run nand_kernel;run nfsargs;run addip;upgrade_available;"\
        "flash_self=run nand_kernel;run setbootargs;upgrade_available;" \
        "flash_self_test=run nand_kernel;run setbootargs addtest; "     \
        "upgrade_available;bootm ${kernel_ram};reset\0"
        "net_nfs=run boot_file;tftp ${kernel_ram} ${bootfile};"         \
        "run nfsargs;run addip;upgrade_available;bootm "                \
                "${kernel_ram};reset\0"                                 \

        ... snip ...

        "upgrade_available=0\0"
  #endif

what does it mean for "upgrade_available;" to be in the middle of some
of those command definitions? it's just a variable, what does it
represent? am i just clueless for never having noticed this sort of
thing before?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2016-07-27 15:10 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-23 17:29 [U-Boot] a few questions about saving bootcount in the environment Robert P. J. Day
2016-07-25  4:57 ` Wolfgang Denk
2016-07-25 13:57   ` Tom Rini
2016-07-25 14:35     ` Wolfgang Denk
2016-07-25 17:56       ` Robert P. J. Day
2016-07-25 18:37         ` Wolfgang Denk
2016-07-25 18:41           ` Robert P. J. Day
2016-07-25 17:26     ` Heiko Schocher
2016-07-26 12:21       ` Robert P. J. Day
2016-07-26 12:48         ` Wolfgang Denk
2016-07-26 12:49           ` Robert P. J. Day
2016-07-26 17:25         ` Heiko Schocher
2016-07-27 12:03           ` Robert P. J. Day
2016-07-27 15:10             ` Heiko Schocher
  -- strict thread matches above, loose matches on Subject: below --
2016-07-25 14:36 Wolfgang Denk
2016-07-22 19:36 [U-Boot] confused by "upgrade_available=0\0" in include/configs/taurus.h Robert P. J. Day
2016-07-22 22:01 ` Wolfgang Denk
2016-07-23 11:42   ` Robert P. J. Day
2016-07-25  4:54     ` Wolfgang Denk
2016-07-25 10:03       ` Robert P. J. Day
2016-07-25 13:26         ` Wolfgang Denk
2016-07-25 17:24           ` [U-Boot] a few questions about saving bootcount in the environment Heiko Schocher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.