aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-10-18Merge tag 'dm-pull-18oct22' of ↵WIP/18Oct2022Tom Rini77-405/+904
https://source.denx.de/u-boot/custodians/u-boot-dm Update uclass iterators to work better when devices fail to probe Support VBE OS requests / fixups Minor error-handling tweaks to bootm command
2022-10-18Merge tag 'u-boot-stm32-20221018' of ↵Tom Rini17-78/+398
https://source.denx.de/u-boot/custodians/u-boot-stm - stm32mp: fix compilation issue with DEBUG_UART - DT update : - Remove buck3 regulator-always-on on AV96 - Enable btrfs support on DHSOM - Drop extra newline from AV96 U-Boot extras DT - Add DHCOR based Testbench board - Fix and expand PLL configuration comments - update SCMI dedicated file
2022-10-18stm32mp: fix compilation issue with DEBUG_UARTPatrick Delaunay6-54/+34
Fix the compilation issue when CONFIG_DEBUG_UART is activated drivers/serial/serial_stm32.o: in function `debug_uart_init': drivers/serial/serial_stm32.c:291: undefined reference to \ `board_debug_uart_init' The board_debug_uart_init is needed for SPL boot, called in cpu.c::mach_cpu_init(); it is defined in board/st/stm32mp1/spl.c. But with the removal #ifdefs patch, the function debug_uart_init() is always compiled even if not present in the final U-Boot image. This patch adds a file to provided this function when DEBUG_UART and SPL are activated. Fixes: c8b2eef52b6c ("stm32mp15: tidy up #ifdefs in cpu.c") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-10-18ARM: dts: stm32: update SCMI dedicated filePatrick Delaunay1-4/+0
The PWR regulators don't need be removed as they are already deactivated. This patches is a alignment with the accepted patch in Linux device tree in commit a34b42f8690c ("ARM: dts: stm32: fix pwr regulators references to use scmi"). Fixes: 69ef98b209e7 ("ARM: dts: stm32mp15: alignment with v5.19") Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-10-18ARM: dts: stm32: Fix and expand PLL configuration commentsMarek Vasut2-2/+32
Fix the frequencies listed in PLL configuration comments to match the actual frequencies programmed into hardware. Furthermore, add a comment which explains how those frequencies are calculated, so it won't be necessary to look it up all over the datasheet and make more mistakes in the calculation in the future. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2022-10-18ARM: dts: stm32: Add DHCOR based Testbench boardMarek Vasut5-17/+325
Add DT for DHCOR Testbench board, which is a testbench for testing of DHCOR SoM during manufacturing. This is effectively a trimmed down version of AV96 board with CSI-2 bridge, HDMI bridge, WiFi, Audio and LEDs removed and used as GPIOs instead. Furthermore, the PMIC Buck3 is always configured from PMIC NVM to cater for both 1V8 and 3V3 SoM variant. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-10-18ARM: dts: stm32: Drop extra newline from AV96 U-Boot extras DTMarek Vasut1-1/+0
Remove duplicate newline, no functional change. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-10-18ARM: stm32: Enable btrfs support on DHSOMMarek Vasut2-0/+2
The btrfs filesystem provides advanced functionality like copy-on-write and snapshots, as well as metadata and data duplication and checksumming. Enable btrfs in U-Boot to permit even the primary partition to be btrfs and let system boot from it. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-10-18ARM: dts: stm32: Remove buck3 regulator-always-on on AV96Marek Vasut2-0/+5
In case the regulator-always-on is present in regulator DT node, the regulator is always reconfigured to the voltage set in DT on probe, even if regulator_set_value() has been called before. Drop the property from AV96 U-Boot DT and enable the regulator manually in code, as the board already reconfigures the Buck3 regulator in code per PMIC NVM content instead. Fixes: 0adf10a87b1 ("ARM: dts: stm32: Configure Buck3 voltage per PMIC NVM on Avenger96") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2022-10-17vbe: Add a test for VBE device tree fixupsSimon Glass7-3/+192
When a FIT includes some OS requests, U-Boot should process these and add the requested info to corresponding subnodes of the /chosen node. Add a pytest for this, which sets up the FIT, runs bootm and then uses a C unit test to check that everything looks OK. The test needs to run on sandbox_flattree since we don't support device tree fixups on sandbox (live tree) yet. So enable BOOTMETH_VBE and disable bootflow_system(), since EFI is not supported on sandbox_flattree. Add a link to the initial documentation. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: core: Update docs about oftree_from_fdt()Simon Glass2-1/+4
Update this function's comment and also the livetree documentation, so it is clear when to use the function. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17vbe: Add fixups for a basic set of OS requestsSimon Glass3-1/+235
As a starting point, add support for providing random data, if requested by the OS. Also add ASLR, as a placeholder for now. Signed-off-by: Simon Glass <sjg@chromium.org> (fixed up to use uclass_first_device_err() instead)
2022-10-17test: Move common FIT code into a separate fit_util fileSimon Glass3-80/+110
To avoid duplicating code, create a new fit_util module which provides various utility functions for FIT. Move this code out from the existing test_fit.py and refactor it with addition parameters. Fix up pylint warnings in the conversion. This involves no functional change. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17boot: Tidy up logging and naming in vbe_simpleSimon Glass1-7/+9
Make sure the log_msg_ret() values are unique so that the log trace is unambiguous with LOG_ERROR_RETURN. Also avoid reusing the 'node' variable for two different nodes in bootmeth_vbe_simple_ft_fixup(), since this is confusing. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17boot: Pass the correct FDT to the EVT_FT_FIXUP eventSimon Glass1-6/+9
Now that we support multiple device trees with the ofnode interface, we can pass the correct FDT to this event. This allows the 'working' FDT to be fixed up, as expected, so long as OFNODE_MULTI_TREE is enabled. Also make sure we don't try to do this with livetree, which does not support fixups yet. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17sandbox: Support FDT fixupsSimon Glass1-0/+17
Add support for doing device tree fixups in sandbox. This allows us to test that functionality in CI. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17bootstd: Move VBE setup into a shared functionSimon Glass3-30/+68
This information needs to be set up by the bootstd tests as well. Move it into a common function and ensure it is executed before any bootstd test is run. Make sure the 'images' parameter is set correctly for fixups. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17fdt: Show a message when the working FDT changesSimon Glass3-1/+12
The working FDT is the one which comes from the OS and is fixed up by U-Boot. When the bootm command runs, it sets up the working FDT to be the one it is about to pass to the OS, so that fixups can happen. This seems like an important step, so add a message indicating that the working FDT has changed. This is shown during the running of the bootm command. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17fs: Quieten down the filesystems moreSimon Glass4-14/+13
When looking for a filesystem on a partition we should do so quietly. At present if the filesystem is very small (e.g. 512 bytes) we get a host of messages. Update these to only show when debugging. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17boot: Correct handling of addresses in boot_relocate_fdt()Simon Glass1-11/+11
This code uses casts between addresses and pointers, so does not work with sandbox. Update it so we can allow sandbox to do device tree fixups. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17bootm: Drop #ifdef from do_bootm()Simon Glass1-10/+9
Drop the #ifdefs from this command by using a variable to hold the states that should be executed. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17bootm: Avoid returning error codes from commandSimon Glass1-2/+6
Functions which implement commands must return a CMD_RET_... error code. At present bootm can return a negative errno value in some cases, thus causing strange behaviour such as trying to exit the shell and printing usage information. Fix this by returning the correct value. Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17bootm: Change incorrect 'unsupported' errorSimon Glass1-1/+1
At present when bootm fails, it says: subcommand not supported and then prints help for the bootm command. This is not very useful, since generally the error is related to something else, such as fixups failing. It is quite confusing to see this in a test run. Change the error and show the error code. We could update the OS functions to return -ENOSYS when they do not support the bootm subcommand. But this involves some thought since this is arch-specific code and proper errno error codes are not always returned. Also, with the code as is, all required subcommands are of course supported - a problem would only come if someone added a new one or removed support for one from an existing OS. Therefore it seems better to leave that sort of effort for when our bootm tests are improved. Note: v1 of this patch generated a discussion[1] about printing error strings automatically using printf(). That is outside the scope of this patch but will be dealt with separately. [1] https://patchwork.ozlabs.org/project/uboot/patch/20220909151801.336551-3-sjg@chromium.org/ Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: core: Switch uclass_*_device_err to use uclass_*_device_checkMichal Suchanek2-25/+25
The _err variant iterators use the simple iterators without suffix as basis. However, there is no user that uclass_next_device_err for iteration, many users of uclass_first_device_err use it to get the first and (assumed) only device of an uclass, and a couple that use uclass_next_device_err to get the device following a known device in the uclass list. While there are some truly singleton device classes in which more than one device cannot exist these are quite rare, and most classes can have multiple devices even if it is not the case on the SoC's EVB. In a later patch the simple iterators will be updated to not stop on error and return next device instead. With this in many cases the code that expects the first device or an error if it fails to probe may get the next device instead. Use the _check iterators as the basis of _err iterators to preserve the old behavior. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: core: Switch uclass_foreach_dev_probe to use simple iteratorMichal Suchanek2-6/+3
The return value is not used for anythig, and in a later patch the behavior of the _err iterator will change in an incompatible way. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org> Update pvblock_probe() to avoid using internal var: Signed-off-by: Simon Glass <sjg@chromium.org>
2022-10-17mpc83xx: gazerbeam: Update sysinfo_get error handlingMichal Suchanek1-3/+9
In a later patch sysinfo_get will be changed to return the device in cae of an error. Set sysinfo to NULL on error to preserve previous behavior. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17net: eth-uclass: Do not set device on errorMichal Suchanek1-0/+2
eth_get_dev relies on the broken behavior that returns an error but not the device on which the error happened which gives the caller no reasonable way to report or handle the error. In a later patch uclass_first_device_err will be changed to return the device on error but eth_get_dev stores the returned device pointer directly in a global state without checking the return value. Unset the pointer again in the error case. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: blk: Do not use uclass_next_device_errMichal Suchanek1-10/+6
blk_first_device_err/blk_next_device_err uses uclass_first_device_err/uclass_next_device_err for device iteration. Although the function names superficially match the return value from uclass_first_device_err/uclass_next_device_err is never used meaningfully, and uclass_first_device/uclass_next_device works equally well for this purpose. In the following patch the semantic of uclass_first_device_err/uclass_next_device_err will be changed to be based on uclass_first_device_check/uclass_next_device_check breaking this sole user that uses uclass_next_device_err for iteration. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: treewide: Use uclass_next_device_err when accessing second deviceMichal Suchanek2-2/+2
There are a couple users of uclass_next_device return value that get the first device by other means and use uclass_next_device assuming the following device in the uclass is related to the first one. Use uclass_next_device_err because the return value from uclass_next_device will be removed in a later patch. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: treewide: Use uclass_first_device_err when accessing one deviceMichal Suchanek25-59/+43
There is a number of users that use uclass_first_device to access the first and (assumed) only device in uclass. Some check the return value of uclass_first_device and also that a device was returned which is exactly what uclass_first_device_err does. Some are not checking that a device was returned and can potentially crash if no device exists in the uclass. Finally there is one that returns NULL on error either way. Convert all of these to use uclass_first_device_err instead, the return value will be removed from uclass_first_device in a later patch. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17cmd: List all uclass devices regardless of probe errorMichal Suchanek5-35/+43
There are a few commands that iterate uclass with uclass_first_device/uclass_next_device or the _err variant. Use the _check class iterator variant to get devices that fail to probe as well, and print the status. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17w1: Fix bus counting in w1_get_busMichal Suchanek1-9/+11
Use uclass_first_device_check/uclass_next_device_check to correctly count buses that fail to probe. Fixes: d3e19cf919 ("w1: Add 1-Wire uclass") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17video: ipuv3: Fix error handling when getting the displayMichal Suchanek1-5/+4
The code checks that uclass_first_device returned a device but the returned value that is assigned is never used. Use uclass_first_device_err instead, and move the error return outside of the if block. Fixes: f4ec1ae08e ("mxc_ipuv3_fb.c: call display_enable") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17stdio: Fix class iteration in stdio_add_devices()Michal Suchanek1-19/+13
There is a complaint in the code that iterates keyboards that we don't have the _check variant of class iterator but we in fact do, use it. In the code that iterates video devices there is an attempt to print errors but the simple iterator does not return a device when there is an error. Use the _check variant of the iterator as well. Also format error messages consistently. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17usb: ether: Fix error handling in usb_ether_initMichal Suchanek1-6/+5
The code checks the return value from uclass_first_device as well as that the device exists but it passes on the return value which may be zero if there are no gadget devices. Just check that a device was returned and return -ENODEV otherwise. Also remove the dev variable which is not really used for anything. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17bootstd: Fix listing boot devicesMichal Suchanek1-2/+2
bootdev_list() uses uclass_*_device_err() to iterate devices. However, the only value _err adds is returning an error when the device pointer is null, and that's checked anyway. Also there is some intent to report errors, and that's what uclass_*_device_check() is for, use it. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: pci: Fix device PCI iterationMichal Suchanek1-2/+2
When there is no PCI bus uclass_first_device will return no bus and no error which will result in pci_find_first_device calling skip_to_next_device with no bus, and the bus is only checked at the end of the while cycle, not the beginning. Fixes: 76c3fbcd3d ("dm: pci: Add a way to iterate through all PCI devices") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: treewide: Do not opencode uclass_probe_all()Michal Suchanek4-54/+9
We already have a function for probing all devices of a specific class, use it. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: core: Fix uclass_probe_all to really probe all devicesMichal Suchanek2-11/+20
uclass_probe_all uses uclass_first_device/uclass_next_device assigning the return value. The interface for getting meaningful error is uclass_first_device_check/uclass_next_device_check, use it. Also do not stop iteration when an error is encountered. Probing all devices includes those that happen to be after a failing device in the uclass order. Fixes: a59153dfeb ("dm: core: add function uclass_probe_all() to probe all devices") Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
2022-10-17dm: regmap: Disable range checks in SPLSimon Glass1-2/+21
A recent change to regmap breaks building of phycore-rk3288 for me. The difference is only a few bytes. Somehow CI seems to pass, even though it fails when I run docker locally. But it prevents me from sending any more pull requests. In any case this board is clearly near the limit. We could revert the offending change, but it is needed for sandbox tests. Instead, add a way to drop the range checks in SPL, since they end up doing nothing if everything is working as expected. This makes phycore-rk3288 build again for me and reduces the size of SPL slightly for a number of boards. Signed-off-by: Simon Glass <sjg@chromium.org> Fixes: 947d4f132b4 ("regmap: fix range checks")
2022-10-17CI: Update to jammy-20221003-17Oct2022 tagWIP/17Oct2022Tom Rini2-3/+2
This includes python3-pyelftools so we can drop it from one of the tests directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2022-10-17docker: Install pyelftools for buildsSimon Glass1-0/+1
Binman needs this module to build sandbox_vpl and it is needed elsewhere in CI. Add it to the docker file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heinrich Schuchardt <xpyron.glpk@gmx.de>
2022-10-16Merge tag 'efi-2023-01-rc1-3' of ↵WIP/16Oct2022Tom Rini7-46/+77
https://source.denx.de/u-boot/custodians/u-boot-efi Pull request for efi-2023-01-rc1-3 UEFI: * replace EFI_CALL() by internal functions * delete loadfile2 handle by uninstalling all protocols Other: * Provide spi_set_speed() needed for implementation of EFI SPI I/O protocol
2022-10-16efi_loader: remove efi_delete_handle on loadfile2Ilias Apalodimas3-7/+20
Loadfile2 code is installing two protocols on it's own handle and uses efi_delete_handle() to clean it up on failure(s). However commit 05c4c9e21ae6 ("efi_loader: define internal implementations of install/uninstallmultiple") prepares the ground for us to clean up efi_delete_handle() used in favor of Install/UninstallMultipleProtocol. While at it clean up the non needed void casts to (void *) on the protolcol installation. Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-10-16cmd: simplify efidebugHeinrich Schuchardt1-26/+21
* don't use EFI_CALL() for variable services * don't use runtime pointer to access exported function Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-10-16efi_loader: avoid EFI_CALL() when draining consoleHeinrich Schuchardt1-3/+1
Use internal function. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-10-16efi_loader: avoid EFI_CALL() for clearing screenHeinrich Schuchardt1-9/+17
Carve out function efi_clear_screen. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2022-10-16spi: Implement spi_set_speedPaul Barker2-1/+18
This function is already defined in spi.h but no implementation of it currently exists in the tree. The implementation is based on the static function spi_set_speed_mode(). The function prototype is modified so that an success or error condition can be returned to the caller. Signed-off-by: Paul Barker <paul.barker@sancloud.com> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2022-10-12Merge branch '2022-10-12-additional-fixes'Tom Rini14-13/+101
- Add "ubi list", Nokia RX51 fixes, other assorted fixes
2022-10-12Nokia RX-51: Fix double space key pressPali Rohár1-1/+5
Space key is indicated by two different bits. Some HW models indicate press of space key only by the first bit. Qemu indicates it by both bits at the same time, which is currently interpreted by u-boot as double key press. Fix this issue by setting first bit when only second is set (to support HW models which indicate press only by second bit) and always clearing second bit before processing to not report double space key press. Signed-off-by: Pali Rohár <pali@kernel.org>