summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2023-09-09spl: undefined return value in spl_blk_load_imageHeinrich Schuchardt
spl_blk_load_image() should not return an uninitialized value if blk_get_devnum_by_uclass_id() fails. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Reported-by: Xavier Drudis Ferran <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Xavier Drudis Ferran <[email protected]>
2023-09-05spl: add __noreturn attribute to spl_invoke_opensbi functionChanho Park
spl_invoke_opensbi function is not returned to SPL. Thus, we need to set __noreturn function attribute. Signed-off-by: Chanho Park <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2023-09-05dlmalloc: Add support for SPL_SYS_MALLOC_CLEAR_ON_INITShengyu Qu
To support SPL_SYS_MALLOC_CLEAR_ON_INIT, we have to modify #ifdef CONFIG_SYS_MALLOC_CLEAR_ON_INIT to #if CONFIG_IS_ENABLED(SYS_MALLOC_CLEAR_ON_INIT) Signed-off-by: Bo Gan <[email protected]> Signed-off-by: Shengyu Qu <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-09-04Merge tag 'v2023.10-rc4' into nextTom Rini
Prepare v2023.10-rc4
2023-08-31event: Use an event to replace last_stage_init()Simon Glass
Add a new event which handles this function. Convert existing use of the function to use the new event instead. Make sure that EVENT is enabled by affected boards, by selecting it from the LAST_STAGE_INIT option. For x86, enable it by default since all boards need it. For controlcenterdc, inline the get_tpm() function and make sure the event is not built in SPL. Signed-off-by: Simon Glass <[email protected]>
2023-08-31freescale: Drop call to init_func_vid() in the init sequenceSimon Glass
Use the misc_init_f event instead, which is designed for this purpose. All boards with CONFIG_VID already enable CONFIG_EVENT. Signed-off-by: Simon Glass <[email protected]>
2023-08-31x86: Convert arch_fsp_init() to use eventsSimon Glass
Convert this to use events instead of calling a function directly in the init sequence. Rename it to arch_fsp_init_f() to distinguish it from the one that happens after relocation. For FSPv2 nothing needs to be done here, so drop the empty function. Signed-off-by: Simon Glass <[email protected]>
2023-08-31initcall: Support manual relocationSimon Glass
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 <[email protected]>
2023-08-31initcall: Support emitting eventsSimon Glass
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 <[email protected]>
2023-08-31event: Export event_type_name()Simon Glass
Export this function so it can be used with initcall debugging. Signed-off-by: Simon Glass <[email protected]>
2023-08-31Revert "initcall: Move to inline function"Simon Glass
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 <[email protected]>
2023-08-31event: Support a simple spy recordSimon Glass
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 <[email protected]>
2023-08-22common: bouncebuf: Add missing cast to dma_addr_tMarek Vasut
Fix the following warning produced on qemu-x86_64_defconfig: " common/bouncebuf.c: In function ‘bounce_buffer_stop’: common/bouncebuf.c:82:34: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 82 | dma_unmap_single((dma_addr_t)state->bounce_buffer, | ^ " The warning is valid, the pointer has to be up-cast first. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Andrew Davis <[email protected]>
2023-08-22dm: event: add EVT_DM_POST_INIT_R event typeChanho Park
This patch introduces EVT_DM_POST_INIT_R event type for handling hooks after relocation. Fixes: 55171aedda88 ("dm: Emit the arch_cpu_init_dm() even only before relocation") Suggested-by: Simon Glass <[email protected]> Cc: Bin Meng <[email protected]> Signed-off-by: Chanho Park <[email protected]> Tested-by: Milan P. Stanić <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Roland Ruckerbauer <[email protected]> Tested-by: Roland Ruckerbauer <[email protected]> Fixed missing event name in event.c: Signed-off-by: Simon Glass <[email protected]>
2023-08-21Merge tag 'v2023.10-rc3' into nextTom Rini
Prepare v2023.10-rc3 Signed-off-by: Tom Rini <[email protected]>
2023-08-19spl: don't assume NVMe partition 1 existsHeinrich Schuchardt
There is no requirement that a partition 1 exists in a partition table. We should not try to retrieve information about it. We should not even try reading with partition number CONFIG_SYS_NVME_BOOT_PARTITION here as this is done in the fs_set_blk_dev() call anyway. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-08-17spl: mmc: Fix check of CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORElena Popa
When Falcon Mode is enabled, SPL needs to check the value of CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR. Unfortunately, it was using the CONFIG_VAL(SYS_MMCSD_RAW_MODE_ARGS_SECTOR) which converts it into CONFIG_SPL_SYS_MMCSD_RAW_MODE_ARGS_SECTOR when CONFIG_SPL_BUILD is enabled. CONFIG_SPL_SYS_MMCSD_RAW_MODE_ARGS_SECTOR does not exist in common/spl/Kconfig. Replaced with defined(CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR). Signed-off-by: Elena Popa <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-08-15common: return type board_get_usable_ram_topHeinrich Schuchardt
board_get_usable_ram_top() returns a physical address that is stored in gd->ram_top. The return type of the function should be phys_addr_t like the current type of gd->ram_top. Signed-off-by: Heinrich Schuchardt <[email protected]>
2023-08-14spl: add FIT support to semihosting boot methodHeinrich Schuchardt
Allow loading a FIT image via semihosting in SPL. Signed-off-by: Heinrich Schuchardt <[email protected]>
2023-08-10riscv: Add SPL_ZERO_MEM_BEFORE_USE implementationShengyu Qu
Add the actual support code for SPL_ZERO_MEM_BEFORE_USE and remove existing Starfive JH7110's L2 LIM clean code, since existing code has following issues: 1. Each hart (in the middle of a function call) overwriting its own stack and other harts' stacks. (data-race and data-corruption) 2. Lottery winner hart can be doing "board_init_f_init_reserve", while other harts are in the middle of zeroing L2 LIM. (data-race) Signed-off-by: Bo Gan <[email protected]> Signed-off-by: Shengyu Qu <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]>
2023-08-09video: Add a Kconfig option for SPL video handoffSimon Glass
At present this feature is enabled in SPL if a bloblist is available. Some platforms may not want to use this, so add an option to allow the feature to be disabled. Note that the feature unfortunately only fills in part of the video-handoff information, so causes failures on x86 platforms. For now, disable it there. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Bin Meng <[email protected]> # qemu-x86_64
2023-08-09bootstd: Rename bootdev_setup_sibling_blk()Simon Glass
This name is a little confusing since it suggests that it sets up the sibling block device. In fact it sets up a bootdev for it. Rename the function to make this clearer. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-08-09treewide: unify the linker symbol reference formatShiji Yang
Now all linker symbols are declared as type char[]. Though we can reference the address via both the array name 'var' and its address '&var'. It's better to unify them to avoid confusing developers. This patch converts all '&var' linker symbol refrences to the most commonly used format 'var'. Signed-off-by: Shiji Yang <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-08-09Kconfigs: Correct default of "0" on hex type entriesTom Rini
It is not a parse error to have a default value of "0" for a "hex" type entry, instead of "0x0". However, "0" and "0x0" are not treated the same even by the tools themselves. Correct this by changing the default value from "0" to "0x0" for all hex type questions that had the incorrect default. Fix one instance (in two configs) of a default of "0" being used on a hex question to be "0x0". Remove the cases where a defconfig had set a value of "0x0" to be used as the default had been "0". Signed-off-by: Tom Rini <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-08-08board_f: Cosmetic style fixBin Meng
Some coding convention fixes for print_resetinfo(). Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-08-08crc32: Drop duplicates crc header includesIlya Lukin
Fixes: 3db711085752 ("crc32: Use the crc.h header for crc functions") Signed-off-by: Ilya Lukin <[email protected]>
2023-08-07common: Drop duplicate space in SPL_BMP descriptionMarek Vasut
Drop duplicate space in Kconfig symbol description. Signed-off-by: Marek Vasut <[email protected]>
2023-08-07common: fix detection of SYS_MALLOC_F_LEN=0x0Heinrich Schuchardt
CONFIG_$(SPL_TPL_)SYS_MALLOC_F_LEN is defined as hex. If set to zero manually, .config contains '0x0' and not '0' as value. The default value for CONFIG_SPL_SYS_MALLOC_F_LEN should not be set to 0 but to 0x0 if CONFIG_SPL_FRAMEWORK=n to match a manually set value. Fixes: c0126bd862a0 ("spl: Support bootstage, log, hash and early malloc in TPL") Fixes: b61694705217 ("SPL: Do not enable SPL_SYS_MALLOC_SIMPLE without SPL_FRAMEWORK by default") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-08-07spl: move SPL_CRC32 option to lib/KconfigOleksandr Suvorov
All SPL hash algorithm options are collected in lib/Kconfig. Move SPL_CRC32 there as well. Signed-off-by: Oleksandr Suvorov <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-08-07spl: remove duplicate SPL_MD5 optionOleksandr Suvorov
There is another SPL_MD5 option defined in lib/Kconfig. Renaming SPL_MD5_SUPPORT introduced duplicate option with different description. As for now FIT and hash algorithm options are not related to each others, removing a duplicate option seems OK. Fixes: 4b00fd1a84c ("Kconfig: Rename SPL_MD5_SUPPORT to SPL_MD5") Signed-off-by: Oleksandr Suvorov <[email protected]>
2023-08-07bloblist: Enforce CRC32Tom Rini
In the common bloblist code we call crc32 to get a checksum for the data. Ensure we will have the CRC32 code via select. Signed-off-by: Tom Rini <[email protected]>
2023-08-05event: Fix a wrong type_name from dm_post_init to dm_post_init_fJaehoon Chung
DM_POST_INIT was changed to DM_POST_INIT_F. To debug correct message, change type_name from dm_post_init to dm_post_init_f. Signed-off-by: Jaehoon Chung <[email protected]> Reviewed-by: Simon Glass <[email protected]> s/an/a/ : Signed-off-by: Simon Glass <[email protected]>
2023-08-02console: Print out complete stdio device listBin Meng
At present if both CONSOLE_MUX and SYS_CONSOLE_IS_IN_ENV are on, during boot, the printed out stdio devices are incomplete, e.g.: with "stdout=serial,vidconsole", only "vidconsole" is printed. For such case, we can print out the stdio device name from the environment variables. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-08-02console: Refactor stdio_print_current_devices() a little bitBin Meng
In preparation to future changes, refactor this routine a little bit. Signed-off-by: Bin Meng <[email protected]>
2023-08-02console: Make stdio_print_current_devices() staticBin Meng
As it is only called in common/console.c Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Simon Glass <[email protected]> # qemu-x86_64
2023-08-02console: kconfig: Drop the redundant VIDEO dependencyBin Meng
The VIDEO dependency is described twice in CONSOLE_MUX. Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-30spl: initialize PCI before bootingHeinrich Schuchardt
MMC, SATA, and USB may be using PCI based controllers. Initialize the PCI sub-system before trying to boot. Remove the initialization for NVMe that is now redundant. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Mayuresh Chitale <[email protected]>
2023-07-30spl: blk: partition numbers are hexadecimalHeinrich Schuchardt
Loading u-boot.itb from device 0x00, partition 0x0f fails with: Trying to boot from NVME Device 0: Vendor: 0x4x Rev: 8.0.50 Prod: nvme-1 Type: Hard Disk Capacity: 3814.6 MB = 3.7 GB (7812500 x 512) ** Invalid partition 21 ** Couldn't find partition nvme 0:15 Like the command line interface fs_det_blk_dev() expects that the device number and the partition number are hexadecimal. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Mayuresh Chitale <[email protected]>
2023-07-30spl: blk: use CONFIG_SPL_FS_LOAD_PAYLOAD_NAMEHeinrich Schuchardt
We should target to unify the code for different block devices in SPL to reduce code size. MMC, USB, SATA, and Semihosting use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME to indicate the filename to load. NVMe uses CONFIG_SPL_PAYLOAD in spl_blk_load_image(). CONFIG_SPL_PAYLOAD is meant to define which binary to integrate into u-boot-with-spl.bin. See commit 7550dbe38b3f ("spl: Add option SPL_PAYLOAD"). Change spl_blk_load_image() to use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME. Fixes: 8ce6a2e17577 ("spl: blk: Support loading images from fs") Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Mayuresh Chitale <[email protected]>
2023-07-21common: Kconfig: Fix CMD_BMP/BMP dependencySamuel Dionne-Riel
Using `default y` will not select BMP when CMD_BMP has been enabled, if it was already configured. By using `select`, if `CMD_BMP` is turned on, it will force the presence of `BMP`. Fixes: 072b0e16c4 ("common: Kconfig: Add BMP configs") Signed-off-by: Samuel Dionne-Riel <[email protected]> Signed-off-by: Nikhil M Jain <[email protected]>
2023-07-21common: spl: spl: Remove video driverNikhil M Jain
Use config SPL_VIDEO_REMOVE to remove video driver at SPL stage before jumping to next stage, in place of CONFIG_SPL_VIDEO, to allow user to remove video if required. Signed-off-by: Nikhil M Jain <[email protected]> Reviewed-by: Devarsh Thakkar <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-21common: board_f: Pass frame buffer info from SPL to u-bootNikhil M Jain
U-boot proper can use frame buffer address passed from SPL to reserve the memory area used by framebuffer set in SPL so that splash image set in SPL continues to get displayed while u-boot proper is running. Put the framebuffer address and size in a bloblist to make them available at u-boot proper, if in u-boot proper CONFIG_VIDEO is defined. Signed-off-by: Nikhil M Jain <[email protected]> Reviewed-by: Devarsh Thakkar <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-21common: spl: spl: Update stack pointer addressNikhil M Jain
At SPL stage when stack is relocated, the stack pointer needs to be updated, the stack pointer may point to stack in on chip memory even though stack is relocated. Signed-off-by: Nikhil M Jain <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-07-21common: splash_source: Fix type casting errorsNikhil M Jain
During compilation splash_source puts out below warning for type conversion in splash_load_fit for bmp_load_addr and fit_header. Change their type to uintptr_t to fix the warnings. common/splash_source.c: In function ‘splash_load_fit’: common/splash_source.c:366:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 366 | img_header = (struct legacy_img_hdr *)bmp_load_addr; | ^ common/splash_source.c:376:49: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] 376 | res = splash_storage_read_raw(location, (u32)fit_header, fit_size); | ^ common/splash_source.c:401:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 401 | memmove((void *)bmp_load_addr, internal_splash_data, internal_splash_size); The above warnings are generated if CONFIG_FIT is enabled. Signed-off-by: Nikhil M Jain <[email protected]>
2023-07-21event: Add fpga load eventChristian Taedcke
This enables implementing custom logic after a bitstream was loaded into the fpga. Signed-off-by: Christian Taedcke <[email protected]> Reviewed-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
2023-07-21arm64: zynqmp: Switch to amd.com emailsMichal Simek
Update my and DPs email address to match current setup. Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/aba5b19b9c5a95608829e86ad5cc4671c940f1bb.1688992543.git.michal.simek@amd.com
2023-07-17android_ab: Try backup booloader_messageJoshua Watt
Some devices keep 2 copies of the bootloader_message in the misc partition and write each in sequence when updating. This ensures that there is always one valid copy of the bootloader_message. Teach u-boot to optionally try a backup bootloader_message from a specified offset if the primary one fails its CRC check. Signed-off-by: Joshua Watt <[email protected]>
2023-07-17log: Support outputing function names in SPLSimon Glass
The output is garbled when tiny printf() is used. Correct this by adding a special case. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2023-07-17x86: Pass video settings from SPL to U-Boot properSimon Glass
When video is set up in SPL, U-Boot proper needs to use the correct parameters so it can write to the display. Put these in a bloblist so they are available to U-Boot proper. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Nikhil M Jain <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2023-07-17bdinfo: Show the malloc base with the bdinfo commandSimon Glass
It is useful to see the base of the malloc region. This is visible when debugging but not in normal usage. Add it to the global data so that it can be shown. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Nikhil M Jain <[email protected]> Reviewed-by: Bin Meng <[email protected]> Tested-by: Nikhil M Jain <[email protected]>