[U-Boot] Inconsistency between $filesize and commands which accept numeric params.

Wolfgang Denk wd at denx.de
Thu Oct 30 16:21:46 CET 2014


Dear Ian,

In message <1414677435.2064.34.camel at hellion.org.uk> you wrote:
> It seems there is some inconsistency wrt number base between commands
> which set $filesize in the env and the commands which might consume
> them.

That would be bugs, then.

>         
>         sun7i# load scsi 0 $fdt_addr_r dtbs/$fdtfile
>         21639 bytes read in 191 ms (110.4 KiB/s)
>         sun7i# printenv filesize
>         filesize=5487
>         
> So filesize is in hex, but without an 0x prefix. But:

This is normal.  U-Boot uses hex input base by default.  All commands
should take hex input; the only inglorious exception is the "sleep"
command which takes decimal; numbers as arguments.

>         sun7i# fdt addr $fdt_addr_r 0x10000 
>         sun7i# fdt set /chosen foo <$filesize>
>         sun7i# fdt print /chosen foo          
>         foo = <0x0000156f>
>         
> IOW the parameter to fdt set has been interpreted as a decimal.

That's a bug.

> So I'm not sure if the bug is that setenv_hex doesn't include the 0x, or

No 0x prefix should be needed anywhere.

> that fdt set interprets things as decimal by default instead of hex. Or
> maybe there is no bug at all?

The bug is in fdt set, then.


Thanks for pointing out!

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
Prediction is very difficult, especially of the future.  - Niels Bohr


More information about the U-Boot mailing list