aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
6 daysenv: mmc: do not return an offset before the start of the partitionRasmus Villemoes1-1/+9
I have an GPT layout containing two partitions with the type GUID for U-Boot environment: partition U-Boot-env-1 { offset = 0x1fc000 size = 0x2000 partition-type-uuid = "3de21764-95bd-54bd-a5c3-4abe786f38a8" } partition U-Boot-env-2 { offset = 0x1fe000 size = 0x2000 partition-type-uuid = "3de21764-95bd-54bd-a5c3-4abe786f38a8" } and have set CONFIG_ENV_OFFSET=0x1fc000, CONFIG_ENV_OFFSET_REDUND=0x1fe000 and CCONFIG_ENV_SIZE=0x2000. This usually works just fine, but on an stm32mp, I was seeing weird behaviour. It turns out that can be tracked down to that board setting CONFIG_PARTITION_TYPE_GUID, so the logic in mmc.c ends up only finding the first of the two partitions, but then in the copy=1 case ends up computing 0x1fa000 as the *val returned (that is, the end of the partition minus two times the environment size). That is of course outside the found partition and leads to random corruption of the partition preceding U-Boot-env-1. Add a sanity check that the partition found is at least as large as needed for the "one or two copies from the end of the partition" logic to at least produce something within that partition. That will also catch a bug where the partition is too small for even one copy of the environment. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
6 daysenv: mmc: refactor mmc_offset_try_partition()Rasmus Villemoes1-18/+41
In preparation for fixing the handling of a the case of redundant environment defined in two separate partitions with the U-Boot env GUID, refactor the for () if (str) ... #ifdef CONFIG_FOO if (!str) .. #endif to if (str) for () else if (CONFIG_FOO && !str) for () and put those for loops in separate functions. No functional change intended, but I did change the direct access of info.type_guid into using the disk_partition_type_guid() helper, so that I could avoid the #ifdef and use IS_ENABLED() in the if() statement. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
6 daysusb: gadget: usbhs: Add Renesas USBHS device driverVitaliy Vasylskyy13-0/+4735
Add UDC driver for Renesas USBHS controller found in R-Car Gen3 SoCs. This is mostly ported from the Linux kernel, with additional porting glue. The code has been synchronized with 1b4861e32e46 ("Linux 6.9.3") and cleaned up and ported to DM since the original implementation by Vitaliy. Signed-off-by: Vitaliy Vasylskyy <vitaliy.vasylskyy@globallogic.com> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240908230654.286062-1-marek.vasut+renesas@mailbox.org Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
7 daysbootstd: android: Add U-Boot version to cmdlineMattijs Korpershoek1-1/+12
When booting into Android fastbootd (a subset of recovery), the default UI shows the bootloader version in the screen [1]. This is done via the ro.bootloader property which should come from the bootloader. Provide the U-Boot version via a kernel commandline argument so that fastbootd can show it properly on the screen. [1] https://android.googlesource.com/platform/bootable/recovery/+/refs/heads/main/fastboot/fastboot.cpp#42 Reviewed-by: Julien Masson <jmasson@baylibre.com> Reviewed-by: Guillaume La Roque <glaroque@baylibre.com> Reviewed-by: Simon Glass <sjg@chromium.org> Link: https://lore.kernel.org/r/20240912-bootmeth-bootloader-version-v2-1-76d4c0b45024@baylibre.com Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
7 daysdfu: define a callback function for the dfu_alt_info environment variableRasmus Villemoes4-1/+26
I'm trying to use dfu-util for bootstrapping an stm32mp board. It mostly works fine, but something goes horribly wrong as soon as I make use of the ability to run arbitrary u-boot shell commands. The shell commands themselves work fine, but the heuristic "dfu_alt_info may have changed, we have to reinit" seems to cause the board and/or my host machine to go into some bad state, and further dfu-util commands fail. U-Boot already has a mechanism whereby C code can be told about changes to specific environment variables. So instead of always doing re-init, add a hook to the dfu_alt_info variable so that we only do set dfu_reinit_needed if the commands actually did modify that variable. Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> Link: https://lore.kernel.org/r/20240911133900.1444083-1-rasmus.villemoes@prevas.dk Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
7 dayspower: regulator: Drop regulators_enable_boot_on/off()Marek Vasut14-73/+0
Both regulators_enable_boot_on/off() are unused and superseded by regulator uclass regulator_post_probe(). Remove both functions. Signed-off-by: Marek Vasut <marex@denx.de>
7 dayspower: regulator: Drop regulator_unset()Marek Vasut2-24/+1
This function is never called, drop it. Signed-off-by: Marek Vasut <marex@denx.de>
7 dayspower: regulator: Convert regulators_enable_boot_on/off() to ↵Marek Vasut1-41/+19
regulator_post_probe Turn regulators_enable_boot_on() and regulators_enable_boot_off() into empty functions. Implement matching functionality in regulator_post_probe() instead. The regulator_post_probe() is called for all regulators after they probe, and regulators that have regulator-always-on or regulator-boot-on DT properties now always probe due to DM_FLAG_PROBE_AFTER_BIND being set on such regulators in regulator_post_bind(). Finally, fold regulator_unset() functionality into regulator_autoset(). Signed-off-by: Marek Vasut <marex@denx.de>
7 dayspower: regulator: Trigger probe of regulators which are always-on or boot-onMarek Vasut3-10/+18
In case a regulator DT node contains regulator-always-on or regulator-boot-on property, make sure the regulator gets correctly configured by U-Boot on start up. Unconditionally probe such regulator drivers. This is a preparatory patch for introduction of .regulator_post_probe() which would trigger the regulator configuration. Parsing of regulator-always-on and regulator-boot-on DT property has been moved to regulator_post_bind() as the information is required early, the rest of the DT parsing has been kept in regulator_pre_probe() to avoid slowing down the boot process. Signed-off-by: Marek Vasut <marex@denx.de>
7 daysMerge tag 'v2024.10-rc6' into nextTom Rini25-43/+71
Prepare v2024.10-rc6
7 daysPrepare v2024.10-rc6v2024.10-rc6Tom Rini2-3/+3
Signed-off-by: Tom Rini <trini@konsulko.com>
7 daysMerge tag 'u-boot-dfu-20240930' of ↵Tom Rini2-1/+2
https://source.denx.de/u-boot/custodians/u-boot-dfu u-boot-dfu-20240930 - Fix Kconfig dependencies for DFU_OVER_USB
7 daysusb: gadget: cdns3: Fix missing cache operations for non-zero EndpointsSiddharth Vadapalli1-0/+13
Transfer initiation and completion for the non-zero Endpoints are handled by cdns3_ep_run_transfer() and cdns3_transfer_completed() respectively. Failing to flush the cache associated with the TRB Pool within cdns3_ep_run_transfer() results in the transfers never being initiated. Similarly, failing to invalidate the cache associated with the TRB pool within cdns3_transfer_completed() results in the transfers never being completed. Fix this. Fixes: 7e91f6ccdc84 ("usb: Add Cadence USB3 host and gadget driver") Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com> Reviewed-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: Marek Vasut <marex@denx.de>
7 daysMerge tag 'u-boot-rockchip-20240930' of ↵Tom Rini1-10/+12
https://source.denx.de/u-boot/custodians/u-boot-rockchip CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/22470 - rk8xx pmic fix
11 daysregulator: rk8xx: Use buck variable consistentlyJonas Karlman1-6/+8
The buck variable is zero based, i.e. buck=0 match BUCK1 in datasheet. Remove any buck + 1 calculation to be more consistent in usage of the buck variable across the different RK8xx variants in the driver. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
11 daysregulator: rk8xx: Fix buck get and set enabled state on RK806Jonas Karlman1-4/+4
Wrong POWER_EN reg is used to get and set enabled state for the RK806 buck 4 and 8 regulators, also wrong POWER_SLP_EN0 bit is used for suspend state for the RK806 buck 1-8 regulators. Fix this by not adding one to the zero based buck variable. Fixes: f172575d92cd ("power: rk8xx: add support for RK806") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Reviewed-by: Kever Yang <kever.yang@rock-chips.com> Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
11 daysMerge tag 'dm-next-26sep24' of ↵Tom Rini25-115/+460
https://source.denx.de/u-boot/custodians/u-boot-dm into next CI: https://source.denx.de/u-boot/custodians/u-boot-dm/-/pipelines/22430 CI: https://dev.azure.com/simon0972/u-boot/_build/results?buildId=68&view=results
11 daysMerge tag 'u-boot-stm32-20240926' of ↵Tom Rini2-4/+3
https://source.denx.de/u-boot/custodians/u-boot-stm - Fixes for STM32MP15x basic boot
12 daysbinman: Make a start on an iMX8 testSimon Glass3-1/+23
This patch is for Marek, to provide a starting point. To try it, use 'binman test -T' and see the missing coverage. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Allow image_pos to be None when writing symbolsSimon Glass3-13/+65
Some images do not have an image_pos value, for example an image which is part of a compressed section and therefore cannot be accessed directly. Handle this case, returning None as the value. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Unwind the end-at-4gb special-case a littleSimon Glass3-18/+18
Move the check for this further out, so that base_addr is computed in Entry.WriteSymbols() rather than at lower levels. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Provide a way to set the symbol base addressSimon Glass7-7/+110
The base address of the ELF containing symbols is normally added to any symbols written, so that the value points to the correct address in memory when everything is loaded. When the binary resides on disk, a different offset may be needed, typically 0. Provide a way to specify this. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Add minor improvements to symbol-writingSimon Glass3-9/+34
Add a clarification to the documentation and add a missing comment. Also update the test so that when it fails it is easier to see what is going on, rather than having to decode hex strings. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Adjust naming for reading symbolsSimon Glass5-21/+19
These functions get the value of a symbol. The reference to ELF files is confusing since they are reading the position/size of entries, not ELF symbols. Rename the functions and adjust the comments also. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: fit: Refine handling of devicetrees for OF_UPSTREAMSimon Glass2-8/+26
With OF_UPSTREAM the dts files are in an SoC-specific subdirectory, meaning that the resulting dtb files all end up in a similar subdirectory. We don't want the subdirectory name to appear as a node name in the FIT, so handle this as a special case. Also the default devicetree may have a directory-name prefix, so handle that when searching through the available devicetree files. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: fit: Set the image_pos attributes only onceSimon Glass1-1/+4
The section etype has its own implementation of SetImagePos(), most of which is not useful since the code is included here. So call Entry.SetImagePos() which has the only piece of this which we actually want. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: fit: Avoid assuming that a FIT member is a sectionSimon Glass1-3/+3
Use the more generic variable name 'entry' to avoid confusion. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Update fdt-list-dir to use the provided directorySimon Glass2-3/+14
Since the files are known to be in the provided directory, use that instead of requiring it to be added to the list of input directories. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Avoid setting the image_pos attribute directlySimon Glass2-2/+2
Two places set this attribute directly. Update them to use the function provided. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Tidy up comments and pylint warnings in fitSimon Glass1-31/+42
Update this entry type to resolve some pylint warnings and make sure that functions and members are fully commented. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Tidy up comments for Entry.GetEntryArgsOrProps()Simon Glass1-1/+9
Improve the comments for this function. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Correct the comment for fdtgrepSimon Glass2-2/+4
This returns stdout, not a CommandResult so update the comment. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbinman: Fix up test coverage for mkeficapsuleSimon Glass2-1/+23
Add tests for missing tools to complete the test coverage for this etype. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbuildman: Allow skipping the dtc buildSimon Glass6-4/+66
For most boards, the device-tree compiler is built in-tree, ignoring the system version. Add a special option to skip this build. This can be useful when the system dtc is up-to-date, as it speeds up the build. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysbuildman: Retry the build for current sourceSimon Glass1-0/+8
Buildman retries a failed build when processing a branch, but does not do this when building current source. It is useful to do this retry in both cases, so add the logic for it. Signed-off-by: Simon Glass <sjg@chromium.org>
12 daysarm: imx: Enable always-on regulators using board specific workaround on ↵Marek Vasut2-0/+6
DHCOM SoM U-Boot is currently unable to automatically enable regulators which contain DT property regulator-always-on or regulator-boot-on. There is an ongoing work to add this functionality to regulator core code, but until the proper solution lands, add this awful workaround code to force these regulators on. This is specifically needed to assure the VIO regulator used to supply ethernet magnetics is enabled. Signed-off-by: Marek Vasut <marex@denx.de>
12 daysARM: stm32: Fix secure_waitbits() mask checkMarek Vasut1-2/+1
Do not apply bitwise AND to register value and expected value, only apply bitwise AND to register value and mask, and only then compare the result with expected value that the function polls for. Fixes: b49105320a5b ("stm32mp: psci: Implement PSCI system suspend and DRAM SSR") Signed-off-by: Marek Vasut <marex@denx.de>
12 daysARM: stm32: Fix TAMP_SMCR BKP..PROT fields on STM32MP15xxMarek Vasut1-2/+2
Update the TAMP_SMCR BKP..PROT fields to put first 10 registers into protection zone 1 and next 5 into zone 2. This fixes use of boot counter which is often in zone 3 and has to be updated from Linux, which runs in NS. Fixes: 73f7fc944cf6 ("ARM: stm32: Initialize TAMP_SMCR BKP..PROT fields on STM32MP15xx") Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 dayspower: regulator: Consistently return -ENOSYS when ops is unimplementedJonas Karlman1-12/+12
dev_get_driver_ops() may return NULL when the udevice is invalid. Move the ops check to top of functions to consistently return -ENOSYS when ops is unimplemented and prevent trying to access uclass plat data, also add missing NULL checks to suspend ops. Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
12 dayspower: regulator: Do not call set_suspend_value with -ENODATAJonas Karlman1-1/+7
On some boards a PMIC regulator is flagged with regulator-on-in-suspend and does not define any suspend or max microvolt, e.g. on Radxa ROCK 3A: vcc_ddr: DCDC_REG3 { regulator-name = "vcc_ddr"; regulator-always-on; regulator-boot-on; regulator-initial-mode = <0x2>; regulator-state-mem { regulator-on-in-suspend; }; }; This result in suspend_uV having the value -ENODATA after probe. This negative voltage, -ENODATA, gets missinterpreted and result in an unexpected voltage being set by autoset. E.g. on Radxa ROCK 3A the vcc_ddr regulator by default have a normal and suspend voltage value of 0.5v. However, due to this missinterpretation the suspend voltage end up beind set to 0.5625v instead. Fix this by skip calling regulator_set_suspend_value() in autoset and also protect calling set value ops when input value is -ENODATA. Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
12 daysMerge tag 'u-boot-imx-next-20240925' of ↵Tom Rini5-2/+12
https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/22406 - i.MX93 FEC fixes. - Always name the generated fitImage u-boot.itb to keep compatibility with pr-buildman behavior. -----------------------
13 daysnet: fec_mxc: Skip recv packet process when fec is haltedYe Li1-0/+3
After FEC is halted by calling fec_halt callback, we should not continue receiving packet. Otherwise it will process previous pending interrupts on EIR register and uses wrong rbd index as this has been reset to 0. The GRA interrupt which is triggered by issuing graceful stop command to FEC transmitter in fec_halt is processed in this case. It causes wrong receive buffer descriptors be used by FEC in next time. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 daysnet: fec_mxc: Fix clk_ref rate on iMX93Peng Fan1-2/+5
i.MX93 FEC ENET port supports two mode: RGMII and RMII. For RGMII, there is an internal /2 divider, so the freq needs to set with (*2), otherwise the speed will not reach 1G and cause communication error in some network environments. For RMII, the clk path is ccm -> enet tx_clk pin -> pad loop back to enet, no /2 divider. So fix for RGMII mode with freq multiplied by 2. Fixes: 09de565f76b ("net: fec_mxc: support i.MX93") Signed-off-by: Ye Li <ye.li@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
13 daysarm64: dts: imx8m: Always name the generated fitImage u-boot.itbMarek Vasut4-0/+4
Maintain backward compatibility with pre-binman u-boot file naming, the U-Boot fitImage used to be named u-boot.itb before, restore the file name after binman conversion. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Peng Fan <peng.fan@nxp.com>
13 daysMerge patch series "Miscellaneous fixes"Tom Rini37-112/+197
Jerome Forissier <jerome.forissier@linaro.org> says: Miscellaneous fixes made when developing the lwIP series [1]. They are posted separately since they make sense on their own. Subsequent versions of the lwIP series will contain a squashed version of this one. [1] http://patchwork.ozlabs.org/project/uboot/list/?series=420712&state=%2A&archive=both
13 dayscmd: pxe: CMD_PXE implies CMD_TFTPBOOTJerome Forissier1-0/+1
cmd/pxe.c (CMD_PXE) calls do_get_tftp() (CMD_TFTPBOOT) therefore add an "imply" to cmd/Kconfig. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
13 dayscommon: update: UPDATE_COMMON implies CMD_TFTPBOOTJerome Forissier1-0/+1
common/update.c (UPDATE_COMMON) depends on tftp_timeout_ms which is defined in cmd/tftp.c (CMD_TFTPBOOT). Therefore add the appropriate imply statement to Kconfig. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
13 daystest/py: test_efi_loader: add HTTP (wget) test for the EFI loaderJerome Forissier1-12/+42
Add a test to test_efi_loader.py similar to the TFTP test but for HTTP with the wget command. Suggested-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Tom Rini <trini@konsulko.com> Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
13 daystest/py: test_efi_loader: add missing dependency on cmd_tftpbootJerome Forissier1-0/+2
test_efi_helloworld_net() and test_efi_grub_net() depend on cmd_tftpboot so add the missing annotations. Reported-by: Tom Rini <trini@konsulko.com> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
13 daystest/py: net_boot: fix commentJerome Forissier1-1/+1
If env__pxe_boot_test_skip is not present, it defaults to True not False. Therefore fix the comment. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Peter Robinson <pbrobinson@gmail.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>