aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-08-31event: Convert existing spy records to simpleSimon Glass24-78/+52
Very few of the existing event-spy records use the arguments they are passed. Update them to use a simple spy instead, to simplify the code. Where an adaptor function is currently used, remove it where possible. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Support manual relocationSimon Glass3-4/+19
Move the manual-relocation code to the initcall file. Make sure to avoid manually relocating event types. Only true function pointers should be relocated. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Support emitting eventsSimon Glass4-16/+77
At present the initcall list consists of a list of function pointers. Over time the initcall lists will likely change to mostly emitting events, since most of the calls are board- or arch-specific. As a first step, allow an initcall to be an event type instead of a function pointer. Add the required macro and update initcall_run_list() to emit an event in that case, or ignore it if events are not enabled. The bottom 8 bits of the function pointer are used to hold the event type, with the rest being all ones. This should avoid any collision, since initcalls should not be above 0xffffff00 in memory. Convert misc_init_f over to use this mechanism. Add comments to the initcall header file while we are here. Also fix up the trace test to handle the change. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31event: Export event_type_name()Simon Glass2-1/+9
Export this function so it can be used with initcall debugging. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Adjust the failure message and return valueSimon Glass1-5/+7
Move the failure message outside the loop, so it is easier to follow the code. Avoid swallowing the error code - just pass it along. Drop the initcall-list address from the output. This is confusing since we show two addresses. Really it is only the function address which is useful, since it can be looked up in the map, e.g. with: grep -A1 -B1 serial_init u-boot.map Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Adjust the loop logicSimon Glass1-12/+12
Use a variable to hold the function, so we don't need to repeat the pointer access each time. Rename the init pointer to 'ptr' since we only refer to it in the for() statement now. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31initcall: Factor out reloc_off calculationSimon Glass1-10/+15
Move this into a function and do it once, not each time around the loop. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31Revert "initcall: Move to inline function"Simon Glass4-46/+58
Somehow I do not see any inlining with initcalls now. I was sure I saw it when this commit went in, but now it seems to make things worse. This reverts commit 47870afab92fca6e672c03d0dea802a55e200675. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31event: Support a simple spy recordSimon Glass5-8/+79
The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used. Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use. Update the event script to find these in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-31Merge branch '2023-08-30-assorted-code-improvements' into nextTom Rini12-151/+188
- pcie-bcmstb improvements, nvmxip improvements, fix a corner case in the serial uclass, send error messages to stderr in host tools, fwu library CI state fixup, turn some setexpr diagnostic messages to debug
2023-08-30setexpr: Silence some diagnostic messagesŁukasz Stelmach1-2/+2
Neither successful match nor lack thereof should be considered an extraordinary situation. Thus, neither require printing a message. Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-30configs: sandbox: Enable NVMXIP QSPI driverMarek Vasut1-0/+1
Enable NVMXIP QSPI driver on sandbox, since it is already enabled on sandbox64. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-08-30drivers/mtd/nvmxip: Move sandbox_set_enable_memio() to testMarek Vasut2-4/+2
The sandbox_set_enable_memio() should only ever be set during sandbox testing, not within driver itself, move it back to test/ . Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-08-30drivers/mtd/nvmxip: Print phys_addr_t without warnings on both 32bit and ↵Marek Vasut1-2/+2
64bit systems Cast the address such that it can be printed without warnings on both 32bit and 64bit systems. This really should use some better print formatter, but for the lack of it, do it this way. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-08-30drivers/mtd/nvmxip: Rework the read accessor to support 32bit systemsMarek Vasut1-26/+12
Get rid of nvmxip_mmio_rawread() and just implement the readl()/readq() reader loop within nvmxip_blk_read(). Cast the destination buffer as needed and increment the read by either 4 or 8 bytes depending on if this is systemd with 32bit or 64bit physical address. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-08-30drivers/mtd/nvmxip: Trigger post bind as probe on driver levelMarek Vasut3-11/+20
Perform all the block device creation only once, after the driver itself successfully bound. Do not do this in uclass post bind, as this might be triggered multiple times. For example the ut_dm_host test triggers this and triggers a memory leak that way, since there are now multiple block devices created using the blk_create_devicef() . To retain the old probe-on-boot behavior, set DM_FLAG_PROBE_AFTER_BIND flag in uclass post_bind callback, so the driver model would probe the driver at the right time. Rename the function as well, to match similar functions in other block-related subsystems, like the mmc one. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2023-08-30fwu: Initialize global fwu library state during CI testMarek Vasut2-6/+18
The current CI test worked by sheer luck, the g_dev global pointer in the fwu library was never initialized and the test equally well failed on sandbox64. Trigger the main loop in sandbox tests too to initialize that global state, and move the sandbox specific exit from fwu_boottime_checks after g_dev is initialized. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-30serial-uclass: reset gd->cur_serial_dev to NULL if serial not foundMaksim Kiselev1-0/+1
Reset gd->cur_serial_dev pointer to avoid calling non-relocated code from relocated code if a serial driver is not found and CONFIG_REQUIRE_SERIAL_CONSOLE is disabled. Here is detailed explanation of what this patch is trying to fix. U-boot calls the serial_find_console_or_panic() function twice. The first console setup occurs before U-boot relocation in the serial_init(). This stage uses simple FDT parsing and assigns gd->cur_serial_dev to a "serial" device that lives in non-relocated code too. The second console setup after U-boot relocation(from serial_initialize()) may use full live DT (if OF_LIVE enabled) probe sequence with buses, clocks, resets, etc... And if the console setup fails at this step, than we should be caught by panic_str("No serial driver found"). But... If we disable CONFIG_REQUIRE_SERIAL_CONSOLE, than we return from serial_init() with gd->cur_serial_dev pointing to the "old"(non-relocated) serial device. And if this area, where "old" serial device is placed, is changed (e.g. Linux kernel may be relocated at this address), than we will get an unexpected crash on the next call of printf(). Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
2023-08-30tools: image-host: print error messages to stderrOleksandr Suvorov1-95/+107
The make by default cuts off the stdout output from external tools, so all error messages from the image-host are not shown in a make output. Besides that, it is a common approach to use stderr stream for error messages. Use stderr for all error messages in image-host. Signed-off-by: Oleksandr Suvorov <oleksandr.suvorov@foundries.io> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-30pci: pcie-brcmstb: do not rely on CLKREQ# signalSam Edwards1-5/+13
When the Broadcom STB PCIe controller is initialized, it must be set into one of three CLKREQ# modes: "none"/"aspm"/"l1ss". The Linux driver, through today, hard-codes "aspm" since the vast majority of boards using this driver have a fixed PCIe bus with the CLKREQ# signal wired up. The Raspberry Pi CM4, however, can be connected to a plethora of PCIe devices, some of which do not connect the CLKREQ# line (they just leave it floating). So "aspm" mode is no longer appropriate in all cases. In Linux, there is a proposed patchset [1] to determine the proper mode. This doesn't really make sense in U-Boot's case, so we just change the assumption from "aspm" to "none" (which is always safe). This patch DOES resolve a real-world crash that occurs when U-Boot is running on a Raspberry Pi CM4 installed in slot 3 of a Turing Pi 2 cluster board. [1]: https://lore.kernel.org/all/20230428223500.23337-1-jim2101024@gmail.com/ Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2023-08-30pci: pcie-brcmstb: bring over some robustness improvements from LinuxSam Edwards1-0/+10
Since the initial U-Boot driver was ported here from Linux, the latter has had a few changes for robustness/stability. This patch brings over two of them: - Do not attempt to access the configuration space of a PCIe device if the link has gone down, as that will result in an asynchronous SError interrupt which will crash U-Boot. - Wait for the recommended 100ms after PERST# is deasserted. I sent this patch while debugging a crash involving PCIe, but these are unrelated improvements. I do not believe that this patch fixes any real-world bug. Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2023-08-30Merge tag 'u-boot-at91-2023.10-a' of ↵WIP/30Aug2023-nextTom Rini23-89/+1079
https://source.denx.de/u-boot/custodians/u-boot-at91 into next First set of u-boot-at91 features for the 2023.10 cycle: This feature set includes a new board sama5d29 Curiosity, and various fixes and alignments for sam9x60 and sam9x60 curiosity board.
2023-08-29Merge branch ↵Tom Rini36-224/+1175
'2023-08-29-integrate-efi-capsule-update-better-in-to-u-boot-buildflow' into next To quote the author: This patchset aims to bring two capsule related tasks under the U-Boot build flow. The first task is related to generation of capsules. The capsules can be generated as part of U-Boot build, and this is being achieved through binman, by adding a capsule entry type. The capsules can be generated by specifying the capsule parameters as properties under the capsule entry node. The other task is the embedding of the public key into the platform's DTB. The public key is in the form of an EFI Signature List(ESL) file and is used for capsule authentication. This is being achieved by adding the signature node containing the capsule public key in the platform's DTB. Corresponding changes have also been made to the test setup of the EFI capsule update feature. The ESL public key file was embedded into the sandbox platform's test.dtb as part of the test setup, post U-Boot build. This is now no longer needed as the embedding of the ESL happens as part of the build. Secondly, the capsules needed for testing the EFI capsule update feature were being generated through the invocation of the mkeficapsule tool. This setup has also been changed to introduce generation of these capsules through binman. The document has been updated to reflect the above changes.
2023-08-29doc: capsule: Document the new mechanism to embed ESL file into dtbWIP/2023-08-29-integrate-efi-capsule-update-better-in-to-u-boot-buildflowSughosh Ganu1-14/+5
Update the document to specify how the EFI Signature List(ESL) file can be embedded into the platform's dtb as part of the U-Boot build. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-29test: capsule: Remove logic to add public key ESLSughosh Ganu2-20/+4
The public key EFI Signature List(ESL) needed for capsule authentication is now embedded into the platform's DTB as part of the build. Remove the superfluous logic from the test setup. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2023-08-29sandbox: capsule: Add path to the public key ESL fileSughosh Ganu2-0/+2
Add the path to the public key EFI Signature List(ESL) file for the sandbox variants which enable capsule authentication. This ESL file gets embedded into the platform's device-tree as part of the build. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2023-08-29scripts/Makefile.lib: Embed capsule public key in platform's dtbSughosh Ganu3-0/+34
The EFI capsule authentication logic in u-boot expects the public key in the form of an EFI Signature List(ESL) to be provided as part of the platform's dtb. Currently, the embedding of the ESL file into the dtb needs to be done manually. Add a target for generating a dtsi file which contains the signature node with the ESL file included as a property under the signature node. Include the dtsi file in the dtb. This brings the embedding of the ESL in the dtb into the U-Boot build flow. The path to the ESL file is specified through the CONFIG_EFI_CAPSULE_ESL_FILE symbol. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-29scripts/Makefile.lib: Add dtsi include files as deps for building DTBSughosh Ganu1-1/+3
At the time of building the DTB, some dtsi files can be selected for inclusion. Have these dtsi files as dependencies for the DTB target. This also ensures generation or updating the dtsi files if need be. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2023-08-29scripts/Makefile.lib: Collate all dtsi files for inclusionSughosh Ganu1-4/+7
At the time of building a device-tree file, all the *u-boot.dtsi files are looked for, in a particular order, and the first file found is included. Then, the list of files specified in the CONFIG_DEVICE_TREE_INCLUDES symbol are included. Combine these files that are to be included into a variable, and then include all these files in one go. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-29sandbox: trace: Increase trace buffer sizeSughosh Ganu3-3/+3
When running the trace test on the sandbox platform, the current size of 16MiB is no longer large enough for capturing the entire trace history, and results in truncation. Use a size of 32MiB for the trace buffer on the sandbox platform while running the trace test. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29doc: Add documentation to highlight capsule generation related updatesSughosh Ganu1-0/+40
The EFI capsules can now be generated as part of U-Boot build, through binman. Highlight these changes in the documentation. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2023-08-29test: capsule: Generate EFI capsules through binmanSughosh Ganu4-174/+367
Support has been added for generating the EFI capsules through binman. Make changes in the EFI capsule update testing feature to generate capsules through binman. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2023-08-29binman: capsule: Add support for generating EFI capsulesSughosh Ganu11-0/+498
Add support in binman for generating EFI capsules. The capsule parameters can be specified through the capsule binman entry. Also add test cases in binman for testing capsule generation. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29btool: mkeficapsule: Add a bintool for EFI capsule generationSughosh Ganu1-0/+101
Add a bintool for generating EFI capsules. This calls the mkeficapsule tool which generates the capsules. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29sandbox: capsule: Enable EFI capsule module on sandbox variantsSughosh Ganu3-0/+6
Enable the EFI capsule update code on all sandbox variants. This was already enabled on the sandbox, sandbox64 and sandbox_flattree variants. The rest of the variants also have the EFI capsule update module enabled now. With this commit, the mkeficapsule tool also gets enabled on all variants. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29sandbox: capsule: Add keys and certificates needed for capsule update testingSughosh Ganu5-0/+94
Add the private keys and public key certificates which are to be used for capsule authentication while testing the EFI capsule update functionality. There are two pairs of private and public keys, good and bad. The good key pair will be used for signing capsules, whilst the bad key pair is to be used as malicious keys for testing authentication failure cases. The capsule_pub_key_good.crt is also converted to an EFI Signature List(ESL) file, SIGNER.esl, which is embedded in the platform's device-tree for capsule authentication. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29nuvoton: npcm845-evb: Add a newline at the end of fileSughosh Ganu1-1/+1
Add a newline at the end of the dts, without which the build fails when including a dtsi file. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2023-08-29binman: bintool: Build a tool from a list of commandsSughosh Ganu1-8/+11
Add support to build a tool from source with a list of commands. This is useful when a tool can be built with multiple commands instead of a single command. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2023-08-29ARM: dts: at91: sam9x60-curiosity: Sync gpio button from LinuxAlexander Dahl1-0/+20
Copied as is from Linux Kernel release v6.4. (dts file is still the same in Linux v6.5-rc7 but was moved to vendor sub-directories with v6.5-rc1.) Button works out of the box now if the following config options are enabled: CONFIG_BUTTON, CONFIG_BUTTON_GPIO, CONFIG_CMD_BUTTON, CONFIG_DM_GPIO. Signed-off-by: Alexander Dahl <ada@thorsis.com>
2023-08-29board: sam9x60-curiosity: Let LED subsystem init leds if enabledAlexander Dahl2-0/+36
If CONFIG_LED and CONFIG_LED_GPIO are enabled, it is not necessary to initialize the RGB LED on the board by manually setting hardcoded GPIOs anymore. Everything is well defined in dts and can be used like on boards of other vendors. Keep the old behaviour as fallback, though. With all this in place enabling CONFIG_CMD_LED gives us a working 'led' command on the U-Boot shell. Signed-off-by: Alexander Dahl <ada@thorsis.com>
2023-08-29ARM: dts: at91: sam9x60-curiosity: Sync LED nodes from LinuxAlexander Dahl1-0/+30
Copied as is from Linux Kernel release v6.4. (dts file is still the same in Linux v6.5-rc7 but was moved to vendor sub-directories with v6.5-rc1.) Signed-off-by: Alexander Dahl <ada@thorsis.com>
2023-08-29configs: at91: sam9x60: Switch to new reset driverAlexander Dahl5-0/+10
Since commit 61040097a9d1 ("reset: at91: Add reset driver for basic assert/deassert operations") the compatible "microchip,sam9x60-rstc" for the sam9x60 reset controller in sam9x60.dtsi is not handled by CONFIG_SYSRESET_AT91 anymore, but by CONFIG_RESET_AT91 now. This resulted in the following error message, when trying to reset from U-Boot shell: U-Boot> reset resetting ... System reset not supported on this platform ### ERROR ### Please RESET the board ### Fixed by enabling the new driver in the relevant defconfigs. Tested on sam9x60-curiosity board. Defconfigs for sam9x60ek adapted in the same way, but without testing. These should be all sam9x60 boards affected in U-Boot here. Signed-off-by: Alexander Dahl <ada@thorsis.com>
2023-08-29configs: at91: sam9x60_curiosity: Sync both defconfig variantsAlexander Dahl1-1/+14
The board has two SD card slots and we have two defconfigs for booting from either the first (micro SD) named 'sam9x60_curiosity_mmc_defconfig' or the second (full size SD) named 'sam9x60_curiosity_mmc1_defconfig'. For comparable Microchip boards (sama5d27-som1-ek, sama5d29-curiosity, sama7g5ek) with two card slots the defconfigs only differ in BOOTARGS, BOOTCOMMAND, and ENV_FAT_DEVICE_AND_PART and the same should be the case for sam9x60_curiosity. Here the 'mmc1' config has more options enabled to support the raw NAND flash populated on the board, so the 'mmc' config (for mmc0) was adapted by enabling additional options, instead of removing options from mmc1. The 'mem=128M' argument can be dropped from kernel command line, because it is redundant to memory node in dts in both Linux and U-Boot: memory@20000000 { reg = <0x20000000 0x8000000>; }; Signed-off-by: Alexander Dahl <ada@thorsis.com>
2023-08-26Merge branch ↵Tom Rini31-650/+1024
'2023-08-26-bootstd-chromeos-impreovements-and-move-to-gcc-13.2' into next First, update CI to using gcc-13.2 from 13.1, and rebuild the CI containers. This is needed because the second part adds utilities for tests and provides, to quote the author: This updates the ChromiumOS bootmeth to detect multiple kernel partitions on a disk. It also includes minor code improvements to the partition drivers, including accessors for the optional fields. This series also includes some other related tweaks in testing.
2023-08-26CI: Move to latest Ubuntu "Jammy" tagTom Rini3-3/+3
Move to the latest "Jammy" tag from Ubuntu. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-26CI: Update to gcc-13.2.0Tom Rini4-32/+32
The latest kernel.org toolchains for gcc are now 13.2.0, so upgrade to that. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-26CI: Add ChromiumOS utilitiesSimon Glass1-0/+3
We need cgpt and futility for building test images. Add them. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-26bootstd: cros: Allow detection of any kernel partitionSimon Glass3-20/+36
The existing ChromiumOS bootmeth only supports reading a single kernel partition, either 2 or 4. In fact there are normally two options available. Use the GUID to detect kernel partitions, with the BOOTMETHF_ANY_PART flag, so that bootstd does not require a valid filesystem before calling the bootmeth. Tidy up and improve the logging while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Suggested-by: Alper Nebi Yasak <alpernebiyasak@gmail.com> [trini: Add missing select of PARTITION_TYPE_GUID] Signed-off-by: Tom Rini <trini@konsulko.com>
2023-08-25uuid: Add ChromiumOS partition typesSimon Glass2-0/+21
Add some GUIDs for ChromiumOS so we can detect the partitions. Signed-off-by: Simon Glass <sjg@chromium.org>
2023-08-25bootstd: Support bootmeths which can scan any partitionSimon Glass3-8/+23
Some bootmeths support scanning a partition without a filesystem on it. Add a flag to support this. This will allow the ChromiumOS bootmeth to find kernel partition, which are stored in a special format, without a filesystem. Signed-off-by: Simon Glass <sjg@chromium.org>