summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
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]>
2023-07-17x86: Improve the trampoline in 64-bit modeSimon Glass
At present this leaves the stack at the pre-relocation value. This is not ideal since we want to have U-Boot running entirely from the top of memory. In addition, the new global_data pointer is not actually used, since the global_data pointer itself is relocated, then the pre-relocation value is changed, so the effective value (after relocation) does not update. Adjust the implementation to follow the 32-bit code more closely, with a trampoline function which is passed the new stack and global_data pointer. This ensures that the correct values come through even when relocating. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2023-07-17log: Tidy up an ambiguous commentSimon Glass
Add a bit more detail so it is clear that multiple devices are supported, but only one per driver. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Bin Meng <[email protected]>
2023-07-14board_f: Relocate fdt even if GD_FLG_SKIP_RELOC is setKunihiko Hayashi
In case of OF_SEPARATE (!OF_EMBED), the devicetree blob is placed after _end, and fdt_find_separate() always returns _end. There is a .bss section after _end and the section is cleared before relocation. When GD_FLG_SKIP_RELOC is set, relocation is skipped, so the blob is still in .bss section, but will be cleared. As a result, the devicetree become invalid. To avoid this issue, should relocate it regardless of GD_FLG_SKIP_RELOC in reloc_fdt(). Signed-off-by: Kunihiko Hayashi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-14hash: fix a memory leakSergei Antonov
memalign() returns a pointer which is to be freed by free(). To call unmap_sysmem() is incorrect, furthermore it was called in a wrong scope. Also add a check for allocation error. Fixes: d7af2baa49c6 ("crypto/fsl: Fix HW accelerated hash commands") Cc: Breno Lima <[email protected]> Signed-off-by: Sergei Antonov <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-07-14bootstd: Add a separate log category for expoSimon Glass
This feature is different enough from bootstd that it probably deserves its own log category. It cannot use a uclass since it is not a device. Add a new category. Signed-off-by: Simon Glass <[email protected]>
2023-07-07tpl: Kconfig: TPL_BANNER_PRINT depends on DEBUG_UART && TPL_SERIALYing Sun
As implemented in the arch/arm/mach-rockchip/tpl.c file, the CONFIG_TPL_BANNER_PRINT option will not work if either of these options is not enabled. Add dependency constraints to the CONFIG_TPL_BANNER_PRINT option definition to prevent configuration problems where option is enabled but do not take effect. Suggested-by: Yanjie Ren <[email protected]> Signed-off-by: Ying Sun <[email protected]>
2023-07-07common: Kconfig: SYS_CONSOLE_ENV_OVERWRITE depends on SYS_CONSOLE_IS_IN_ENVYing Sun
CONFIG_SYS_CONSOLE_ENV_OVERWRITE is implemented in common/console.c when "#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)" is met. It is recommended to add dependency constraints to its definition. Suggested-by: Yanjie Ren <[email protected]> Signed-off-by: Ying Sun <[email protected]>
2023-07-06RISC-V: CONFIG_SPL_OPENSBI_SCRATCH_OPTIONS descriptionHeinrich Schuchardt
Describe which numeric values can be used for as scratch options for OpenSBI. Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Leo Yu-Chi Liang <[email protected]> Reviewed-by: Anup Patel <[email protected]>
2023-07-05Merge tag 'v2023.07-rc6' into nextTom Rini
Prepare v2023.07-rc6
2023-07-03spl: spl_legacy: Fix spl_end addressFabio Estevam
Currently, spl_end points to the __bss_end address, which is an external RAM address instead of the end of the SPL text section in the internal RAM. This causes boot failures on imx6-colibri, for example: ``` Trying to boot from MMC1 SPL: Image overlaps SPL resetting ... ``` Fix this problem by assigning spl_end to _image_binary_end, as this symbol properly represents the end of the SPL text section. From u-boot-spl.map: .end *(.__end) 0x00000000009121a4 _image_binary_end = . Fixes: 77aed22b48ab ("spl: spl_legacy: Add extra address checks") Reported-by: Francesco Dolcini <[email protected]> Signed-off-by: Fabio Estevam <[email protected]> Tested-by: Tom Rini <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Tested-by: Marek Vasut <[email protected]> # DH i.MX6Q DHCOM PDK2
2023-06-24imx: hab: Simplify the mechanismMarek Vasut
The current mechanism is unnecessarily complex. Simplify the whole mechanism such that the entire fitImage is signed, IVT is placed at the end, followed by CSF, and this entire bundle is also authenticated. This makes the signing scripting far simpler. Signed-off-by: Marek Vasut <[email protected]>
2023-06-24spl: spl_legacy: Add extra address checksMarek Vasut
Check whether the loaded image or entry point does not overlap SPL. Signed-off-by: Marek Vasut <[email protected]>
2023-06-23menu: Re-enable the ANSI codesSimon Glass
The intent here was to allow ANSI codes to be disabled, since it was proving impoosible to test operation of the menu code when it kept moving the cursor. Unfortunately this ended up in the patch. Correct this by enabling ANSI again. Signed-off-by: Simon Glass <[email protected]> Reported-by: Pali Rohár <[email protected]> Reported-by: Mark Kettenis <[email protected]> Reported-by: Frank Wunderlich <[email protected]> Fixes: 32bab0eae51b ("menu: Make use of CLI character processing") Tested-by: Mark Kettenis <[email protected]> Reviewed-by: Mark Kettenis <[email protected]>
2023-06-21common/memsize.c: Fix get_ram_size() when cache is enabledEmanuele Ghidoli
Ensure that every write is flushed to memory and afterward reads are from memory. Since the algorithm rely on the fact that accessing to not existent memory lead to write at addr / 2 without this modification accesses to aliased (not physically present) addresses are cached and wrong size is returned. This was discovered while working on a TI AM625 based board where cache is normally enabled, see commit c02712a74849 ("arm: mach-k3: Enable dcache in SPL"). Signed-off-by: Emanuele Ghidoli <[email protected]> Signed-off-by: Francesco Dolcini <[email protected]>
2023-06-20stdio: Remove stdio_init()Masahiro Yamada
This function is not used by anyone. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-06-20spl: spl-nor: return error if no valid image was loadedMario Kicherer
If only FIT images are enabled and loading the FIT image fails, spl_nor_load_image() should return an error instead of zero. Without this patch: >>SPL: board_init_r() spl_init Trying to boot from NOR Unsupported OS image.. Jumping nevertheless.. image entry point: 0x0 With patch: >>SPL: board_init_r() spl_init Trying to boot from NOR SPL: failed to boot from all boot devices (err=-6) .### ERROR ### Please RESET the board ### Signed-off-by: Mario Kicherer <[email protected]>
2023-06-19common: spl: Add spl NVMe boot supportMayuresh Chitale
Add support to load the next stage image from an NVMe disk which may be formatted as an EXT or FAT filesystem. Signed-off-by: Mayuresh Chitale <[email protected]> [trini: Drop hunk changing disk/part.c as that breaks other users] Signed-off-by: Tom Rini <[email protected]>
2023-06-19spl: blk: Support loading images from fsMayuresh Chitale
Add a generic API to support loading of SPL payload from any supported filesystem on a given partition of a block device. Signed-off-by: Mayuresh Chitale <[email protected]>
2023-06-19spl: Add Kconfig options for NVMEMayuresh Chitale
Add kconfig options to enable NVME and PCI NVMe support in SPL Signed-off-by: Mayuresh Chitale <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-06-16fdt_support: add fdt_copy_fixed_partitions functionPatrick Delaunay
Add a new function fdt_copy_fixed_partitions to copy the fixed partition nodes from U-Boot device tree to Linux kernel device tree and to dynamically configure the MTD partitions. This function fdt_copy_fixed_partitions is only based on device tree with livetree compatible function and replace the function fdt_fixup_mtdparts based on mtdparts variable. Signed-off-by: Patrick Delaunay <[email protected]> Reviewed-by: Patrice Chotard <[email protected]>
2023-06-16fdt_support: include dm/ofnode.hPatrick Delaunay
This patch is a preliminary patch to use ofnode function is fdt_support to read the U-Boot device tree with livetree compatible functions. Signed-off-by: Patrick Delaunay <[email protected]> Reviewed-by: Patrice Chotard <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-06-14spl: ext: Use partition size for mountMayuresh Chitale
Since commit 9905cae65e03 ("fs: ext4: check the minimal partition size to mount"), a valid size needs to be provided when mounting an ext filesystem. Fix the spl ext driver to use the parition size instead of 0 when mounting the filesystem. Signed-off-by: Mayuresh Chitale <[email protected]>
2023-06-12Merge tag 'xilinx-for-v2023.10-rc1' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-microblaze into next Xilinx changes for v2023.10-rc1 global: - Use proper U-Boot project name Fix sparse warnings in zynqmp-clk, zynqmp handoff, board cmd: - Cover incorrect 0 length entries Versal NET: - Add bootmode logic - Support SPP production version - Add loadpdi command ZynqMP: - Clear pmufw node command ID handling - Change power domain behavior around zynqmp_pmufw_node() - Fix zynqmp cmd return values and pmufw command - Fix R5 tcm init and modes mmc: - Sync Versal NET emmc DT binding pcie: - Add support for ZynqMP PCIe root port video: - Add support for ZynqMP DP tools: - Fix debug message in relocate-rela
2023-06-12Merge tag v2023.07-rc4 into nextTom Rini
Signed-off-by: Tom Rini <[email protected]>
2023-06-12global: Use proper project name U-BootMichal Simek
Use proper project name in comments, Kconfig, readmes. Reviewed-by: Neil Armstrong <[email protected]> Acked-by: Ilias Apalodimas <[email protected]> Reviewed-by: Stefan Roese <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/0dbdf0432405c1c38ffca55703b6737a48219e79.1684307818.git.michal.simek@amd.com
2023-05-31cli: avoid buffer overrunHeinrich Schuchardt
Invoking the sandbox with /u-boot -c ⧵0xef⧵0xbf⧵0xbd results in a segmentation fault. Function b_getch() retrieves a character from the input stream. This character may be > 0x7f. If type char is signed, static_get() will return a negative number and in parse_stream() we will use that negative number as an index for array map[] resulting in a buffer overflow. Reported-by: Harry Lockyer <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-31spl: Correct checking of configuration nodeBin Meng
Per the fit_conf_get_node() API doc, it returns configuration node offset when found (>=0). Signed-off-by: Bin Meng <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-05-17usb: Move SPL_USB_GADGET and related Kconfig symbols to drivers/usb/Marek Vasut
To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_GADGET and related symbols. Fix typo and rename SPL_USB_GADGET to "USB Gadget Support in SPL" . Update the gadget Makefile to match the symbol changes. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-05-17usb: Move SPL_USB_STORAGE Kconfig symbol to drivers/usb/Marek Vasut
To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_STORAGE and matching SYS_USB_FAT_BOOT_PARTITION . Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-05-17usb: Move SPL_USB_HOST Kconfig symbol to drivers/usb/Marek Vasut
To avoid piling up all the various Kconfig symbols in one place, i.e. common/spl/Kconfig, move the USB Kconfig symbols into drivers/usb/ . This commit moves SPL_USB_HOST and updates help text of both USB_HOST and SPL_USB_HOST . Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-05-13usb: Tidy up the usb_start flagSimon Glass
This should be declared in a header file so that type-checking works correctly. Add a single declaration to usb.h and remove the others. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Marek Vasut <[email protected]> Reviewed-by: Patrick Delaunay <[email protected]>
2023-05-08common: spl: spl: Remove video driver before u-boot properNikhil M Jain
Add method to remove video driver before loading u-boot proper. When bootstage changes from SPL to u-boot proper, noo method is called to remove video driver, and at u-boot proper if video driver is not enabled, the video driver starts displaying garbage on the screen, because there is no reserved space for video and the frame buffer gets u-boot proper data written. Signed-off-by: Nikhil M Jain <[email protected]>
2023-05-05Merge tag 'video-for-v2023.07-rc2' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-video - enable video support in SPL - support splash screen for TI am62x - replace #ifdef and #if with if's in bmp/splash - add lm3533 backlight driver - add Solomon SSD2825 DSI/LVDS bridge driver - add Renesas R61307 and R69328 MIPI DSI panel drivers - add tegra DC based PWM backlight driver - add generic endeavoru (HTC One X) panel driver
2023-05-03common/Kconfig: fix comments syntax errorHugo Villeneuve
Fix comments error in EVENT_DEBUG description: this get usefui -> this to get useful Signed-off-by: Hugo Villeneuve <[email protected]> Reviewed-by: Simon Glass <[email protected]>