History log of /u-boot/lib/vsprintf.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 467382ca 14-Dec-2023 Tom Rini <trini@konsulko.com>

lib: Remove <common.h> inclusion from these files

After some header file cleanups to add missing include files, remove
common.h from all files in the lib directory. This primarily means just
dropping the line but in a few cases we need to add in other header
files now.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>

# 3a3543db 30-Jul-2023 Simon Glass <sjg@chromium.org>

lib: Suppress E when writing error-string output

When CONFIG_ERRNO_STR is not enabled this shows a spurious 'E' from the
format string. Fix this.

Fixes: 7f331941321 ("lib: Support printing an error string")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 9ee32a78 01-Apr-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: missing fallthrough comment in vsnprintf_internal()

When a case statement intentionally falls through we should add a comment.
Cf. -Wimplicit-fallthrough

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# deda5d5e 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_APP

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_APP defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7f331941 17-Jan-2023 Simon Glass <sjg@chromium.org>

lib: Support printing an error string

It is often useful to show an error code to give the user a clue as to
what went wrong. When error strings are compiled into U-Boot it is
possible to show a message as well.

But at present it is not very convenient, since code must check if the
error strings are present, then obtain the error string and use it in
a printf() string.

Add a %dE option which shows an error code along with an error string,
if available. This makes it easy to show one or both.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d807199d 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Enable IPv6 typeconversion specifier

Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# cba1da49 06-Nov-2014 Masahiro Yamada <masahiroy@kernel.org>

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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 3a3543db 30-Jul-2023 Simon Glass <sjg@chromium.org>

lib: Suppress E when writing error-string output

When CONFIG_ERRNO_STR is not enabled this shows a spurious 'E' from the
format string. Fix this.

Fixes: 7f331941321 ("lib: Support printing an error string")
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

# 9ee32a78 01-Apr-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: missing fallthrough comment in vsnprintf_internal()

When a case statement intentionally falls through we should add a comment.
Cf. -Wimplicit-fallthrough

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# deda5d5e 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_APP

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_APP defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7f331941 17-Jan-2023 Simon Glass <sjg@chromium.org>

lib: Support printing an error string

It is often useful to show an error code to give the user a clue as to
what went wrong. When error strings are compiled into U-Boot it is
possible to show a message as well.

But at present it is not very convenient, since code must check if the
error strings are present, then obtain the error string and use it in
a printf() string.

Add a %dE option which shows an error code along with an error string,
if available. This makes it easy to show one or both.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d807199d 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Enable IPv6 typeconversion specifier

Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# cba1da49 06-Nov-2014 Masahiro Yamada <masahiroy@kernel.org>

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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 9ee32a78 01-Apr-2023 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: missing fallthrough comment in vsnprintf_internal()

When a case statement intentionally falls through we should add a comment.
Cf. -Wimplicit-fallthrough

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# deda5d5e 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_APP

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_APP defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7f331941 17-Jan-2023 Simon Glass <sjg@chromium.org>

lib: Support printing an error string

It is often useful to show an error code to give the user a clue as to
what went wrong. When error strings are compiled into U-Boot it is
possible to show a message as well.

But at present it is not very convenient, since code must check if the
error strings are present, then obtain the error string and use it in
a printf() string.

Add a %dE option which shows an error code along with an error string,
if available. This makes it easy to show one or both.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d807199d 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Enable IPv6 typeconversion specifier

Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# cba1da49 06-Nov-2014 Masahiro Yamada <yamada.masahiro@socionext.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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# deda5d5e 05-Feb-2023 Simon Glass <sjg@chromium.org>

Correct SPL use of EFI_APP

This converts 1 usage of this option to the non-SPL form, since there is
no SPL_EFI_APP defined in Kconfig

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7f331941 17-Jan-2023 Simon Glass <sjg@chromium.org>

lib: Support printing an error string

It is often useful to show an error code to give the user a clue as to
what went wrong. When error strings are compiled into U-Boot it is
possible to show a message as well.

But at present it is not very convenient, since code must check if the
error strings are present, then obtain the error string and use it in
a printf() string.

Add a %dE option which shows an error code along with an error string,
if available. This makes it easy to show one or both.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d807199d 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Enable IPv6 typeconversion specifier

Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# cba1da49 06-Nov-2014 Masahiro Yamada <yamada.masahiro@socionext.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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 7f331941 17-Jan-2023 Simon Glass <sjg@chromium.org>

