[U-Boot] [U-Boot, 1/2] spi: Add progress percentage and write speed to `sf update`

Wolfgang Denk wd at denx.de
Fri Dec 21 20:52:48 CET 2012


Dear Simon,

In message <CAPnjgZ35OaUPvMcc7Z_GHL4awWkxVZPHoOpEQjDLe0haP4e7cw at mail.gmail.com> you wrote:
>
> Yes there seems to be a plan. Perhaps I will sketch out a few ideas so that
> people can comment:

Thanks!

> Add two environment variables:
> 
> verbose=0|1    - if this is 0, then commands complete silently as now. If
> >=1 then messages like the ones you propose ('flash successfully erased')
> appear

If verbose is not set in the environment, the effect should be the
same as for "verbose=0".

It may even make sense to support other numeric values, too, so you
can even control the level of verbocity.

> progress=0|1    - if this is 0, then commands show no progress when
> working. If >=1 then some commands will show progress as they work (all on
> a single line like 'sf update')

Ditto for default if not set.

We should very much try to avoid the use of control sequences
including '\b' or '\r' characters.  These are a nightmare when
analyzing log files, not to mention the pain they often cause in
automatic regression test scripts.

If this makes single line output impossible (like when the total file
size is not known in advance so we can adjust the scaling), then I'd
rather see multiple lines (as we have now with the tftp / nfs
commands).

> We also need a CONFIG for each to enable it, like perhaps
> CONFIG_SYS_VERBOSE and CONFIG_SYS_PROGRESS.

This should be no _SYS, as it should be user-selectable.

>    /* may need to record column position of last message so we can clear it
> at the end */

Clear? Just print a '\n' and continue on a new line, please.

Thanks.

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: wd at denx.de
EMACS belongs in <sys/errno.h>: Editor too big!


More information about the U-Boot mailing list