summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)AuthorFilesLines
2024-10-03Update the ARM trusted firmware git URLPeter Robinson1-1/+1
The primary upstream URL for tf-a has moved, in some cases things like tags are not always pushed to the old URL so update the URLs to the primary upstream project URL. Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
2024-09-05android_ab: Fixes: Fix backup offset calculationJoshua Watt1-1/+2
The backup offset is in bytes, but was incorrectly be interpreted as blocks, leading to it being written to the wrong location. Fix the calculation, clarify that ANDROID_AB_BACKUP_OFFSET is in bytes and must be a multiple of the block size, and add a runtime check to validate the offset. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Fixes: 3430f24bc69d ("android_ab: Try backup booloader_message") Link: https://lore.kernel.org/r/20240828143924.3987331-1-JPEWhacker@gmail.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-08-28bootstage: Fix unstash of records from SPLJonas Karlman1-1/+1
The commit b81e31a1e6c5 ("bootstash: Do not provide a default address for all") changed a bootstage unstash call to bootstage stash, this has resulted in bootstage records stashed in SPL no longer get unstaged in U-Boot proper. Fix this by changing back to a unstage call. Fixes: b81e31a1e6c5 ("bootstash: Do not provide a default address for all") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-08-13spl: binman: Disable u_boot_any symbols for i.MX 8ULP boardsGary Bisson3-3/+3
This is extending commit da96f93cda9 ("spl: binman: Disable u_boot_any symbols for i.MX93 boards") to i.MX 8ULP boards. Signed-off-by: Gary Bisson <bisson.gary@gmail.com> Reviewed-by: Peng Fan <peng.fan@nxp.com>
2024-07-31sandbox: Increase cyclic CPU-time limitSimon Glass1-0/+1
Now that sandbox is using cyclic for video, it trips the 1us time limit. Updating the sandbox display often takes 20ms or more. Increase the limit to 100ms to avoid a warning. Signed-off-by: Simon Glass <sjg@chromium.org>
2024-07-31cyclic: Add a symbol for SPLSimon Glass2-1/+9
The cyclic subsystem is currently enabled either in all build phases or none. For tools this should not be enabled, but since lib/shc256.c and other files include watchdog.h in the host build, we must make sure that it is not enabled there. Add an SPL symbol so that there is more control of this. Add an include into cyclic.h so that tools can include this file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Reviewed-by: Stefan Roese <sr@denx.de>
2024-07-23arm: ti: Remove omap4 platform supportTom Rini1-2/+2
There are no longer any OMAP4 platforms in U-Boot, remove the related functionality. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-19bootstash: Do not provide a default address for allTom Rini2-4/+3
A valid memory location to stash bootstage information at will be architecture dependent. Move the existing defaults to the main Kconfig file for this option and set 0x0 as the default only for sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-18bloblist: fix bloblist convention check.Levi Yun1-1/+10
According to recently firmware handsoff spec [1]'s "Register usage at handoff boundary", Transfer List's signature value was changed from 0x40_b10b (3 bytes) to 4a0f_b10b (4 bytes). As updating of TL's signature, register value of x1/r1 should be: In aarch32's r1 value should be R1[23:0]: set to the TL signature (4a0f_b10b -> masked range value: 0f_b10b) R1[31:24]: version of the register convention == 1 and In aarch64's x1 value should be X1[31:0]: set to the TL signature (4a0f_b10b) X1[39:32]: version of the register convention == 1 X1[63:40]: MBZ (See the [2] and [3]). This patch fix problems: 1. breaking X1 value with updated specification in aarch64 - change of length of signature field. 2. previous error value set in R1 in arm32. - length of signature should be 24, but it uses 32bit signature. This patch is a breaking change. It works only TF-A is updated. Link: https://github.com/FirmwareHandoff/firmware_handoff [1] Link: https://github.com/FirmwareHandoff/firmware_handoff/issues/32 [2] Link: https://github.com/FirmwareHandoff/firmware_handoff/commit/5aa7aa1d3a1db75213e458d392b751f0707de027 [3] Signed-off-by: Levi Yun <yeoreum.yun@arm.com> Reviewed-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-15common: Remove duplicate newlinesMarek Vasut13-135/+0
Drop all duplicate newlines. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-12Merge patch series "Add Turris 1.x board"Tom Rini1-1/+7
Marek Mojík <marek.mojik@nic.cz> says: Hello all, this is a continuation of previous work by Pali to add support for the Turris 1.x board. As the patches were based on u-boot v2022.04, a nontrivial rebasing was needed. Some notes: - Some options that are in SD defconfig are disabled in NOR defconfig because over the years u-boot grew and the old NOR defconfig will not fit into NOR memory. - SD boot with RAM larger than 2GB will only allocate 2GB of RAM (We were not able to fix this yet)
2024-07-12board_f: Add support for CONFIG_OF_BOARD_FIXUP for XIP imagesPali Rohár1-1/+7
When U-Boot is running from flash memory (execute in place) then gd->fdt_blob before relocation points to read-only flash memory. So U-Boot calls board_fix_fdt() with read-only gd->fdt_blob pointer which cause immediate CPU crash when callback is trying to modify gd->fdt_blob. Fix this issue by introducing a new config option OF_INITIAL_DTB_READONLY which moves fix_fdt callback after the reloc_fdt callback. This makes CONFIG_OF_BOARD_FIXUP working also if U-Boot before relocation is not running from read/write (S)RAM memory. This is required for mpc85xx boards when booting from flash NOR. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Mojík <marek.mojik@nic.cz> Reviewed-by: Marek Behún <kabel@kernel.org>
2024-07-06usb: Assimilate usb_get_descriptor() to linuxPhilip Oberfichtner1-7/+30
Before this commit, usb_get_descriptor() failed for some flakey USB devices. We hereby adopt the more robust linux implementation [1]. For instance, for the "Alcor Micro Corp. Flash Drive" (VID 0x058f, PID 0x6387), the following behavior occurs from time to time: => usb start starting USB... Bus xhci_pci: Register 10000840 NbrPorts 16 Starting the controller USB XHCI 1.20 scanning bus xhci_pci for devices... usb_new_device: Cannot read configuration, skipping device 058f:6387 Signed-off-by: Philip Oberfichtner <pro@denx.de> Reviewed-by: Marek Vasut <marex@denx.de> [1] From a38297e3fb012 (Linux 6.9), see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/usb/core/message.c?h=v6.9#n781
2024-07-03global_data.h: drop write-only field dm_root_fRasmus Villemoes1-2/+1
The dm_root_f field seems to be entirely write-only and hence redundant, unless 'git grep' fails to find some access generated via preprocessor token concatenation or similar. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-01Merge branch 'next'Tom Rini83-129/+87
2024-06-30spl: correct link to FIT specificationHeinrich Schuchardt1-1/+1
Replace the invalid link to the FIT file format specification. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-06-28spl: Allow ATF to work when dcache is disabledSimon Glass1-1/+2
The dcache may not be enabled in SPL. Add a check to avoid trying to use an undefined function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2024-06-24Merge tag 'v2024.07-rc5' into nextTom Rini1-1/+1
Prepare v2024.07-rc5
2024-06-18cyclic: Rise default CYCLIC_MAX_CPU_TIME_US to 5000Jiaxun Yang1-1/+1
The default value CYCLIC_MAX_CPU_TIME_US was 1000, which is a little bit too low for slower hardware and sandbox. On my MIPS Boston FPGA board with interaptiv CPU, wdt_cyclic can easily take 3200 us to run. On azure pipeline sandbox_clang, wdt_cyclic some times goes beyond 1300 us. Raise default value to 5000, which is the value already taken by octeon_nic32. This is still sufficent to maintain system responsiveness. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Stefan Roese <sr@denx.de>
2024-06-17Merge tag 'xilinx-for-v2024.10-rc1' of ↵Tom Rini2-0/+10
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next AMD/Xilinx changes for v2024.10-rc1 common: - spl: Introduce SoC specific init function xilinx: - Enable FF-A and NVMEM - Rename spl_board_init() to spl_soc_init() zynqmp: - DT alignments - Enable reset from SPL - Enable USB3 for KD240 - Align multiboot register on Kria for proper reboot - Allow multiboot environment write even in saved environment - Move zynqmp commands from board/ to arch/ - Clean up xilinx_zynqmp.h versal: - Do not prioritize boot device if driver is not enabled versal-net: - Setup location for redundant variables in SPI versal2: - Add support for new SOC mmc: - Fix tap delay for SD on Versal NET spi: - Add SPI_NOR_OCTAL_READ flag for mx66uw2g345gx0 flash part gpio: - Cover MODEPIN firmware dependency
2024-06-17spl: Introduce SoC specific init functionLukas Funke2-0/+10
Some architectures use spl_board_init() in their SoC specific implementation. Board developers should be able to add board specific implementation via spl_board_init(). Hence, introduce a spl_soc_init() method which is called right before spl_board_init() for SoC specific implementation. Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com> Reviewed-by: Devarsh Thakkar <devarsht@ti.com> Link: https://lore.kernel.org/r/20240327121153.2455126-2-lukas.funke-oss@weidmueller.com Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-06-16Merge branch 'next' of ↵Tom Rini1-18/+6
https://source.denx.de/u-boot/custodians/u-boot-watchdog into next - misc cyclic infrastructure improvements (Rasmus) - watchdog_reset cleanup (Rasmus) CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=369&view=results
2024-06-16cyclic: make clients embed a struct cyclic_info in their own data structureRasmus Villemoes1-17/+5
There are of course not a whole lot of examples in-tree yet, but before they appear, let's make this API change: Instead of separately allocating a 'struct cyclic_info', make the users embed such an instance in their own structure, and make the convention that the callback simply receives the 'struct cyclic_info *', from which the clients can get their own data using the container_of() macro. This has a number of advantages. First, it means cyclic_register() simply cannot fail, simplifying the code. The necessary storage will simply be allocated automatically when the client's own structure is allocated (often via uclass_priv_auto or similar). Second, code for which CONFIG_CYCLIC is just an option can more easily be written without #ifdefs, if we just provide an empty struct cyclic_info {}. For example, the nested CONFIG_IS_ENABLED()s in https://lore.kernel.org/u-boot/20240316201416.211480-1-marek.vasut+renesas@mailbox.org/ are mostly due to the existence of the 'struct cyclic_info *' member being guarded by #ifdef CONFIG_CYCLIC. And we do probably want to avoid the extra memory overhead of that member when !CONFIG_CYCLIC. But that is automatic if, instead of a 'struct cyclic_info *', one simply embeds a 'struct cyclic_info', which will have size 0 when !CONFIG_CYCLIC. Also, the no-op cyclic_register() function can just unconditionally be called, and the compiler will see that (1) the callback is referenced, so not emit a warning for a maybe-unused function and (2) see that it can actually never be reached, so not emit any code for it. Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-06-16cyclic: stop strdup'ing name in cyclic_register()Rasmus Villemoes1-1/+1
We are not checking the return value of strdup(), nor freeing the string in cyclic_unregister(). However, all current users either pass a string literal or the dev->name of the client device. So in all cases the name string will live at least as long as the cyclic_info is registered, so just make that a requirement. Reviewed-by: Stefan Roese <sr@denx.de> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-06-14Merge patch series "efi_loader: select BLK not depends on BLK"Tom Rini1-1/+1
Tom Rini <trini@konsulko.com> says: Rework how the BLK symbol is used now that so much DM migration has been completed.
2024-06-14spl: nvme: Make this depend on SPL_BLKTom Rini1-1/+1
As this is an SPL related driver, and in SPL enabling SPL_BLK is optional, make this depend on the correct symbol. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-06-13spl: Kconfig: ARCH_K3: Set default SPL_STACK_R_MALLOC_SIMPLE_LEN for R5 buildVignesh Raghavendra1-0/+1
All ARCH_K3 platforms need about of 2MB of malloc space post reallocation. Since, this space is allocated from SDRAM, provide a generous 2MB space by default. Platforms requiring more than 2MB can override in defconfig as needed. Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com> Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
2024-06-07Merge patch series "'eeprom' command improvements"Tom Rini2-21/+37
Marek Behún <kabel@kernel.org> says: This series contains improvements for the 'eeprom' command: - refactors - fixes - improvements - ability to use driver model EEPROMs (uclass UCLASS_I2C_EEPROM) - more flexible EEPROM layout support It should not cause any behavior change for any existing board. This series is a dependency for some DDR issue fixes for Turris Omnia. I will be sending that one separately. github PR link (with CI): https://github.com/u-boot/u-boot/pull/540 - there is a failure for test.py for sandbox sandbox_clang but it seems unrelated to these changes
2024-06-07common: eeprom_field: Drop unnecessary comparisonMarek Behún1-1/+1
The byte variable is of type unsigned char, it is never less than zero. The error case is handled by *endptr, so drop the comparison altogether. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-06-07common: eeprom_field: Fix updating binary fieldMarek Behún1-1/+1
The __eeprom_field_update_bin() function is expected to parse a hex string into bytes (potentially in reverse order), but the simple_strtoul() function is given 0 as base. This does not work since the string does not contain '0x' prefix. Add explicit base 16. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-06-07common: eeprom_layout: Split field finding code from the field update functionMarek Behún1-15/+31
Split the eeprom layout field finding code from the eeprom_layout_update_field() function in order to make it usable in alternative implementations of update method. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-06-07common: eeprom_layout: Assign default layout methods and parameters before ↵Marek Behún1-4/+4
specific ones Assign the default eeprom layout parameter .data_size and methods .print() and .update() before calling eeprom_layout_assign() in eeprom_layout_setup(). This allows eeprom_layout_assign() to overwrite these if needed. Signed-off-by: Marek Behún <kabel@kernel.org>
2024-05-22include: Move snprintf to stdio.hRaymond Mao1-1/+1
Move snprintf to stdio.h since it is needed by exteranl libraries. Signed-off-by: Raymond Mao <raymond.mao@linaro.org> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini80-87/+30
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini80-30/+87
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06global: Make <asm/global_data.h> include <asm/u-boot.h>Tom Rini8-8/+0
This follows the example of RISC-V where <asm/global_data.h> includes <asm/u-boot.h> directly as "gd" includes a reference to bd_info already and so the first must include the second anyhow. We then remove <asm/u-boot.h> from all of the places which include references to "gd" an so have <asm/global_data.h> already. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-05-06common: Remove <common.h> and add needed includesTom Rini80-80/+31
Remove <common.h> from all "commmon/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
2024-04-21rockchip: Enable preconsole for rk3328Jagan Teki1-1/+1
Enable and set the start address of pre-console buffer for RK3328. Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
2024-04-14Merge https://source.denx.de/u-boot/custodians/u-boot-usbTom Rini2-3/+126
2024-04-12Merge patch series "mcheck implementation for U-Boot"Tom Rini3-25/+437
Eugene Uriev <eugeneuriev@gmail.com> says: There was no "mcheck" for U-Boot before. Since U-Boot has only 1 thread, and normally makes 4000+ - 6000+ mallocs, it's better to use havier canaries to protect heap-chunks. My variant uses 2x8 = 16byte-long protector. And the multiplier could be changed to tune speed/protection tradeoff. This protects not only against memset()-s, but against "near" wild pointers too, and makes more probable to catch "distant" ones. The core file of the set is included into the C-file, not complied separately in order to enable (potential) coexisting of mcheck-protectors, e.g. malloc_simple(.) and dlmalloc simultaneously. My tests were for ARM SoC, 64bit, so the patch is aware of alignment. Primary this patch is for using by developers: to verify, if a change doesn't break the heap integrity. By default the mcheck is disabled and wouldn't affect the boot. I used pedantic mode, canary=16byte, registry-size=6608. For my system the overhead was 230ms.
2024-04-12mcheck: let mcheck_abortfunc_t print the pointerEugene Uriev1-8/+8
Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: add stats, add a comment with test resultsEugene Uriev1-1/+17
My tests have been run on an U-Boot (of older version) for ARM (64bits). Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: introduce mcheck_on_ramrelocation(.)Eugene Uriev2-0/+15
The using of pre-reloc/malloc_simple heap is too hard to follow after the relocation. So lets drop it from the pedantic registry and switch to dlmalloc, when moved. The offset is ignored, but kept in the API for the probable case, when that early heap is relocated too. Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: add pedantic mode supportEugene Uriev2-0/+53
The pedantic mode is run-time contolled, so appropriate registry take place everytime. Maybe it's worth to use compile-time control only. So, the registry could be optimized out by an #ifdef. Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: support memalignEugene Uriev2-3/+24
Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: integrate mcheck into dlmalloc.cEugene Uriev1-0/+67
This changes are probable worth to be generalized in a separate .h-file so, making it able to cover libc-mallocs and others, without too much copy-paste. But the malloc<=>mALLOc substitutions interfere with an elegant way to do this. Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: introduce essentials of mcheckEugene Uriev1-0/+220
The core part of mcheck, but without memalign. memalign - to be added in ensuing commits. Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: Use memset/memcpy instead of MALLOC_ZERO/MALLOC_COPY for mcheck.Eugene Uriev1-0/+4
These fast helpers sometimes breach mem-chunk boundaries. Thus they trigger mcheck alarm. Standard ones are accurate though. Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12mcheck: prepare +1 tier for mcheck-wrappers, in dl-*alloc commandsEugene Uriev1-25/+41
Signed-off-by: Eugene Uriev <eugeneuriev@gmail.com>
2024-04-12cli: always show cursorHeinrich Schuchardt1-0/+4
We may enter the command line interface in a state where on the remote console the cursor is not shown. Send an escape sequence to enable it. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>