| #
28386b6d |
| 05-Jun-2018 |
Alexey Brodkin <Alexey.Brodkin@synopsys.com> |
UPSTREAM: lib: Add hexdump
Often during debugging session it's very interesting to see what data we were dealing with. For example what we write or read to/from memory or peripherals.
This change i
UPSTREAM: lib: Add hexdump
Often during debugging session it's very interesting to see what data we were dealing with. For example what we write or read to/from memory or peripherals.
This change introduces functions that allow to dump binary data with one simple function invocation like: ------------------->8---------------- print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, buf, len); ------------------->8----------------
which gives us the following: ------------------->8---------------- 00000000: f2 b7 c9 88 62 61 75 64 72 61 74 65 3d 31 31 35 ....baudrate=115 00000010: 32 30 30 00 62 6f 6f 74 61 72 67 73 3d 63 6f 6e 200.bootargs=con 00000020: 73 6f 6c 65 3d 74 74 79 53 33 2c 31 31 35 32 30 sole=ttyS3,11520 00000030: 30 6e 38 00 62 6f 6f 74 64 65 6c 61 79 3d 33 00 0n8.bootdelay=3. 00000040: 62 6f 6f 74 66 69 6c 65 3d 75 49 6d 61 67 65 00 bootfile=uImage. 00000050: 66 64 74 63 6f 6e 74 72 6f 6c 61 64 64 72 3d 39 fdtcontroladdr=9 00000060: 66 66 62 31 62 61 30 00 6c 6f 61 64 61 64 64 72 ffb1ba0.loadaddr 00000070: 3d 30 78 38 32 30 30 30 30 30 30 00 73 74 64 65 =0x82000000.stde 00000080: 72 72 3d 73 65 72 69 61 6c 30 40 65 30 30 32 32 rr=serial0@e0022 00000090: 30 30 30 00 73 74 64 69 6e 3d 73 65 72 69 61 6c 000.stdin=serial 000000a0: 30 40 65 30 30 32 32 30 30 30 00 73 74 64 6f 75 0@e0022000.stdou 000000b0: 74 3d 73 65 72 69 61 6c 30 40 65 30 30 32 32 30 t=serial0@e00220 000000c0: 30 30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00.............. ... ------------------->8----------------
Source of hexdump.c was copied from Linux kernel v4.7-rc2.
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Anatolij Gustschin <agust@denx.de> Cc: Mario Six <mario.six@gdsys.cc> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com> Cc: Stefan Roese <sr@denx.de>
Change-Id: I038b41f51d45d1b853da499578bf8ef384a63730 Signed-off-by: Jon Lin <jon.lin@rock-chips.com> (cherry picked from commit f8c987f8f127f867d96ca74bcd1fcb11d8265b67)
show more ...
|
| #
aa5728ff |
| 09-Sep-2017 |
Rob Clark <robdclark@gmail.com> |
UPSTREAM: vsprintf.c: add GUID printing
This works (roughly) the same way as linux's, but we currently always print lower-case (ie. we just keep %pUB and %pUL for compat with linux), mostly just bec
UPSTREAM: vsprintf.c: add GUID printing
This works (roughly) the same way as linux's, but we currently always print lower-case (ie. we just keep %pUB and %pUL for compat with linux), mostly just because that is what uuid_bin_to_str() supports.
%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10 %pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
It will be used by a later efi_loader paths for efi variables and for device-path-to-text protocol, and also quite useful for debug prints of protocol GUIDs.
Change-Id: I6b0920ae6fe99ac0638c9c3c8eed6ea3f964d2b5 Signed-off-by: Rob Clark <robdclark@gmail.com> Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 22ada0c8e6d50281af72176eecdfc356c794639c)
show more ...
|
| #
5ec68503 |
| 09-Sep-2017 |
Rob Clark <robdclark@gmail.com> |
UPSTREAM: vsprintf.c: add UTF-16 string (%ls) support
This is convenient for efi_loader which deals a lot with UTF-16. Only enabled with CC_SHORT_WCHAR, leaving room to add a UTF-32 version when CC
UPSTREAM: vsprintf.c: add UTF-16 string (%ls) support
This is convenient for efi_loader which deals a lot with UTF-16. Only enabled with CC_SHORT_WCHAR, leaving room to add a UTF-32 version when CC_SHORT_WCHAR is not enabled.
Change-Id: I3c6cd45db5f29157760f99bc5956b482ff96fc6c Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Kever Yang <kever.yang@rock-chips.com> (cherry picked from commit 274325c50951dd16ad2a6f45e79dc062ad47011b)
show more ...
|
| #
947c626d |
| 14-Jan-2016 |
Tom Rini <trini@konsulko.com> |
vsprintf.c: Always enable CONFIG_SYS_VSNPRINTF
Enabling this function always removes some class of string saftey issues. The size change here in general is about 400 bytes and this seems a reasonabl
vsprintf.c: Always enable CONFIG_SYS_VSNPRINTF
Enabling this function always removes some class of string saftey issues. The size change here in general is about 400 bytes and this seems a reasonable trade-off.
Cc: Peng Fan <peng.fan@nxp.com> Cc: Peter Robinson <pbrobinson@gmail.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Adrian Alonso <aalonso@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Tom Rini <trini@konsulko.com>
show more ...
|
| #
35065cdd |
| 16-Dec-2015 |
Tom Rini <trini@konsulko.com> |
Merge git://git.denx.de/u-boot-rockchip
|
| #
e4c5383e |
| 04-Dec-2015 |
Sjoerd Simons <sjoerd.simons@collabora.co.uk> |
lib: split out strtoxxxx functions out of vsprintf.c
To allow the various string to number conversion functions to be used when using tiny-printf,split them out into their own file which gets build
lib: split out strtoxxxx functions out of vsprintf.c
To allow the various string to number conversion functions to be used when using tiny-printf,split them out into their own file which gets build regardless of what printf implementation is used.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
show more ...
|
| #
2b22a99c |
| 04-Dec-2015 |
Sjoerd Simons <sjoerd.simons@collabora.co.uk> |
lib: Split panic functions out of vsprintf.c
To allow panic and panic_str to still be used when using tiny-printf, split them out into their own file which gets build regardless of what printf imple
lib: Split panic functions out of vsprintf.c
To allow panic and panic_str to still be used when using tiny-printf, split them out into their own file which gets build regardless of what printf implementation is used.
Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
show more ...
|
| #
7d9cde10 |
| 23-Nov-2015 |
Stefan Roese <sr@denx.de> |
lib/tiny-printf.c: Add tiny printf function for space limited environments
This patch adds a small printf() version that supports all basic formats. Its intented to be used in U-Boot SPL versions on
lib/tiny-printf.c: Add tiny printf function for space limited environments
This patch adds a small printf() version that supports all basic formats. Its intented to be used in U-Boot SPL versions on platforms with very limited internal RAM sizes.
To enable it, just define CONFIG_USE_TINY_PRINTF in your defconfig. This will result in the SPL using this tiny function and the main U-Boot still using the full-blown printf() function.
This code was copied from: http://www.sparetimelabs.com/printfrevisited With mostly only coding style related changes so that its checkpatch clean.
The size reduction is about 2.5KiB. Here a comparison for the db-mv784mp-gp (Marvell AXP) SPL:
Without this patch: 58963 18536 1928 79427 13643 ./spl/u-boot-spl
With this patch: 56542 18536 1956 77034 12cea ./spl/u-boot-spl
Note: To make it possible to compile tiny-printf.c instead of vsprintf.c when CONFIG_USE_TINY_PRINTF is defined, the functions printf() and vprintf() are moved from common/console.c into vsprintf.c in this patch.
Signed-off-by: Stefan Roese <sr@denx.de> Cc: Simon Glass <sjg@chromium.org> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Tom Rini <trini@konsulko.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net>
show more ...
|
| #
c4af6732 |
| 23-Jun-2015 |
Simon Glass <sjg@chromium.org> |
lib: Add function to extract a number from the end of a string
Split out the code in fdtdec which finds a number at the end of a string. It can be useful in other situations.
Signed-off-by: Simon G
lib: Add function to extract a number from the end of a string
Split out the code in fdtdec which finds a number at the end of a string. It can be useful in other situations.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
1254ff97 |
| 10-Jul-2015 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot
|
| #
6f43ba70 |
| 07-Jul-2015 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
|
| #
09c32807 |
| 27-Apr-2015 |
Heiko Schocher <hs@denx.de> |
mtd, nand: Move common functions from cmd_nand.c to common place
Move common functions from cmd_nand.c (for calculating offset and size from cmdline paramter) to common place, so they could used fro
mtd, nand: Move common functions from cmd_nand.c to common place
Move common functions from cmd_nand.c (for calculating offset and size from cmdline paramter) to common place, so they could used from other commands which use mtd partitions.
For onenand the arg_off_size() is left in common/cmd_onenand.c. It should use now the common arg_off() function, but as I could not test onenand I let it there ...
Signed-off-by: Heiko Schocher <hs@denx.de> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Jagannadh Teki <jteki@openedev.com>
show more ...
|
| #
b939689c |
| 05-May-2015 |
Albert ARIBAUD <albert.u.boot@aribaud.net> |
Merge branch 'u-boot/master' into 'u-boot-arm/master'
|
| #
5f757cdc |
| 23-Apr-2015 |
Tom Rini <trini@konsulko.com> |
Merge branch 'master' of git://git.denx.de/u-boot-dm
|
| #
66312374 |
| 28-Feb-2015 |
Simon Glass <sjg@chromium.org> |
dm: Add a panic_str() function to reduce code size
The printf() in panic() adds about 1.5KB of code size to SPL when compiled with Thumb-2. Provide a smaller version that does not support printf()-s
dm: Add a panic_str() function to reduce code size
The printf() in panic() adds about 1.5KB of code size to SPL when compiled with Thumb-2. Provide a smaller version that does not support printf()-style arguments and use it in two commonly compiled places.
Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
1eebd14b |
| 13-Nov-2014 |
Thierry Reding <treding@nvidia.com> |
vsprintf: Add modifier for phys_addr_t
Provide a new modifier to vsprintf() to print phys_addr_t variables to avoid having to cast or #ifdef when printing them out. The %pa modifier is used for this
vsprintf: Add modifier for phys_addr_t
Provide a new modifier to vsprintf() to print phys_addr_t variables to avoid having to cast or #ifdef when printing them out. The %pa modifier is used for this purpose, so phys_addr_t variables need to be passed by reference, like so:
phys_addr_t start = 0;
printf("start: %pa\n", &start);
Depending on the size of phys_addr_t this will print out the address with 8 or 16 hexadecimal digits following a 0x prefix.
Signed-off-by: Thierry Reding <treding@nvidia.com> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Simon Glass <sjg@chromium.org>
show more ...
|
| #
cba1da49 |
| 06-Nov-2014 |
Masahiro Yamada <yamada.m@jp.panasonic.com> |
include: move various macros to include/linux/kernel.h
U-Boot has imported various utility macros from Linux scattering them to various places without consistency.
In include/common.h are min, max,
include: move various macros to include/linux/kernel.h
U-Boot has imported various utility macros from Linux scattering them to various places without consistency.
In include/common.h are min, max, min3, max3, ARRAY_SIZE, ALIGN, container_of, DIV_ROUND_UP, etc. In include/linux/compat.h are min_t, max_t, round_up, round_down, etc. We also have duplicated defines of min_t in some *.c files.
Moreover, we are suffering from too cluttered include/common.h.
This commit moves various macros that originate in include/linux/kernel.h of Linux to their original position.
Note: This commit simply moves the macros; the macros roundup, min, max, min2, max3, ARRAY_SIZE are different from those of Linux at this point.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
show more ...
|
| #
6bf67259 |
| 15-Oct-2014 |
Simon Glass <sjg@chromium.org> |
Use uint64_t instead of u64 in put_dec()
Use the correct type required by do_div().
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
c23154aa |
| 08-Aug-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot-arm
|
| #
d7b2d9df |
| 10-Jul-2014 |
Jeroen Hofstee <jeroen@myspectrum.nl> |
lib:vsprintf: reduce scope of pack_hex_byte
pack_hex_byte is only used when CONFIG_CMD_NET is defined so limit it to that scope. This prevents a clang warning.
Signed-off-by: Jeroen Hofstee <jeroen
lib:vsprintf: reduce scope of pack_hex_byte
pack_hex_byte is only used when CONFIG_CMD_NET is defined so limit it to that scope. This prevents a clang warning.
Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
show more ...
|
| #
17998eff |
| 11-Feb-2014 |
Stefano Babic <sbabic@denx.de> |
Merge branch 'master' of git://git.denx.de/u-boot-arm
|
| #
686f60f5 |
| 19-Dec-2013 |
Darwin Rambo <drambo@broadcom.com> |
lib: fix return codes when CONFIG_SYS_VSNPRINTF is enabled
When CONFIG_SYS_VSNPRINTF is enabled, it protects print operations such as sprintf, snprintf, vsnprintf, etc., from buffer overflows. But v
lib: fix return codes when CONFIG_SYS_VSNPRINTF is enabled
When CONFIG_SYS_VSNPRINTF is enabled, it protects print operations such as sprintf, snprintf, vsnprintf, etc., from buffer overflows. But vsnprintf_internal includes the terminating NULL character in the calculation of number of characters written. This affects sprintf and snprintf return values. Fix this issue by setting pointer 'str' back to the location of the '\0'.
Signed-off-by: Darwin Rambo <drambo@broadcom.com> Reviewed-by: Steve Rae <srae@broadcom.com>
show more ...
|
| #
b8bcaa3a |
| 11-Jun-2013 |
Simon Glass <sjg@chromium.org> |
Add function to print a number with grouped digits
Move bootstage's numbering printing code into a generic place so that it can be used by tracing also.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
| #
76b40ab4 |
| 11-Mar-2013 |
Tom Rini <trini@ti.com> |
Merge u-boot/master into u-boot-ti/master
In master we had already taken a patch to fix the davinci GPIO code for CONFIG_SOC_DM646X and in u-boot-ti we have additional patches to support DA830 (whic
Merge u-boot/master into u-boot-ti/master
In master we had already taken a patch to fix the davinci GPIO code for CONFIG_SOC_DM646X and in u-boot-ti we have additional patches to support DA830 (which is CONFIG_SOC_DA8XX && !CONFIG_SOC_DA850). Resolve these conflicts manually and comment the #else/#endif lines for clarity.
Conflicts: arch/arm/include/asm/arch-davinci/gpio.h drivers/gpio/da8xx_gpio.c
Signed-off-by: Tom Rini <trini@ti.com>
show more ...
|
| #
7df54d31 |
| 27-Jan-2013 |
Piotr Wilczek <p.wilczek@samsung.com> |
vsprintf: add ustrtoll function
Add 'ustrtoull' function to convert size from string (ex: 1GiB) to unsigned long long type
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungm
vsprintf: add ustrtoll function
Add 'ustrtoull' function to convert size from string (ex: 1GiB) to unsigned long long type
Signed-off-by: Piotr Wilczek <p.wilczek@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
show more ...
|