lib: Allow using 0x when a decimal value is requested

U-Boot mostly uses hex for value input, largely because addresses are much
easier to understand in hex.

But in some cases a decimal value is requested, such as where the value is
small or hex does not make sense in the context. In these cases it is
sometimes useful to be able to provide a hex value in any case, if only to
resolve any ambiguity.

Add this functionality, for increased flexibility.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2021-07-24 09:03:38 -06:00
committed by Tom Rini
parent 5f4b356121
commit e6951139c0
4 changed files with 37 additions and 17 deletions

View File

@@ -85,3 +85,9 @@ useful::
=> pmic write 2 0177
=> pmic read 2
0x02: 0x00007f
It is possible to use a `0x` prefix to use a hex value if that is more
convenient::
=> i2c speed 0x30000
Setting bus speed to 196608 Hz