summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Drop the log bufferSimon Glass2017-12-0712-436/+5
| | | | | | | | This does not appear to be used by any boards. Before introducing a new log system, remove this old one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* usb: Correct use of debug()Simon Glass2017-12-071-3/+1
| | | | | | | | With clang this gives a warning because hubsts appears to be used before it is set, even if ultimately it is not used. Simplify the code to avoid this problem. Signed-off-by: Simon Glass <sjg@chromium.org>
* mtdparts: Correct use of debug()Simon Glass2017-12-071-3/+0
| | | | | | | | | The debug() macro now evaluates its expression so does not need #ifdef protection. In fact the current code causes a warning with the new log implementation. Adjust the code to fix this. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Move debug and logging support to a separate headerSimon Glass2017-12-072-45/+60
| | | | | | | | Before adding new features, move these definitions to a separate header to avoid further cluttering common.h. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
* Revert "sandbox: Drop special case console code for sandbox"Simon Glass2017-12-071-0/+7
| | | | | | | | | | | | | While sandbox works OK without the special-case code, it does result in console output being stored in the pre-console buffer while sandbox starts up. If there is a crash or a problem then there is no indication of what is going on. For ease of debugging it seems better to revert this change also. This reverts commit d8c6fb8cedbc35eee27730a7fa544e499b3c81cc. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Adjust pre-console address to avoid conflictSimon Glass2017-12-071-1/+1
| | | | | | | | | | We cannot use sandbox memory at 0 since other things use memory at that address. Move it up out of the way. Note that the pre-console buffer is currently disabled with sandbox, but this change will avoid confusion if it is manually enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
* Revert "sandbox: remove os_putc() and os_puts()"Simon Glass2017-12-072-0/+31
| | | | | | | | | | | | | While sandbox works OK without the special-case code, it does result in console output being stored in the pre-console buffer while sandbox starts up. If there is a crash or a problem then there is no indication of what is going on. For ease of debugging it seems better to revert this change. This reverts commit 47b98ad0f6779485d0f0c14f337c3eece273eb54. Signed-off-by: Simon Glass <sjg@chromium.org>
* Merge git://git.denx.de/u-boot-i2cTom Rini2017-12-074-34/+42
|\
| * cmd: i2c: Fix use sdram sub command with CONFIG_DM_I2CNobuhiro Iwamatsu2017-12-071-2/+12
| | | | | | | | | | | | | | | | | | sdram sub command of i2c command does not support Drivers Model. This adds Drivers Model support to sdram sub command. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
| * i2c: at91_i2c: remove the .probe_chip functionAlan Ott2017-12-071-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .probe_chip function is supposed to probe an i2c device on the bus to determine whether a device is answering to a particular address. at91_i2c_probe_chip() did not do anything resembling this and always returned 0. It looks as though at91_i2c_probe_chip() was intended to be a .probe function for the controller, as it was copied-and-pasted to become at91_i2c_probe() in 0bc8f640a4d7ed. Removing the at91_i2c_probe_chip() function makes the higher layer (i2c_probe_chip()) try a zero-length read transfer to test for the presence of a device instead, which does work. Signed-off-by: Alan Ott <alan@softiron.com> Acked-by: Wenyou Yang <wenyou.yang@microchip.com> Reviewed-by: Heiko Schocher <hs@denx.de>
| * i2c: at91_i2c: Wait for TXRDY after sending the first byteAlan Ott2017-12-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | The driver must wait for TXRDY after each byte is pushed into the i2c FIFO before pushing the next byte. Previously this was not done for the first byte, causing a race condition with zeros sometimes being sent for the next byte (which is typically the first actual data byte). Signed-off-by: Alan Ott <alan@softiron.com> Reviewed-by: Heiko Schocher <hs@denx.de>
| * i2c: meson: add some commentsBeniamino Galvani2017-12-071-6/+19
| | | | | | | | | | | | | | | | | | Add some comment describing the purpose of struct members and functions. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
| * i2c: meson: fix return codes on errorBeniamino Galvani2017-12-071-2/+2
| | | | | | | | | | | | | | | | | | | | Change meson_i2c_xfer_msg() to return -EREMOTEIO in case of NACK, as done by other drivers. Also, don't change the return error in meson_i2c_xfer(). Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
| * i2c: meson: reduce timeoutBeniamino Galvani2017-12-071-1/+1
| | | | | | | | | | | | | | | | | | The datasheet doesn't specify a suggested timeout and 500ms seems very long: reduce it to 100ms. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
| * i2c: meson: improve Kconfig descriptionBeniamino Galvani2017-12-071-1/+6
|/ | | | | | | | Expand the Kconfig description with hardware features. Signed-off-by: Beniamino Galvani <b.galvani@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
* tools: omapimage: fix corner-case in byteswap pathPhilipp Tomsich2017-12-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 2614a208471e ("common: command: tempory buffer should have size of command line buf"), there have been consistent Travis CI failures on my builds (interestingly not for Tom, even though building the same commit id) due to a SEGV in building the byteswapped omapimage: arm: pcm051_rev3 make[2]: *** [MLO.byteswap] Error 139 ^^^ error code for a SEGV Turns out that the word-based byte-swapping loop in omapimage.c is to blame. With the loop condition while (swapped <= (sbuf->st_size / sizeof(uint32_t))) there had been one-too-many iterations for all file sizes divisible by the sizeof(uint32_t). I.e. we had 1 iteration for 0 bytes (and also 1 through 3 bytes) and 2 iterations at 4 bytes... clearly overshooting on 0 and 4 bytes. This commit fixes the calculation of an up-rounded word-count and makes sure to keep the zero-based loop-counter below the number of words to be processed. References: 2614a20 ("common: command: tempory buffer should have size of command line buf") Fixes: 79b9ebb ("omapimage: Add support for byteswapped SPI images") Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Martin Elshuber <martin.elshuber@theobroma-systems.com>
* Merge tag 'signed-efi-next' of git://github.com/agraf/u-bootTom Rini2017-12-0533-659/+2391
|\ | | | | | | | | | | | | | | | | | | Patch queue for efi - 2017-12-05 Highlights for this release: - Dynamic EFI object creation (lists instead of static arrays) - EFI selftest improvements - Minor fixes
| * efi_stub: Use efi_uintn_tAlexander Graf2017-12-051-1/+1
| | | | | | | | | | | | | | | | | | | | Commit f5a2a93892f ("efi_loader: consistently use efi_uintn_t in boot services") changed the internal EFI API header without adapting its existing EFI stub users. Let's adapt the EFI stub as well. Fixes: f5a2a93892f ("efi_loader: consistently use efi_uintn_t in boot services") Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
| * efi_loader helloworld.efi: Fix building with -OsAlexander Graf2017-12-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Depending on your compiler, when compiling the hello world efi binary with -Os, gcc might think it's a smart idea to replace common patterns such as memory copies with explicit calls to memcpy(). While that sounds great at first, we don't have any memcpy() available in our helloworld build target. So let's indicate to gcc that we really do want to have the code be built as freestanding. Fixes: bbf75dd9 ("efi_loader: output load options in helloworld") Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: Fix partition offsetsAlexander Graf2017-12-011-47/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 884bcf6f65 (efi_loader: use proper device-paths for partitions) tried to introduce the el torito scheme to all partition table types: Spawn individual disk objects for each partition on a disk. Unfortunately, that code ended up creating partitions with offset=0 which meant that anyone accessing these objects gets data from the raw block device instead of the partition. Furthermore, all the el torito logic to spawn devices for partitions was duplicated. So let's merge the two code paths and give partition disk objects good offsets to work from, so that payloads can actually make use of them. Fixes: 884bcf6f65 (efi_loader: use proper device-paths for partitions) Reported-by: Yousaf Kaukab <yousaf.kaukab@suse.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: add missing breaksRob Clark2017-12-011-0/+2
| | | | | | | | | | | | | | | | | | | | Otherwise with GUID partition types you would end up with things like: .../HD(Part0,Sig6252c819-4624-4995-8d16-abc9cd5d4130)/HD(Part0,MBRType=02,SigType=02) Signed-off-by: Rob Clark <robdclark@gmail.com> [agraf: rebased] Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: comments for EFI_DEVICE_PATH_TO_TEXT_PROTOCOLHeinrich Schuchardt2017-12-011-0/+24
| | | | | | | | | | | | | | | | Provide comments for efi_convert_device_node_to_text() and efi_convert_device_path_to_text(). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: helper function to add EFI object to listHeinrich Schuchardt2017-12-015-16/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid duplicate coding provide a helper function that initializes an EFI object and adds it to the EFI object list. efi_exit() is the only place where we dereference a handle to obtain a protocol interface. Add a comment to the function. Suggested-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: pass handle of loaded imageHeinrich Schuchardt2017-12-012-4/+5
| | | | | | | | | | | | | | | | | | | | The handle of a loaded image is the value of the handle member of the loaded image info object and not the address of the loaded image info. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * test/py: check return code of helloworldHeinrich Schuchardt2017-12-011-0/+2
| | | | | | | | | | | | | | | | Check that helloworld.efi returns EFI_SUCCESS. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: output load options in helloworldHeinrich Schuchardt2017-12-011-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | We need to test if we pass a valid image handle when loading and EFI application. This cannot be done in efi_selftest as it is not loaded as an image. So let's enhance helloworld a bit. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: add missing line feedHeinrich Schuchardt2017-12-011-1/+1
| | | | | | | | | | | | | | | | Add a missing line feed for an error message. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: compile without special compiler flagsHeinrich Schuchardt2017-12-011-25/+0
| | | | | | | | | | | | | | | | | | | | | | As the selftest is not compiled as an EFI binary we do not need special compiler flags. This avoids the checkarmreloc error on vexpress_ca15_tc2. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: manage protocols in a linked listHeinrich Schuchardt2017-12-015-58/+58
| | | | | | | | | | | | Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: simplify find_objHeinrich Schuchardt2017-12-011-24/+19
| | | | | | | | | | | | | | | | Use function efi_search_protocol(). Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: simplify efi_open_protocolHeinrich Schuchardt2017-12-011-30/+6
| | | | | | | | | | | | | | | | Use function efi_search_protocol. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: efi_gop: use efi_add_protocolHeinrich Schuchardt2017-12-011-5/+10
| | | | | | | | | | | | | | | | Use efi_add_protocol to add protocol. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: efi_net: use efi_add_protocolHeinrich Schuchardt2017-12-011-14/+20
| | | | | | | | | | | | | | | | Use efi_add_protocol to add protocols. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: efi_disk: use efi_add_protocolHeinrich Schuchardt2017-12-011-16/+23
| | | | | | | | | | | | | | | | Use efi_add_protocol to install protocols. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: test EFI_DEVICE_PATH_TO_TEXT_PROTOCOLHeinrich Schuchardt2017-12-012-0/+393
| | | | | | | | | | | | | | Provide a test for the EFI_DEVICE_PATH_TO_TEXT_PROTOCOL protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: reimplement LocateDevicePathHeinrich Schuchardt2017-12-011-30/+76
| | | | | | | | | | | | | | | | | | | | The current implementation of efi_locate_device_path does not match the UEFI specification. It completely ignores the protocol parameters. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: fix efi_convert_device_node_to_textHeinrich Schuchardt2017-12-011-66/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to implement to different functions for the EFI_DEVICE_PATH_TO_TEXT_PROTOCOL: ConvertDeviceNodeToText ConvertDevicePathToText A recent patch screwed up efi_convert_device_node_to_text to expect a device path and not a node. The patch makes both service functions work again. efi_convert_device_node_to_text is renamed to efi_convert_single_device_node_to_text and efi_convert_device_node_to_text_ext is renamed to efi_convert_device_node_to_text to avoid future confusion. A test of ConvertDeviceNodeToText will be provided in a follow-up patch. Fixes: adae4313cdd efi_loader: flesh out device-path to text Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: efi_dp_str should print path not nodeHeinrich Schuchardt2017-12-011-7/+6
| | | | | | | | | | | | | | | | | | | | | | | | efi_dp_str is meant to print a device path and not a device node. The old coding only worked because efi_convert_device_node_to_text was screwed up to expect paths instead of nodes. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: size of media device path node represenationHeinrich Schuchardt2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | In the format specifier we want to specify the maximum width in case an ending \0 is missing. So slen must be used as precision and not as field width. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: Exit in efi_set_bootdev() upon invalid "desc"Stefan Roese2017-12-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When trying to load an image from a non-existent USB key, U-Boot v2017.11 crashes on my x86 platform: => load usb 0:1 03000000 abc General Protection EIP: 0010:[<7b59030d>] EFLAGS: 00010286 Original EIP :[<fff4330d>] ... This used to work in v2017.09. Testing has shown, that this bug was introduced with patch 95c5553e [efi_loader: refactor boot device and loaded_image handling]. This patch now checks if a valid "desc" is returned from blk_get_dev() and only continues when "desc" is available. Resulting in this cmd output (again): => load usb 0:1 03000000 abc ** Bad device usb 0 ** Signed-off-by: Stefan Roese <sr@denx.de> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: helloworld.c: remove superfluous includeHeinrich Schuchardt2017-12-011-1/+0
| | | | | | | | | | | | | | Remove a superfluous include from helloworld.c Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: initialise partition_signature memoryJonathan Gray2017-12-011-2/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zero partition_signature in the efi_device_path_hard_drive_path structure when signature_type is 0 (no signature) as required by the UEFI specification. This is required so that efi_dp_match() will work as expected when doing memcmp() comparisons. Previously uninitialised memory would cause it not match nodes when it should have when the signature type was not GUID. Corrects a problem where the loaded image protocol would not return a device path with MEDIA_DEVICE causing the OpenBSD bootloader to fail on rpi_3 and other targets. v2: Also handle signature_type 1 (MBR) as described in the specification Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Tested-by: Artturi Alm <artturi.alm@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: efi_console: use helper functionsHeinrich Schuchardt2017-12-012-23/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use helper functions efi_created_handle and efi_add_protocol for creating the console handles and instaling the respective protocols. This change is needed if we want to move from an array of protocols to a linked list of protocols. Eliminate EFI_PROTOCOL_OBJECT which is not used anymore. Currently we have not defined protocol interfaces to be const. So efi_con_out and efi_console_control cannot be defined as const. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: refactor efi_setup_loaded_imageHeinrich Schuchardt2017-12-011-14/+25
| | | | | | | | | | | | | | Use helper functions to add protocols. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: simplify efi_locate_protocolHeinrich Schuchardt2017-12-011-12/+6
| | | | | | | | | | | | | | | | | | Use helper function efi_search_protocol. Do not print protocol guid twice in debug mode. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: simplify efi_uninstall_protocol_interfaceHeinrich Schuchardt2017-12-011-27/+11
| | | | | | | | | | | | | | | | Use function efi_search_obj, efi_search_protocol and efi_remove_protocol to simplify the coding. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: simplify efi_searchHeinrich Schuchardt2017-12-011-9/+6
| | | | | | | | | | | | | | | | | | Use helper function efi_search_protocol in efi_search. Add missing comments. Put default handling into default branch of switch statement. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: simplify efi_install_protocol_interfaceHeinrich Schuchardt2017-12-011-36/+2
| | | | | | | | | | | | | | Use helper functio efi_add_protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_loader: helper functions for protocol managementHeinrich Schuchardt2017-12-012-0/+131
| | | | | | | | | | | | | | | | | | | | | | This patch provides helper functions to manage protocols. efi_search_protocol - find a protocol on a handle efi_add_protocol - install a protocol on a handle efi_remove_protocol - remove a protocol from a handle efi_remove_all_protocols - remove all protocols from a handle Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
| * efi_selftest: test for graphics output protocolHeinrich Schuchardt2017-12-012-0/+98
| | | | | | | | | | | | | | Supply a test for the graphics output protocol. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>