summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-12-21bootm: Drop arguments from do_bootm_states()Simon Glass
Use the bootm_info struct to hold the information required by bootm. Now that none of the functions called from do_bootm_states() needs an argv[] list, change the arguments of do_bootm_states() as well. Take care to use the same value for boot_progress even though it is a little inconsistent. For booti make sure it only uses argv[] and argc at the top of the function, so we can eventually refactor to remove these parameters. With bootm, some OSes need access to the arguments provided to the command, so set these up in the bootm_info struct, for bootm only. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootz: Avoid use of #ifdefSimon Glass
Use the compiler to get the set of states, instead of the preprocessor. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21booti: Avoid use of #ifdefSimon Glass
Use the compiler to get the set of states, instead of the preprocessor. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Move do_bootm_states() comment to header fileSimon Glass
This is an exported function, so move the function comment to the bootm.h header file. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Add more fields to bootm_infoSimon Glass
Add fields for the three bootm parameters and other things needed for booting. Also add a helper to set up the struct correctly. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Adjust arguments of boot_os_fnSimon Glass
Adjust boot_os_fn to use struct bootm_info instead of the separate argc, argv and image parameters. Update the handlers accordingly. Few of the functions make use of the arguments, so this improves code size slightly. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21bootm: Create a struct for argument informationSimon Glass
Some OS functions require the arguments to the 'bootm' command. This is inconvenient for two reasons. Firstly, there may not be any actual command, if CMDLINE is not enabled and programmatic boot is being used. Secondly, most functions don't require the arguments, so it is inefficient to pass them when not needed. For example it increases code size. Create a new struct which holds the arguments, which can be used if needed. Add the images pointer as well, since this is commonly needed. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21sandbox: bootm: Enable more bootm OS methodsSimon Glass
It is useful for sandbox to build as much code as possible. Enable support for booting various other operating systems. Add the missing cache functions. These operating systems do not actually boot on sandbox, of course. Signed-off-by: Simon Glass <[email protected]>
2023-12-21bootm: Adjust how the board is resetSimon Glass
Use reset_cpu() to reset the board, copying the logic from the 'reset' command. This makes more sense than directly calling the do_reset() function with the arguments passsed to the bootm command. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-12-21riscv: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Adjust do_reset() to call it. Note that reset_cpu() is normally provided by SYSRESET so make this declaration conditional on that being disabled. Signed-off-by: Simon Glass <[email protected]> Reviewed-by: Chanho Park <[email protected]> Tested-by: Chanho Park <[email protected]>
2023-12-21nios2: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Signed-off-by: Simon Glass <[email protected]>
2023-12-21ppc: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. This is only needed if CONFIG_SYSRESET is disabled. Since there are lots of reset functions, this one actually just calls do_reset(). Future refactoring could correct this. Signed-off-by: Simon Glass <[email protected]>
2023-12-21m68k: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Since there are lots of reset functions, this one actually just calls do_reset(). Future refactoring could correct this. Signed-off-by: Simon Glass <[email protected]> Acked-by: Angelo Dureghello <[email protected]>
2023-12-21mips: Add a reset_cpu() functionSimon Glass
The current do_reset() is called from a command context. Add a function which can be used from anywhere, as is done on ARM. Signed-off-by: Simon Glass <[email protected]>
2023-12-21Merge branch '2023-12-21-assorted-updates-and-fixes' into nextTom Rini
- A few board fixes along with IOMMU enhancements and general fixes
2023-12-21lib: rsa: Print detailed error info in rsa_engine_init() on engine ↵Csókás Bence
resolution failure Signed-off-by: Csókás Bence <[email protected]> Reviewed-by: Tom Rini <[email protected]>
2023-12-21board/keymile/kmcent2: fix update-nor indentationTomas Alvarez Vanoli
variable was indented as part of the value of the previous variable. Signed-off-by: Tomas Alvarez Vanoli <[email protected]> Signed-off-by: Holger Brunck <[email protected]>
2023-12-21iommu: add qcom-hyp-smmuCaleb Connolly
Add a basic implementation of the ARM SMMU. This driver is intended for use on Qualcomm platforms where the SMMU has been configured by a previous bootloader, cannot be turned off, and doesn't support BYPASS streams. It keeps all existing stream mappings and only creates new ones for stream ids that aren't already configured. This driver is necessary to support peripherals that perform DMA which weren't configured by the previous stage bootloader (for example USB). It works by allocating a context bank using identity mapping (as U-Boot doesn't use virtual addresses). Signed-off-by: Caleb Connolly <[email protected]>
2023-12-21iommu: add a connect opCaleb Connolly
Add an optional iommu callback to be invoked before a device probes. This can be used to configure the IOMMU in preparation for the device (e.g. by allocating a context bank) Signed-off-by: Caleb Connolly <[email protected]>
2023-12-21iommu: fix compilation when CONFIG_PCI disabledCaleb Connolly
The dev_pci_iommu_enable() function is only available when CONFIG_PCI is enabled, replace the runtime check with a preprocessor one to fix compilation with pci disabled. Signed-off-by: Caleb Connolly <[email protected]>
2023-12-21configs: verdin-am62: Disable SPL FIT OverlayFrancesco Dolcini
Disable CONFIG_SPL_LOAD_FIT_APPLY_OVERLAY, this is not required nor used on verdin am62, disable it to save precious binary size. Update defconfig using savedefconfig, this adds CONFIG_OF_LIBFDT_OVERLAY explicitly. Signed-off-by: Francesco Dolcini <[email protected]> Acked-by: Marcel Ziswiler <[email protected]>
2023-12-21boot: add support for fdt_fixup command in environmentMatthias Schiffer
The "fdt" command is convenient for making small changes to the OS FDT, especially during development. This is easy when the kernel and FDT are loaded separately, but can be cumbersome for FIT images, requiring to unpack the image, manually apply overlays, etc. Add an option to execute a command "fdt_fixup" from the environment at the beginning of image_setup_libfdt() (after overlays are applied, and before the other fixups). Signed-off-by: Matthias Schiffer <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-21include: env: ti: ti_common: Run main_cpsw0_qsgmii_phyinit conditionallyManorit Chawdhry
The main_cpsw0_qsgmii_phyinit command is defined only for certain TI SoCs which have the do_main_cpsw0_qsgmii_phyinit variable set. Add a check to ensure that the main_cpsw0_qsgmii_phyinit command is run only for such SoCs. Signed-off-by: Manorit Chawdhry <[email protected]> Signed-off-by: Siddharth Vadapalli <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]>
2023-12-21fs: Fix SPL build if FS_LOADER is enabledMayuresh Chitale
If FS_LOADER is enabled for the SPL then the build fails with the error: fs/fs.o:(.data.rel.fstypes+0x128): undefined reference to `smh_fs_set_blk_dev' fs/fs.o:(.data.rel.fstypes+0x140): undefined reference to `smh_fs_size' fs/fs.o:(.data.rel.fstypes+0x148): undefined reference to `smh_fs_read' fs/fs.o:(.data.rel.fstypes+0x150): undefined reference to `smh_fs_write' Fix the error by populating the semihosting entry in the fs_types array only for non-SPL builds. Signed-off-by: Mayuresh Chitale <[email protected]> Reviewed-by: Tom Rini <[email protected]> Reviewed-by: Sean Anderson <[email protected]>
2023-12-21Merge branch '2023-12-21-header-inclusion-cleanup' into nextTom Rini
- Merge in changes to clean up various places that used <common.h> or <linux/kconfig.h>
2023-12-21lib: Remove <common.h> inclusion from these filesTom Rini
After some header file cleanups to add missing include files, remove common.h from all files in the lib directory. This primarily means just dropping the line but in a few cases we need to add in other header files now. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21include: Further cleanup includesTom Rini
Add some missing headers such as <linux/errno.h> or <linux/types.h> or <linux/kernel.h> to header files that make direct usage of things provided by these headers. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21display_options: Clean up headersTom Rini
In include/display_options.h we cannot include ourself, but do need <linux/types.h> directly. Then in lib/display_options.c we further clean the list to remove common.h. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21efi_loader: Remove <common.h>Tom Rini
We largely do not need <common.h> in these files, so drop it. The only exception here is that efi_freestanding.c needs <linux/types.h> and had been getting that via <common.h>. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21rmobile: Add <mach/rmobile.h> to cpu_info-rzg2l.cTom Rini
In order for RMOBILE_CPU_TYPE_R9A07G044L to be defined we need to include <mach/rmobile.h> here. Reviewed-by: Marek Vasut <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21lib/sha*.c: Update header listTom Rini
Cleanup the list of headers we include here. For the tools build we only need to exclude <cyclic.h> as that's used by the target build for the prototype for schedule(), and we don't need to get that via <watchdog.h>. We can also make use of our <string.h> intentionally existing as a redirection to <linux/string.h> to reduce ifdef'd lines. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21global: Rework architecture global_data.h to include <linux/types.h>Tom Rini
In most cases, the architecture global data currently makes use of assorted linux types, but does not include <linux/types.h> to provide them. Add <linux/types.h> instead of relying on indirect inclusion. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21m68k: Rework asm/global_data.h slightlyTom Rini
In the architecture global data, replace the one case of u32 with unsigned long. Now, we can drop config.h here but then do need to add it in two m68k-centric spaces. Acked-by: Angelo Dureghello <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21sandbox: Add <linux/types.h> to asm/global_data.h and asm/io.hTom Rini
We need <linux/types.h> in these files as we reference Linux types. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21arm: Remove <asm/types.h> from asm/global_data.hTom Rini
We need and include <linux/types.h> and this in turn already includes <asm/types.h>, so drop it here. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21global: Remove duplicate common.h inclusionsTom Rini
These files include <common.h> twice. Start by removing the second inclusion of the file. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21global: Drop common.h inclusionTom Rini
In order to make it easier to move on to dropping common.h from code directly, remove common.h inclusion from the rest of the header file which had been including it. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21sandbox: Audit config.h and common.h usageTom Rini
Remove and replace common.h and config.h in sandbox when it's not needed and add some explicit includes where needed. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21arm: Partial cleanup and audit usage of <config.h>Tom Rini
We need to include <config.h> directly when a file needs to have something such as CFG_SYS_SDRAM_SIZE referenced as this file is not automatically globally included and is most commonly indirectly included via common.h. Remove most cases of arm including config.h directly, but add it where needed. This includes a few board-specific fixes. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21arc: Cleanup and audit usage of <config.h>Tom Rini
We need to include <config.h> directly when a file needs to have something such as CFG_SYS_SDRAM_SIZE referenced as this file is not automatically globally included and is most commonly indirectly included via common.h. Remove most cases of arc including config.h directly, but add it where needed. Further clean up the tb100 board config.h file so that we don't rely on config.h being included there for a value used in a single place. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21qe: Add <config.h> to linux/immap_qe.hTom Rini
Given how we define QE_MURAM_SIZE today, this header needs to have <config.h> added to it. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-21global: Restrict use of '#include <linux/kconfig.h>'Tom Rini
In general terms, we -include include/linux/kconfig.h and so normal U-Boot code does not need to also #include it. However, for code which is shared with userspace we may need to add it so that either our full config is available or so that macros such as CONFIG_IS_ENABLED() can be evaluated. In this case make sure that we guard these includes with a test for USE_HOSTCC so that it clear as to why we're doing this. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-12-20Merge branch '2023-12-20-assorted-general-updates' into nextTom Rini
- Assorted fixes around the tree
2023-12-20Merge tag 'u-boot-imx-next-20231220' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next - Put the USB hub out of reset on colibri-imx8x - Fix VDDx brownout interrupt register of i.MX23/i.MX28 - Fix Phytec imx8m SoM detection - Add TPM support for gw72xx boards
2023-12-20Merge tag 'u-boot-imx-master-20231220' of ↵Tom Rini
https://gitlab.denx.de/u-boot/custodians/u-boot-imx - Make DRAM stable on i.MX8MP DHCOM SoM by using FPWM mode and updating the DRAM timing - Fix display artifacts when booting Linux on i.MX8M Mini/Plus eDM SBC
2023-12-20cmd: part: Cover both part type entries with GUID ifdefMarek Vasut
The 'part type' subcommand depends on GUID partition table support. The help text exposes one of two 'part type' subcommand entries, hide both in case GUID partition table support is not enabled to avoid confusing users. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-20smbios: Fallback to the default DT if sysinfo nodes are missingIlias Apalodimas
In order to fill in the SMBIOS tables U-Boot currently relies on a "u-boot,sysinfo-smbios" compatible node. This is fine for the boards that already include such nodes. However with some recent EFI changes, the majority of boards can boot up distros, which usually rely on things like dmidecode etc for their reporting. For boards that lack this special node the SMBIOS output looks like: System Information Manufacturer: Unknown Product Name: Unknown Version: Unknown Serial Number: Unknown UUID: Not Settable Wake-up Type: Reserved SKU Number: Unknown Family: Unknown This looks problematic since most of the info are "Unknown". The DT spec specifies standard properties containing relevant information like 'model' and 'compatible' for which the suggested format is <manufacturer,model>. Unfortunately the 'model' string found in DTs is usually lacking the manufacturer so we can't use it for both 'Manufacturer' and 'Product Name' SMBIOS entries reliably. So let's add a last resort to our current smbios parsing. If none of the sysinfo properties are found, scan for those information in the root node of the device tree. Use the 'model' to fill the 'Product Name' and the first value of 'compatible' for the 'Manufacturer', since that always contains one. pre-patch: Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: Unknown Product Name: Unknown Version: Unknown Serial Number: 100000000bb24ceb UUID: 30303031-3030-3030-3061-613234636435 Wake-up Type: Reserved SKU Number: Unknown Family: Unknown [...] and post patch: Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: raspberrypi Product Name: Raspberry Pi 4 Model B Rev 1.1 Version: Unknown Serial Number: 100000000bb24ceb UUID: 30303031-3030-3030-3061-613234636435 Wake-up Type: Reserved SKU Number: Unknown Family: Unknown [...] Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Tested-by: Peter Robinson <[email protected]>
2023-12-20smbios: Simplify reporting of unknown valuesIlias Apalodimas
If a value is not valid during the DT or SYSINFO parsing, we explicitly set that to "Unknown Product" and "Unknown" for the product and manufacturer respectively. It's cleaner if we move the checks insisde smbios_add_prop_si() and provide an alternative string in case the primary is NULL or empty pre-patch dmidecode <snip> Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: Unknown Product Name: Unknown Product Version: Not Specified Serial Number: Not Specified UUID: Not Settable Wake-up Type: Reserved SKU Number: Not Specified Family: Not Specified [...] post-patch dmidecode: Handle 0x0001, DMI type 1, 27 bytes System Information Manufacturer: Unknown Product Name: Unknown Version: Unknown Serial Number: Unknown UUID: Not Settable Wake-up Type: Reserved SKU Number: Unknown Family: Unknown [...] While at it make smbios_add_prop_si() add a string directly if the prop node is NULL and replace smbios_add_string() calls with smbios_add_prop_si(ctx, NULL, ....) Signed-off-by: Ilias Apalodimas <[email protected]> Reviewed-by: Peter Robinson <[email protected]> Tested-by: Peter Robinson <[email protected]>
2023-12-20pxe_utils: Increase feedback to user when fdt file is not foundMichael Trimarchi
extlinux.conf can set fdtdir. fdtdir look for fdt file using information found in the environment variable. The function does not report any error in the case the file is not found Scanning for bootflows in all bootdevs Seq Method State Uclass Part Name Filename --- ----------- ------ -------- ---- ------------------------ ---------------- Scanning global bootmeth 'efi_mgr': No EFI system partition No EFI system partition Failed to persist EFI variables Scanning bootdev '[email protected]': 0 extlinux ready mmc 1 [email protected]_ /boot/extlinux/extlinux.conf ** Booting bootflow '[email protected]_1' with extlinux 1: am62x-sk-buildroot Retrieving file: /boot/Image append: console=ttyS2,115200n8 root=PARTUUID=c586a30c-0bf1-4323-aba8-779c814ee135 rw rootfstype=ext4 rootwait earlycon=ns16550a,mmio32,0x02800000 Retrieving file: /boot/k3-am623_ccm_m3.dtb Skipping fdtdir /boot/ for failure retrieving dts Signed-off-by: Michael Trimarchi <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2023-12-20colibri-imx8x: configure usb hub to bypass modeAndrejs Cainikovs
This change configures Toradex Colibri iMX8X SoM USB hub to bypass mode, and brings out of the reset state. Signed-off-by: Andrejs Cainikovs <[email protected]>