summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2017-09-14lib: at91: Add logo files used via API of DM_VIDEOWenyou Yang5-0/+2431
In order to display the company's logo via the API of DM_VIDEO, and add the logo files of both Atmel and Microchip. Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-13vsprintf.c: add GUID printingRob Clark1-2/+44
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>
2017-09-13vsprintf.c: add UTF-16 string (%ls) supportRob Clark1-2/+28
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>
2017-09-13lib: add some utf16 handling helpersRob Clark3-14/+105
We'll eventually want these in a few places in efi_loader, and also vsprintf. Signed-off-by: Rob Clark <robdclark@gmail.com>
2017-09-12Merge git://git.denx.de/u-boot-fsl-qoriqTom Rini2-2/+15
2017-09-12moveconfig: Use fd.write() instead of print >>Simon Glass1-0/+2
Adjust this code so that it can work with Python 2 and 3. Fixes: d73fcb1 (moveconfig: Support building a simple config database) Reported-by: Chris Packham <judge.packham@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-09-11spl: fit: Eanble GZIP support for image decompressionYork Sun2-2/+15
Add Kconfig option SPL_GZIP and SPL_ZLIB to enable gunzip support for SPL boot, eg. falcon boot compressed kernel image. Signed-off-by: York Sun <york.sun@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-09-03bch: don't use __BSD_VISIBLE to test for flsJonathan Gray1-1/+1
Commit 4ecc988301bc8e981e6d7538c57cdb3aa82f7c1d assumes fls is in libc if __BSD_VISIBLE is defined. This appears to only be true on FreeBSD and DragonFlyBSD. OpenBSD defines __BSD_VISIBLE and does not have fls in strings.h/libc. Switch the test for __BSD_VISIBLE to one for __DragonFly__ and __FreeBSD__ to unbreak the build on OpenBSD. Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
2017-09-02Convert CONFIG_BCH to KconfigAdam Ford1-0/+7
This converts the following to Kconfig: CONFIG_BCH Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-20Fix 'notes' typosAnatolij Gustschin1-2/+2
s/notes/nodes Signed-off-by: Anatolij Gustschin <agust@denx.de>
2017-08-19Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini3-4/+7
EFI Fixes for 2017.09: - Fix GOP w/o display - Fix LocateHandle - Fix exit return value truncation - Fix missing EFIAPI in efi_locate_handle (for x86)
2017-08-16env: Rename getenv_hex(), getenv_yesno(), getenv_ulong()Simon Glass1-1/+1
We are now using an env_ prefix for environment functions. Rename these for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename getenv/_f() to env_get()Simon Glass1-1/+1
We are now using an env_ prefix for environment functions. Rename these two functions for consistency. Also add function comments in common.h. Quite a few places use getenv() in a condition context, provoking a warning from checkpatch. These are fixed up in this patch also. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16env: Rename setenv() to env_set()Simon Glass1-1/+1
We are now using an env_ prefix for environment functions. Rename setenv() for consistency. Also add function comments in common.h. Suggested-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-14Merge branch 'master' of git://git.denx.de/u-boot-rockchipTom Rini2-5/+14
2017-08-13tpm: add missing va_endxypron.glpk@gmx.de1-1/+4
va_start must always be matched by va_end. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13rockchip: rk3188: rock: adjust for SPL/TPL splitPhilipp Tomsich1-0/+9
With the changes to split SPL/TPL for the RK3368, I apparently missed some needed adjustments to the RK3188 Kconfig and rock_defconfig. This fixes build-issues for the rock board after applying the RK3368 enablement (and SPL/TPL) set that resulted from TPL_SERIAL_SUPPORT, TPL_ROCKCHIP_BACK_TO_BROM and TPL_TINY_MEMSET being separate symbols now. Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2017-08-13lib: spl: differentiate between TPL and SPL for libfdt/of_control/of_platdataPhilipp Tomsich1-5/+5
This splits the compilation of code modules for TPL and SPL for OF_CONTROL (and related) features between TPL and SPL. The typical use-case of this is a TPL stage that uses OF_PLATDATA at TPL and provides full OF_CONTROL at SPL (e.g. on the RK3368). Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2017-08-12efi_loader: use EFI_PAGE_MASK instead of EFI_PAGE_SIZE - 1xypron.glpk@gmx.de1-1/+1
We should be consistent in the way we calculate page sizes. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11efi_loader: GOP fix for no displayRob Clark1-1/+1
uclass_first_device() returns 0 if there is no device, but error if there is a device that failed to probe. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11efi_loader: LocateHandle should return EFI_NOT_FOUND if none foundRob Clark1-1/+4
Spotted this debugging OpenBSD's bootloader in qemu. (Wouldn't really fix anything, the problem was not having any disks, but we should probably return the correct error code.) Signed-off-by: Rob Clark <robdclark@gmail.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-08-11efi_loader: attribute EFIAPI of efi_locate handle()xypron.glpk@gmx.de1-1/+1
efi_locate_handle is called internally so it should not be marked as EFIAPI. The external function is efi_locate_handle_ext. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-31efi_loader: Fix warning in efi_gopAlexander Graf1-1/+1
Commit ca9193d2b16 ("efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD") dropped the explicit (void*) cast for fb_base in efi gop support for CONFIG_LCD without DM. This patch adds it back, eliminating the now occuring warning again Fixes: ca9193d2b16 ("efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCD") Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-31Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini9-210/+781
Patch queue for efi - 2017-07-29 A lot of EFI greatness this time around. Thanks a lot to the two amazing new contributors Heinrich Schuchardt and Rob Clark we now gain - stable objects across multiple bootefi invocations - fixes for shim - fixes for ipxe - protocol installation - device path conversion to/from text - working "lsefi" support in grub - working notifiers - various bug fixes
2017-07-29efi_loader: indent entry/exit prints to show nesting levelRob Clark1-0/+25
This should make it easier to see when a callback back to UEFI world calls back in to the u-boot world, and generally match up EFI_ENTRY() and EFI_EXIT() calls. Signed-off-by: Rob Clark <robdclark@gmail.com> [agraf: remove static from const var] Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-29efi_loader: add checking for incorrect use of EFI_ENTRY/EXITRob Clark1-14/+31
Missing an EFI_ENTRY() or doubling up EFI_EXIT() leads to non-obvious crashes. Let's add some error checking. Signed-off-by: Rob Clark <robdclark@gmail.com> [agraf: fix bogus assert() and fix app_gd breakage] Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-28fdtdec: Drop old compatible valuesSimon Glass1-6/+0
These are not needed now since the drivers now use driver model. Drop them. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> Tested-on: Beaver, Jetson-TK1 Tested-by: Stephen Warren <swarren@nvidia.com>
2017-07-28efi_loader: Add an EFI_CALL() macroRob Clark1-3/+1
Rather than open-coding EFI_EXIT() + callback + EFI_ENTRY(), introduce an EFI_CALL() macro. This makes callbacks into UEFI world (of which there will be more in the future) more concise and easier to locate in the code. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-28efi_loader: add some missing breaksRob Clark1-0/+2
Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-27spl: make SPL and normal u-boot stage use independent SYS_MALLOC_F_LENAndy Yan2-2/+2
Some platforms have very limited SRAM to run SPL code, so there may not be the same amount space for a malloc pool before relocation in the SPL stage as the normal U-Boot stage. Make SPL and (the full) U-Boot stage use independent SYS_MALLOC_F_LEN, so the size of pre-relocation malloc pool can be configured memory space independently. Signed-off-by: Andy Yan <andy.yan@rock-chips.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> [fixed up commit-message:] Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
2017-07-26efi_loader: fix bug in efi_get_memory_mapRob Clark1-2/+2
When booting shim -> fallback -> shim -> grub -> linux the memory map is a bit larger than the size linux passes in on the first call. But in the EFI_BUFFER_TOO_SMALL case we were not passing back the updated size to linux so it would loop forever. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-26efi_loader: Improve install_configuration_tableAlexander Graf1-1/+18
The INSTALL_CONFIGURATION_TABLE callback also provides the ability to remove table entries. This patch adds that functionality. Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-26efi_loader: remove more double EFI_EXIT() in efi_disk.cRob Clark1-3/+3
Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-26efi_loader: remove double EFI_EXIT() with efi_unsupportedRob Clark1-2/+2
Probably this went unnoticed before, but it causes problems with addition of 804b1d73 ("efi_loader: log EFI return values too") Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-25efi_loader: expose protocols via GUIDRob Clark1-0/+14
shim.efi (or rather gnu-efi's LibLocateProtocol() which shim.efi uses) resolves protocols via efi_locate_handle() so the console protocols need to be added to the efi object list. Signed-off-by: Rob Clark <robdclark@gmail.com> [agraf: whitespace fixes] Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-25efi_loader: implement ProtocolsPerHandlexypron.glpk@gmx.de1-1/+44
Boot service ProtocolsPerHandle is implemented in efi_protocols_per_handle. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-25configs: Migrate RBTREE, LZO, CMD_MTDPARTS, CMD_UBI and CMD_UBIFSTom Rini1-1/+3
The above CONFIG options are in Kconfig, and now have correct depends and inter-dependencies. Migrate these to configs/ from include/configs/. In the case of CMD_UBIFS also change it to be a default y if CMD_UBI. Signed-off-by: Tom Rini <trini@konsulko.com>
2017-07-24efi_loader: parameter types for CreateEvent, SetTimerxypron.glpk@gmx.de1-5/+6
The first argument 'type' of CreateEvent is an 32bit unsigned integer bitmap and not an enum. The second argument 'type' of SetTimer take values of an enum which is called EFI_TIMER_DELAY in the UEFI standard. To avoid confusion rename efi_event_type to efi_timer_delay. Reported-by: Alexander Graf <agraf@suse.de> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_console: use EFIAPI for callback functionsxypron.glpk@gmx.de1-2/+3
The call to efi_create_event requires notification functions flagged as EFIAPI. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_loader: workaround for grub lsefi bugRob Clark1-0/+1
Patch has also been sent to fix grub to not ignore the error returned and treat protocol_buffer_count as valid. But that that might take a while to trickle into distro's, so this workaround might be useful. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_loader: implement ConvertDeviceNodeToTextxypron.glpk@gmx.de1-30/+91
Move the logic for converting a node to text from efi_convert_device_path_to_text to convert_device_node_to_text. Provide a wrapper function convert_device_node_to_text_ext. As we use only shallow device paths so we can call directly call efi_device_node_to_text from efi_device_path_to_text. Add output for MAC addresses. Add output for not yet supported types/subtypes. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_memory: return MapKeyxypron.glpk@gmx.de1-0/+2
efi_get_memory_map should set a defined value for map_key. We later can introduce the test against this value in efi_exit_boot_services as required by the UEFI standard. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_memory: do parameter checks firstxypron.glpk@gmx.de1-3/+3
The parameter checks should be done first. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_loader: gop: fixes for CONFIG_DM_VIDEO without CONFIG_LCDRob Clark2-1/+7
Make EFI GOP support work with DM_VIDEO but without legacy LCD. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-24efi_loader: move guidcmp to headerRob Clark1-5/+0
Want to re-use this for file protocol, which I'm working on. Signed-off-by: Rob Clark <robdclark@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-19efi_loader: correctly implement 100ns conversionxypron.glpk@gmx.de1-9/+40
In efi_set_timer we receive the trigger time in intervals of 100 ns. We should convert it to intervals of 1000 ns by 64bit division. The patch supplies function efi_div10 that uses multiplication to implement the missing 64 bit division. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-19efi_console: set up eventsxypron.glpk@gmx.de2-2/+40
Set up a timer event and the WaitForKey event. In the notify function of the timer event check for console input and signal the WaitForKey event accordingly. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-19efi_loader: refactor efi_set_timerxypron.glpk@gmx.de1-8/+13
efi_set_timer is refactored to make the function callable internally. Wrapper function efi_set_timer_ext is provided for EFI applications. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-19efi_loader: refactor efi_create_eventxypron.glpk@gmx.de1-12/+23
efi_create_event is refactored to make it possible to call it internally. For EFI applications wrapper function efi_create_event_ext is created. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
2017-07-19efi_loader: correct size for tpl levelxypron.glpk@gmx.de1-6/+6
The UEFI standard defines the type for the tpl level as EFI_TPL alias UINTN. UINTN is an integer is defined as an unsigned integer of native width. So we can use size_t for the definition. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>