summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-11-05pinctrl: exynos: fix type of count integerHenrik Grimler
unsigned int count is used to capture return of dev_read_string_count. When an error occurs dev_read_string_count returns -ve, which can hence not be handled correctly. Use int instead of unsigned int so that errors are detected. Fixes: 16ca80adc551 ("pinctrl: Add pinctrl driver support for Exynos7420 SoC") Signed-off-by: Henrik Grimler <henrik@grimler.se> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2024-11-04bios_emulator: fix first argument of pci_{read,write}_config_* function callsYuri Zaporozhets
When compiling for riscv64, a bunch of warning is produced for the file drivers/bios_emulator/besys.c. This patch fixes a portion of those warnings, caused by incorrect first argument to pci_{read,write}_config_* functions. Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
2024-11-04drivers/video/vesa: use MTRRs only on x86Yuri Zaporozhets
MTRR functionality is available only on x86, so this driver cannot be compiled on other architectures. Fix this with preprocessor directives. Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
2024-11-04bios_emulator: define the comment symbol for RISC-V assembler tooYuri Zaporozhets
The bios_emulator driver cannot be compiled for RISC-V because the x86emu.h header file doesn't define the comment symbol ("#") for the assembler. With this patch, use the same symbol as for e.g. x86. Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
2024-11-04bootmenu: add reprint checkWeijie Gao
Record the last active menu item and check if it equals to the current selected item before reprint. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Daniel Golle <daniel@makrotopia.org> Tested-by: Daniel Golle <daniel@makrotopia.org>
2024-11-04menu: add support to check if menu needs to be reprintedWeijie Gao
This patch adds a new callback named need_reprint for menu. The need_reprint will be called before printing the menu. If the callback exists and returns FALSE, menu printing will be canceled. This is very useful if the menu was not changed. It can save time for serial-based menu to handle more input data. Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Daniel Golle <daniel@makrotopia.org> Tested-by: Daniel Golle <daniel@makrotopia.org>
2024-11-04menu: fix the logic checking whether ESC key is pressedWeijie Gao
It's observed that the bootmenu on a serial console sometimes incorrectly quitted with superfluous characters filled to command line input: > *** U-Boot Boot Menu *** > > 1. Startup system (Default) > 2. Upgrade firmware > 3. Upgrade ATF BL2 > 4. Upgrade ATF FIP > 5. Load image > 0. U-Boot console > > > Press UP/DOWN to move, ENTER to select, ESC to quit >MT7988> [B Analysis shows it was caused by the wrong logic of bootmenu_loop: At first the bootmenu_loop received the first ESC char correctly. However, during the second call to bootmenu_loop, there's no data in the UART Rx FIFO. Due to the low baudrate, the second char of the down array key sequence hasn't be fully received. But bootmenu_loop just did a mdelay(10), and then treated it as a single ESC key press event. It didn't even try tstc() again after the 10ms timeout. This patch fixes this issue by letting bootmenu_loop check tstc() twice. Tested-By: E Shattow <lucent@gmail.com> Signed-off-by: Weijie Gao <weijie.gao@mediatek.com> Reviewed-by: Daniel Golle <daniel@makrotopia.org> Tested-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-11-04Merge patch series "U-boot: arm: Refine the booting on Total Compute"Tom Rini
Leo Yan <leo.yan@arm.com> says: This patch series is to refine the booting on Arm Total Compuate platform. It changes to use the info passed in DTB for initialization DRAM info, and dynamically initializes the booting envoironment variables. Another big change is to use an envoironment file for boot commands, based on it, the series extends to support multiple block devices (MMC and virtio). And the env file is extended for booting Debian. The last commit is to update memory mapping info based on the DRAM info passed via DT binding. Link: https://lore.kernel.org/r/20241025171821.624702-1-leo.yan@arm.com
2024-11-04arm: total_compute: Update memory mapping infoLeo Yan
This commit introduces build_mem_map() function for updating the mem_map structure with copying info from gd->bd->bi_dram, so that it can keep the consistence for DRAM info passed via DT. The page table size is calculated prior to mem_map is ready, introduce the get_page_table_size() function for a predefined table size. Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: Support Debian bootLeo Yan
Add booting option for Debian system. Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: Dynamically detect block deviceLeo Yan
Dynamically detect block device in the boot command, this allows to support both MMC and virtio block devices. Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: Minor improvement for boot argumentsBoyan Karatotev
Tell the AVB command that is loading from MMC. Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: move the boot command to an env fileBoyan Karatotev
The boot command for Total Compute has many aspects and changes from time to time. So move it to an .env file where it can be a proper script. Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: Remove unused bootm_sizeBoyan Karatotev
The whole DRAM bank is used for loading and U-boot can detect the overlap between the kernel and initramfs. So it is safe to drop bootm_size. Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: Initialize environment variablesBoyan Karatotev
Initialize the environment variables 'fdt_addr_r' and 'kernel_addr_r' during the misc init phase. The static configurations are not needed, remove them. Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04arm: total_compute: depend on TF-A for hardware descriptionBoyan Karatotev
On Total Compute, TF-A passes the info via DT binding for the hardware description - includes the serial, memory, and arm_ffa nodes. This commit initializes the fdt base address based on the passed the register x1. The similar implementation has already been done for the raspberry pi, so borrow a lot of it. Co-developed-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com> Signed-off-by: Jackson Cooper-Driver <jackson.cooper-driver@arm.com> Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com> Signed-off-by: Leo Yan <leo.yan@arm.com>
2024-11-04Merge patch series "Fixes to allow 'ut bootm' to pass when run interactively"Tom Rini
Andrew Goodbody <andrew.goodbody@linaro.org> says: Starting a sandbox session and running 'ut bootm' on the command line instead of using pytest with --verbose will result in some test failures. This series makes the tests more deterministic so that they will better control their environment and hence will work as expected whether or not they are invoked with '--verbose'. The series starts with a small fix to the parameters of bootm_process_cmdline that one commit incorrectly added using a bool when it had been updated to take flags by the preceeding commit. Link: https://lore.kernel.org/r/20241101130254.473017-1-andrew.goodbody@linaro.org
2024-11-04test: bootm: Ensure GD_FLG_SILENT is resetAndrew Goodbody
Some bootm tests expect that GD_FLG_SILENT is reset in order to work as expected. This is the state if the test is run with 'pytest --verbose' but not if run from, say, the sandbox command line. So reset the flag for those tests that rely on it being reset. This has to be done in each test as the test infrastructure will set it again before every test when not invoked with 'pytest --verbose'. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2024-11-04test: bootm: bootm_process_cmdline_env takes flagsAndrew Goodbody
The function bootm_process_cmdline_env takes flags as its third parameter, not a bool. Correct the usage by replacing 'true' with BOOTM_CL_ALL so that the intent is clear. A similar change was made throughtout this file in the previous commit to the one mentioned below as being fixed. Fixes: 4448fe8e4e7c ("bootm: Allow updating the bootargs in a buffer") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
2024-11-04usb: Fix test dependency on ext4write commandAndrew Goodbody
The tests test_usb_ext4load_ext4write, test_usb_ext2load and test_usb_load depend on the command ext4write being present not just the feature of being able to write to an ext4 file system. So update their dependencies to include the ext4write command itself. This will prevent spurious test failures when running the USB tests against USB storage with an ext2/ext4 partition but no ext4write command available. Fixes: 1c5b6edad381 ("test/py: usb: Add tests for USB device") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-04usb: Fix test failure with multiple partitionsAndrew Goodbody
When test_usb_load finds multiple partitions of the same type then it will cause a test failure. The call to write the test file will write a different test file to each partition but only return the name and size of the last one written. So the test then fails to load the test file from the first partition as it uses the name of a file on a different partition. Refactor the code so that only one test file is written at a time and is written to only the partition being tested at that time. This allows the correct file name to always be available to the code that runs the load command. This reduces the number of files written and also the number of calls to crc32 needed. Fixes: 1c5b6edad381 ("test/py: usb: Add tests for USB device") Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-03Merge tag 'dm-pull-2nov24' of https://source.denx.de/u-boot/custodians/u-boot-dmTom Rini
CI: https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/23152 CI: https://dev.azure.com/simon0972/u-boot/_build/results?buildId=71&view=results - alist enhancements and fixes - minor test and sandbox fixes - some more x86/coreboot patches
2024-11-03sandbox: Fix comment for nomap_sysmem() functionSimon Glass
This should say 'cast' rather than 'case', so fix it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03sandbox: Add a way to show the sandbox memory-mappingSimon Glass
This is mostly hidden in the background, but it is sometimes useful to look at it. Add a function to allow this. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03doc: sandbox: Add docs for the sb commandSimon Glass
This command has a few small features, so document it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03sandbox: Convert sb command to use new macroSimon Glass
Ise the new U_BOOT_CMD_WITH_SUBCMDS() macro instead of writing the code out manually. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03bloblist: test: Mark tests with UTF_BLOBLISTSimon Glass
Mark bloblist tests with this flag so that other tests which use bloblist remain unaffected. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03test: Allow saving and restoring the bloblistSimon Glass
Tests which create a new bloblist overwrite the existing one in sandbox. Provide a flag for tests to declare this behaviour. Save and restore the bloblist pointer so that other tests remain unaffected. Note that when sandbox is running normally, the bloblist has been relocated to high in memory. The existing bloblist tests create a new bloblist low in memory, so they do not conflict. Correct a build error on coreboot by using accessors for gd->bloblist: Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03log: Add a new category for testsSimon Glass
In some core test code, no existing categories make sense. Add a new one for testing. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03x86: coreboot: Allow building an expo for editing CMOS configSimon Glass
Coreboot provides the CMOS layout in the tables it passes to U-Boot. Use that to build an editor for the CMOS settings. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03x86: coreboot: Add a command to check and update CMOS RAMSimon Glass
Coreboot tables provide information about the CMOS-RAM checksum. Add a command which can check and update this. With this it is possible to adjust CMOS-RAM settings and tidy up the checksum afterwards. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03x86: coreboot: Enable support for the configuration editorSimon Glass
Enable cedit support along with required options and a simple style. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03x86: coreboot: Show the option tableSimon Glass
Update the cbsysinfo command to show the contents of the CMOS option table. While we are here, add some example output for this command, along with mention of what the unimplemented tags are. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03x86: coreboot: Add a test for cbsysinfo commandSimon Glass
Add a simple test for this command, checking that coreboot has the required features. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03bootstage: Do not sort recordsJonas Karlman
The timer counter on Rockchip SoCs may be reset in TF-A, this may cause the bootstage records to be printed out of order and with an incorrect elapsed time. Fix this by not sorting the bootstage records. Before on a Radxa ZERO 3W (RK3566) board: => bootstage report Timer summary in microseconds (12 records): Mark Elapsed Stage 0 0 reset 7,436 7,436 board_init_f 164,826 157,390 SPL 375,392 210,566 end phase 423,909 48,517 board_init_r 472,973 49,064 eth_common_init 476,848 3,875 main_loop 477,003 155 cli_loop Accumulated time: 7,181 of_live 14,739 dm_spl 15,029 dm_r 315,150 dm_f With this the records can be printed in chronological order when the counter is reset and SPL and board_init_r records show correct elapsed time. => bootstage report Timer summary in microseconds (12 records): Mark Elapsed Stage 0 0 reset 164,437 164,437 SPL 375,023 210,586 end phase 7,437 7,437 board_init_f 424,390 416,953 board_init_r 473,515 49,125 eth_common_init 477,402 3,887 main_loop 477,571 169 cli_loop Accumulated time: 14,734 dm_spl 315,646 dm_f 7,339 of_live 14,977 dm_r For the tested board external TPL and BROM take ~164 ms to initialize DRAM and load SPL, SPL take ~210ms to load images from FIT and U-Boot proper take ~477ms to reach cli prompt. Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-11-03bootstd: Avoid showing an invalid buffer addressSimon Glass
When the buffer address is not set, say so, rather than showing an address which looks very strange, on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03bootstd: cros: Correct the x86-setup addressSimon Glass
This should really use an address rather than the buffer. Update it in the command. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03test: boot: Update bootflow_iter() for console checkingSimon Glass
This test checks console output so should have the UTF_CONSOLE flag. Add it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03test: Drop the duplicate line in setup_bootmenu_image()Simon Glass
The mkimage call is done twice. Remove the duplicate. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03test: Expand implementation of ut_list_has_dm_tests()Simon Glass
This function assumes that all tests in a suite are being run. This means that it can sometimes call dm_test_restore() when it should not. The impact of this is that it is not possible, for example, to run 'ut bootstd bootflow_cros' and then check the state of bootstd afterwards, since all devices are removed and recreated. Update the function to take account of any selected test, to avoid this problem. Add a comment for test_insert while we are here. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03test: boot: Use a consistent name for the script bootmethSimon Glass
In the bootflow tests the script bootmeth is bound with the name bootmeth_script whereas the others have a name without the bootmeth_ prefix. Adjust it to be the same. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-11-03dm: core: Add a function to see if a device existsSimon Glass
All the uclass functions for finding a device end up creating a uclass if it doesn't exist. Add a function which instead returns NULL in this case. This is useful when in the 'unbind' path, since we don't want to undo any unbinding which has already happened. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Add maintainerSimon Glass
Add myself as maintainer of alist Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Add a way to efficiently filter an alistSimon Glass
Unlike linked lists, it is inefficient to remove items from an alist, particularly if it is large. If most items need to be removed, then the time-complexity approaches O(n2). Provide a way to do this efficiently, by working through the alist once and copying elements down. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Add a function to empty the listSimon Glass
Sometimes it is useful to empty the list without de-allocating any of the memory used, e.g. when the list will be re-populated immediately afterwards. Add a new function for this. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Add for-loop helpersSimon Glass
Add some macros which permit easy iteration through an alist, similar to those provided by the 'list' implementation. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Add a way to get the next elementSimon Glass
Add a new function which returns the next element after the one provided, if it exists in the list. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Expand the comment for alist_get()Simon Glass
Add a better description for this macro. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Add a comment for alist_init_struct()Simon Glass
Comment this macro so that it is clear how to use it. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03alist: Mention the error condition in alist_add_placeholder()Simon Glass
Update the function comment to note that this function can return NULL if it runs out of memory. Signed-off-by: Simon Glass <sjg@chromium.org>