lib: Support printing an error string

It is often useful to show an error code to give the user a clue as to
what went wrong. When error strings are compiled into U-Boot it is
possible to show a message as well.

But at present it is not very convenient, since code must check if the
error strings are present, then obtain the error string and use it in
a printf() string.

Add a %dE option which shows an error code along with an error string,
if available. This makes it easy to show one or both.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d807199d 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Enable IPv6 typeconversion specifier

Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# cba1da49 06-Nov-2014 Masahiro Yamada <yamada.masahiro@socionext.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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# d807199d 01-Dec-2022 Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>

net: ipv6: Enable IPv6 typeconversion specifier

Add the possibility to recognize IPv6 address in print function.
To output IPv6 address use %pI6 specifier.

Series-changes: 3
- Substituted #if (...) for if (...) to get better readability

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# cba1da49 06-Nov-2014 Masahiro Yamada <yamada.masahiro@socionext.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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# fe14f880 29-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: fix snprintf() for UTF-16 strings

snprintf() must return the required buffer length.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 5b9a5b2b 23-Jan-2022 Simon Glass <sjg@chromium.org>

treewide: Use 16-bit Unicode strings

At present we use wide characters for Unicode but this is not necessary.
Change the code to use the 'u' literal instead. This helps to fix build
warnings for sandbox on the Raspberry Pi.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 04872381 16-Jan-2022 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: printf code %pUs for GUID text representation

In different places text representations are used for GUIDs, e.g.

* command efidebug
* command part list for GPT partitions

To allow reducing code duplication introduce a new printf code %pUs.
It will call uuid_guid_get_str() to get a text representation. If none is
found it will fallback to %pUl and print a hexadecimal representation.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 726cd983 29-Dec-2021 Simon Glass <sjg@chromium.org>

efi: Make unicode printf available to the app

This is needed to show unicode strings. Enable this code in the app.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 4a255ea3 14-Oct-2021 Simon Glass <sjg@chromium.org>

lib: Add a function to convert a string to a hex value

Add an xtoa() function, similar to itoa() but for hex instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Artem Lapkin <email2tema@gmail.com>
Tested-by: Artem Lapkin <email2tema@gmail.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 7e5f460e 24-Jul-2021 Simon Glass <sjg@chromium.org>

global: Convert simple_strtoul() with hex to hextoul()

It is a pain to have to specify the value 16 in each call. Add a new
hextoul() function and update the code to use it.

Add a proper comment to simple_strtoul() while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 23b542aa 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove unused ip6_addr_string()

There's currently no user of %p[iI]6, so including ip6_addr_string()
in the image is a waste of bytes. It's easy enough to have the
compiler elide it without removing the code completely.

The closest I can find to anybody "handling" ipv6 in U-Boot currently
is in efi_net.c which does

if (ipv6) {
ret = EFI_UNSUPPORTED;

As indicated in the comment, it can easily be put back, but preferably
under a config knob.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# ce452157 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: remove stale comment

U-Boot doesn't support %pS/%pF or any other kind of kallsyms-like
lookups. Remove the comment.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 97587786 27-May-2021 Rasmus Villemoes <rasmus.villemoes@prevas.dk>

lib/vsprintf.c: implement printf() in terms of vprintf()

This saves some code, both in terms of #LOC and .text size, and it is
also the normal convention that foo(...) is implemented in terms of
vfoo().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>

# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>

# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>

# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>

# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>

# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>

# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>

# 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 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>

# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>

# 7d9cde10 22-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 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>

# 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 Glass <sjg@chromium.org>

# 09c32807 26-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 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>

# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 1eebd14b 12-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 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>

# 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, 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>

# 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>

# 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@myspectrum.nl>

# 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 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>

# 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>

# 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: Kyungmin Park <kyungmin.park@samsung.com>

# 3ec44111 11-Dec-2012 Łukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>

# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>

# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>

# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>

# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>

# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>

# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>

# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 67f51b40 14-May-2020 Tom Rini <trini@konsulko.com>

compiler*.h: sync include/linux/compiler*.h with Linux 5.7-rc5

Copy these from Linux v5.7-rc5 tag.

This brings in some handy new attributes and is otherwise important to
keep in sync.

We drop the reference to smp_read_barrier_depends() as it is not
relevant on the architectures we support at this time, based on where
it's implemented in Linux today. We drop the call to kasan_check_read()
as that is not relevant to U-Boot as well.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Tom Rini <trini@konsulko.com>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# ba06b3c5 10-May-2020 Simon Glass <sjg@chromium.org>

common: Drop uuid.h from common header

Move this uncommon header out of the common header.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 6f821568 24-Sep-2019 Joe Hershberger <joe.hershberger@ni.com>

lib: Always build support for formatting MAC and IP address

Even if not communicating over the network in U-Boot, code may be manipulating
and storing IP or MAC addresses to pass to Linux, etc.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 2189d5f1 14-Nov-2019 Simon Glass <sjg@chromium.org>

Move strtomhz() to vsprintf.h

At present this function sits in its own file but it does not really
justify it. There are similar string functions in vsprintf.h, so move it
there. Also add the missing function comment.

Use the vsprintf.h include file explicitly where needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 3bad256f 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: allow printing upper case GUIDs

In the UEFI context GUIDs are expected to be rendered in upper case.

The patch uses the formerly unused bit 1 of the parameter str_format
of function uuid_bin_to_str() to indicate if we need upper or lower case
output.

Function uuid_string() in vsprint.c is adjusted to correctly set the bit
depending on the print format code.

%pUb: 01020304-0506-0708-090a-0b0c0d0e0f10
%pUB: 01020304-0506-0708-090A-0B0C0D0E0F10
%pUl: 04030201-0605-0807-090a-0b0c0d0e0f10
%pUL: 04030201-0605-0807-090A-0B0C0D0E0F10

Up to this point only a diagnostic message in mount_ubifs() using '%pUB' is
concerned by the change. Further patches are needed to adjust the UEFI
subsystem.

A unit test is provided inside the ut_print command.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 64b5ba4d 11-May-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: make device path to text protocol customizable

The device path to text protocol is not needed for EBBR compliance. So
let's make it a customizable option.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# cb943418 29-Apr-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: remove #include <uuid.h> from vsprintf.c

common.h already includes uuid.h

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 17018927 12-Mar-2019 Thierry Reding <treding@nvidia.com>

vsprintf: Support phys_addr_t specifier unconditionally

When phys_addr_t printf specifier support was first introduced in commit
1eebd14b7902 ("vsprintf: Add modifier for phys_addr_t"), it was enabled
only if CONFIG_CMD_NET was selected. Since physical addresses are not
unique to networking support it doesn't make sense to conditionally add
it in those cases only. Move support for it outside of the CMD_NET guard
so that the specifier is always supported.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 60c4454d 15-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib/vsprintf: print '?' for illegal Unicode sequence

Commit 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16
strings") broke the Unicode unit tests: an illegal UTF16 code point
should be printed as '?'.

Fixes: 0e66c10a7d80 ("lib: vsprintf: avoid overflow printing UTF16 strings")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>


# 0e66c10a 10-Feb-2019 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: avoid overflow printing UTF16 strings

We have to ensure while printing UTF16 strings that we do not exceed the
end of the print buffer.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 31bd711c 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: vsprintf: correct printing of Unicode strings

The width and precision of the printf() function refer to the number of
characters not to the number of bytes printed.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 1dde0d57 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

efi_loader: rename utf16_strlen, utf16_strnlen

The function names utf16_strlen() and utf16_strnlen() are misnomers.
The functions do not count utf-16 characters but non-zero words.
So let's rename them to u16_strlen and u16_strnlen().

In utf16_dup() avoid assignment in if clause.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# fbb3ea80 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

lib: build charset.o only if needed

charset.o is only needed for the EFI subsystem

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 4ddcc4e5 31-Aug-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: use #if CONFIG_IS_ENABLED(EFI_LOADER)

Using CONFIG_IS_ENABLED(EFI_LOADER) allows to simply the #if statements.

Suggested-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# d7ae1609 18-Jun-2018 Simon Glass <sjg@chromium.org>

vsprintf: Handle NULL with %pU

At present a NULL pointer passed to printf for a %pU argument will cause
U-Boot to access memory at 0. Fix this by adding a check, and print
"(null)" instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Alexander Graf <agraf@suse.de>
[agraf: s/(null)/<NULL>/]
Signed-off-by: Alexander Graf <agraf@suse.de>


# f8c987f8 05-Jun-2018 Alexey Brodkin <Alexey.Brodkin@synopsys.com>

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>


# e21c03be 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

Consolidate __assert_failed into one implementation

We had two implementations of __assert_failed which were almost identical,
combine them into one.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>


# 4f1eed75 18-Apr-2018 Alex Kiernan <alex.kiernan@gmail.com>

spl: Disable printf if not required

Now we have a guard for printf, disable it in the build if it's not
selected.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>


# 5f1ce1d4 25-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: correct printing of a NULL device path

When printing '%pD' with a value of NULL we want to output
'<NULL>'. But this requires copying to buf. Leave this
to string16.

A unit test is supplied which relies on EFI support in the sandbox.

The development for EFI support in the sandbox is currently in branch
u-boot-dm/efi-working. The branch lacks commit 6ea8b580f06b ("efi_loader:
correct DeviceNodeToText for media types"). Ater rebasing the aforementioned
branch on U-Boot v2018.01 and adding 256060e4257a2 and this patch the test
is executed successfully.

Fixes: 256060e4257a2 (vsprintf.c: add EFI device path printing)
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 256060e4 10-Jan-2018 Heinrich Schuchardt <xypron.glpk@gmx.de>

vsprintf.c: add EFI device path printing

For debugging efi_loader we need the capability to print EFI
device paths. With this patch we can write:

debug("device path: %pD", dp);

A possible output would be

device path: /MemoryMapped(0x0,0x3ff93a82,0x3ff93a82)

This enhancement is not available when building without EFI support
and neither in the SPL nor in the API example.

A test is provided. It can be executed in the sandbox with command
ut_print.

The development for EFI support in the sandbox is currently in
branch u-boot-dm/efi-working. The branch currently lacks
commit 6ea8b580f06b ("efi_loader: correct DeviceNodeToText
for media types"). Ater rebasing the aforementioned branch on
U-Boot v2018.01 the test is executed successfully.

Without EFI support in the sandbox the test is simply skipped.

Suggested-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>


# 22ada0c8 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 274325c5 09-Sep-2017 Rob Clark <robdclark@gmail.com>

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.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>


# 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 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>


# 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 regardless of what printf implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>


# 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 implementation is used.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>


# 7d9cde10 22-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 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>


# 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 Glass <sjg@chromium.org>


# 09c32807 26-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 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>


# 66312374 27-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()-style
arguments and use it in two commonly compiled places.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 1eebd14b 12-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 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>


# 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, 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>


# 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>


# 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@myspectrum.nl>


# 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 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>


# 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>


# 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: Kyungmin Park <kyungmin.park@samsung.com>


# 3ec44111 11-Dec-2012 Lukasz Majewski <l.majewski@samsung.com>

vsprintf:fix: Change type returned by ustrtoul

The ustrtoul shall convert string defined size (e.g. 1GiB) to unsigned
long type (as its name implies).

Up till now it had returned int, which might cause problems with large
numbers (GiB range), when interpreted as U2 signed numbers.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>


# 0eb25768 29-Oct-2012 Kim Phillips <kim.phillips@freescale.com>

lib/vsprintf.c: sparse fixes

vsprintf.c:31:12: warning: symbol 'hex_asc' was not declared. Should it be static?
vsprintf.c:398:18: warning: Using plain integer as NULL pointer

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>


# d266f669 30-Oct-2012 Wolfgang Denk <wd@denx.de>

lib/vsprintf.c: don't special-case pointers to address null

The %p format of printf() would print a pointer to address null as
"(null)". This makes sense in a real OS where a NULL pointer must
never be dereferenced, but this is a bootloader, and there are cases
where accessing the data at address null makes perfect sense.

Remove the special case in lib/vsprintf.c using "#if 0" with a comment
to make clear this was an intentional change and to stop re-adding
this code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>


# 7b64f66c 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: replace NUM_TYPE with s64/u64 types

This fixes warnings when compiling with ELDK-5.2.1 for MIPS64:

vsprintf.c: In function 'put_dec':
vsprintf.c:258:9: warning: comparison of distinct pointer types lacks a cast [enabled by default]
vsprintf.c:258:3: warning: passing argument 1 of '__div64_32' from incompatible pointer type [enabled by default]
include/div64.h:22:17: note: expected 'uint64_t *' but argument is of type 'long long unsigned int *'

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>


# 8acdae68 16-Sep-2012 Daniel Schwierzeck <daniel.schwierzeck@gmail.com>

lib: vsprintf.c: fix checkpath.pl warnings

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>


# 71ec92b6 02-Nov-2011 Simon Glass <sjg@chromium.org>

vsprintf: Move function documentation into header file

Now that this is not in common.h, perhaps it is acceptable to move this
documentation into the header file.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 046a37bd 02-Nov-2011 Sonny Rao <sonnyrao@chromium.org>

Add safe vsnprintf and snprintf library functions

From: Sonny Rao <sonnyrao@chromium.org>

These functions are useful in U-Boot because they allow a graceful failure
rather than an unpredictable stack overflow when printf() buffers are
exceeded.

Mostly copied from the Linux kernel. I copied vscnprintf and
scnprintf so we can change printf and vprintf to use the safe
implementation but still return the correct values.

(Simon Glass <sjg@chromium.org> modified this commit a little)

Signed-off-by: Sonny Rao <sonnyrao@chromium.org>


# 3cce8a54 21-Oct-2011 Simon Glass <sjg@chromium.org>

Move simple_itoa to vsprintf

This function is generally useful and shouldn't hide away in hush. It
has been moved as is.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 21726a7a 29-Jun-2011 Simon Glass <sjg@chromium.org>

Add assert() for debug assertions

assert() is like BUG_ON() but compiles to nothing unless DEBUG is defined.
This is useful when a condition is an error but a board reset is unlikely
to fix it, so it is better to soldier on in hope. Assertion failures should
be caught during development/test.

It turns out that assert() is defined separately in a few places in U-Boot
with various meanings. This patch cleans up some of these.

Build errors exposed by this change (and defining DEBUG) are also fixed in
this patch.

Signed-off-by: Simon Glass <sjg@chromium.org>


# 40e01881 26-Jul-2011 Heiko Schocher <hs@denx.de>

panic: remove warning "'noreturn' function does return"

since commit

commit d2e8b911c0a0661d395ccac72156040702ac842d
Author: Mike Frysinger <vapier@gentoo.org>
Date: Wed Jun 29 11:58:04 2011 +0000

panic: add noreturn attribute

I see the following warnings:

vsprintf.c: In function 'panic':
vsprintf.c:730: warning: 'noreturn' function does return

for nearly all boards. This patch fixes this warning.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>


# a7fd0d9f 02-May-2011 Heiko Schocher <hs@denx.de>

lib, vsprintf: introduce strict_strtoul

as checkpatch proposes to use strict_strtoul instead of
simple_strtoul, introduce it.

Ported this function from Linux 2.6.38 commit ID:
521cb40b0c44418a4fd36dc633f575813d59a43d

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <wd@denx.de>
cc: Detlev Zundel <dzu@denx.de>
cc: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>


# 882b7d72 20-Oct-2010 Mike Frysinger <vapier@gentoo.org>

do_reset: unify duplicate prototypes

The duplication of the do_reset prototype has gotten out of hand,
and they're not all in sync. Unify them all in command.h.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>


# 54841ab5 28-Jun-2010 Wolfgang Denk <wd@denx.de>

Make sure that argv[] argument pointers are not modified.

The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands. Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
while (--argc > 0 && **++argv == '-') {
/* ====> */ while (*++*argv) {
switch (**argv) {
case 'd':
debug++;
break;
...
default:
usage ();
}
}
}
...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell. With the modification, the compiler will prevent this with
an
error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

while (--argc > 0 && **++argv == '-') {
char *arg = *argv;
while (*++arg) {
switch (*arg) {
...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>


# 78acc472 12-Apr-2010 Peter Tyser <ptyser@xes-inc.com>

Rename lib_generic/ to lib/

Now that the other architecture-specific lib directories have been
moved out of the top-level directory there's not much reason to have the
'_generic' suffix on the common lib directory.

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>