summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-10-30power: regulator: s2mps11: declaratively get/set regulator modeKaustabh Chakraborty
The functions s2mps11_{buck,ldo}_mode use the s2mps11_{buck,ldo}_modes arrays directly in order to extract the mode of a certain register. This approach does not allow similar devices of other variants (which may support a different set of modes) to work with the same driver. Instead of using these arrays hardcoded, extract them from the device's uclass platform data. Now the responsibility of setting these arrays properly is done by functions s2mps11_{buck,ldo}_probe, by implementing a switch-case block which can support modes of multiple variants if and when added. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30power: regulator: s2mps11: declaratively define LDOs and BUCKsKaustabh Chakraborty
In the Linux kernel driver, all information related to LDO and BUCK regulators are stored in descriptive arrays. This also allows multiple variants to be supported by the same driver. Define a struct sec_regulator_desc which holds all values required by a regulator. Create an array of said struct containing all regulators. The descriptors are designed to follow a style similar to what's seen in the Linux driver, so comparing one with the other is simple. In functions such as s2mps11_{buck,ldo}_{val,mode} these values are to be used, make necessary modifications to pull them from the descriptors. Since multiple variants have varying descriptors, select them from within a switch-case block. Functions s2mps11_{buck,ldo}_{volt2hex,hex2volt} and arrays s2mps11_buck_{ctrl,out} are phased out as the calculations are now hardcoded in descriptors, thusly, it reduces clutter and enhances readability. Two macros in s2mps11.h, S2MPS11_LDO_NUM and S2MPS11_BUCK_NUM are removed as they are no longer being used. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30power: pmic: s2mps11: add support for allowing multiple device variantsKaustabh Chakraborty
There are multiple PMICs by Samsung which are similar in architecture (register layout, interface, etc.) and is possible to be driven by a single driver. Variant specific code and data should be managed properly in the driver. And an enum which describes all supported variants. Pass the enum as the device driver data. Introduce a switch-case block on the enum for any variant specific code. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30power: pmic: s2mps11: change the probe function to bindKaustabh Chakraborty
The probe function, s2mps11_probe() is responsible for binding its PMIC children. The driver doesn't have any functionality directly, but has sub-devices which are parts of the device. Therefore, this should be a bind function. This is the case in the Samsung S5M8767 PMIC driver. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: exynos_dw_mmc: add compatible for exynos7870-dw-mshc-smuKaustabh Chakraborty
Exynos7870 is documented in upstream dt-schema. Add it in the U-Boot driver. Note that here it seems that Exynos7 DW MMC is perfectly compatible with Exynos7870 DW MMC. It's not always true, especially in SDIO cards where data from a 64-bit FIFO is read in two 32-bit halves [1]. Since SDIO isn't used or implemented here, it's oblivious. But upstream's schema considers that quirk, so that compatible is followed. Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7cbe799ac10f [1] Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: exynos_dw_mmc: add support for SD UHS modeKaustabh Chakraborty
SD UHS mode is already supported by the Exynos DW-MMC driver in mainline Linux. Using that as reference, add support in the U-Boot driver. The maximum frequency was capped to 200000000, increase it to 208000000, which is the required frequency for UHS_SDR104, which has the highest frequency of all UHS modes. Moreover, add UHS_CAPS to host capailities. These changes allow both host and card to recognize support for all UHS modes. SDR104, SDR50, and DDR50 have their own CLKSEL timing values, which requires the CIU div value to be set in bits 18:16. Move the function exynos_dwmci_clksel() below exynos_dwmmc_get_ciu_div() so that the latter is accessible from the former, and add cases for said timing modes. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: exynos_dw_mmc: add support for MMC HS200 and HS400 modesKaustabh Chakraborty
MMC HS200 and HS400 modes are already supported by the Exynos DW-MMC driver in mainline Linux. Using that as reference, add support in the U-Boot driver. The maximum frequency was capped to 50000000, increase it to 200000000, which is the required frequency for HS200/HS400. Moreover, add MMC_MODE_HS200 and MMC_MODE_HS400 to host capailities. These changes allow both host and card to recognize support for HS200/HS400. This change also includes a new ops function, namely execute_tuning. Implementing it would mean that we can no longer rely on the default ops provided by dw_mmc.c, thus a new ops instance is created with proper fields. The execute_tuning function is modeled after the one available in the Linux driver. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: enable/disable VQMMC regulator only during MMC power cycleKaustabh Chakraborty
Disrupting the regulator voltage during ios configuration messes with the MMC initialization sequence. Move the VQMMC regulator enable/disable functions to the MMC power cycle function, similar to how its done for the VMMC regulator. Signed-off-by: Kaustabh Chakraborty <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: dw_mmc: return error for invalid voltage settingKaustabh Chakraborty
In certain cases, the VQMMC regulator may not support certain voltages. For instance, a VQMMC regulator which supports only up to 2.7V will not accept 3.3V as an argument. This is unaccounted for, and thus the driver incorrectly assumes that the voltage is set successfully. Fetch the return value in a variable and return if it's non-zero. (-ENOSYS is exempted as it implies that the voltage adjustment functionality as a whole isn't supported). Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: dw_mmc: add voltage switch command flagKaustabh Chakraborty
During a voltage switch command (CMD11, opcode: SD_CMD_SWITCH_UHS18V), certain hosts tend to stop responding to subsequent commands. This is addressed by introducing an additional command flag, DWMCI_CMD_VOLT_SWITCH. The associated interrupt bit is defined as DWMCI_INTMSK_VOLTSW. This is set high when a voltage switch is issued, this needs to be waited for and set to low. Implement the same in the timeout loop. Do note that since DWMCI_INTMSK_VOLTSW shares the same bit as DWMCI_INTMSK_HTO (bit 10), the interrupt bit needs to be polled for only if the volt switch command is issued. DWMCI_CMD_VOLT_SWITCH also needs to be set for subsequent clken commands after the volt switch. To ensure this, add a boolean member in the host private struct (herein named volt_switching), which informs if the last command issued was for volt switching or not. Signed-off-by: Kaustabh Chakraborty <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: dw_mmc: properly address command completion in dwmci_control_clken()Kaustabh Chakraborty
The current implementation polls for the DWMCI_CMD register, for the DWMCI_CMD_START bit to turn off, which indicates that the command has been completed. The problem with this approach is that it doesn't address the DWMCI_INTMSK_CDONE bit in the interrupt register, DWMCI_RINTSTS. As a result, subsequent commands result in timeout errors. Re-implement the waiting logic by polling for said interrupt status bit and setting it low if raised. Signed-off-by: Kaustabh Chakraborty <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: dw_mmc: do not skip dwmci_setup_bus() for same non-zero clock frequencyKaustabh Chakraborty
In dwmci_setup_bus(), if the requested frequency is equal to the current frequency, the function is returned, assuming no changes are required in associated registers. On certain SD cards, skipping in such situations may result in a timeout errors during MMC initialization. Due to the lack of documentation, the cause is unknown, but removing said check seems to fix the issue. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: dw_mmc: export dwmci_send_cmd() and dwmci_set_ios()Kaustabh Chakraborty
These commands are required by struct dm_mmc_ops. Any platform specific driver may use some or all of the functions in their own ops. Make them accessible by moving the prototype to the dwmmc.h header. Signed-off-by: Kaustabh Chakraborty <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-30mmc: exynos_dw_mmc: Add compatible string for Exynos5250Lukas Timmermann
This driver got successfully tested with an upstream device tree and an Exynos5250. The board in question is samsung-manta (Google Nexus 10) which we are getting ready for upstream. For the u-boot port was just this additional compatible string needed. Signed-off-by: Lukas Timmermann <[email protected]> Reviewed-by: Peng Fan <[email protected]> Signed-off-by: Peng Fan <[email protected]>
2025-10-29Merge tag 'u-boot-ufs-20251029' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-ufs - ti-j721e: Correct error detection - Fix wrong bitfield usage for Data Direction in Transfer Request - Add support for sending UFS attribute requests - Add bRefClkFreq attribute setting - Add ufshcd_dme_enable() and ufshcd_dme_reset() - unipro: Add PA_SCRAMBLING property - Cleanups: - Keep Makefile and Kconfig list sorted - Fold ufs-uclass into ufs and rename to ufs-uclass - amd-versal2: Fix indent - Call ufs_scsi_bind() from uclass .post_bind - renesas: Update Kconfig entry help text - New plaforms: - Rockchip UFS - Mediatek UFS - Renesas R-Car X5H UFS
2025-10-29Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscvTom Rini
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/28051 - riscv: dts: starfive: cherry-pick jh7110 updates from v6.18-rc1-dts - riscv: Add upstream boards Milk-V Mars CM and Mars CM Lite - timer: sifive_clint: Add GHRTv2 compaible string
2025-10-28Merge branch 'master' of git://source.denx.de/u-boot-usbTom Rini
- Fix assorted issues found by Smatch
2025-10-28Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-shTom Rini
2025-10-28MAINTAINERS: update my email addressRaymond Mao
Update my email address in the maintainers list. Signed-off-by: Raymond Mao <[email protected]>
2025-10-28Revert "clk: Return value calculated by ERR_PTR"Tom Rini
This reverts commit 644b4650ee57c429bede77f44752cc867dac0e00. While the intention of the above commit is correct, it leads to test failures in CI that need to be addressed at the same time. Signed-off-by: Tom Rini <[email protected]>
2025-10-28spi: altera_spi: Add missing <time.h> to altera_spi.cTom Rini
This driver references the get_timer macro while relying on an indirection inclusion of <time.h>. Add the missing include directly. Signed-off-by: Tom Rini <[email protected]>
2025-10-28spi: Tighten some spi driver dependenciesTom Rini
A few spi drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-10-28clk: Tighten some clock driver dependenciesTom Rini
A few clock drivers cannot build without access to some platform specific header files. Express those requirements in Kconfig as well. Signed-off-by: Tom Rini <[email protected]>
2025-10-28x86: Rename arch/x86/include/asm/pnp_def.h to include/pnp_def.hTom Rini
There is nothing x86-centric in this include file, and moving it will allow for some drivers to be compile-tested on sandbox. Signed-off-by: Tom Rini <[email protected]>
2025-10-28mtd: nvmxip: Make use of LBAF for printing lbaint_tTom Rini
When printing the contents of an lbaint_t variable we need to use LBAF to print it in order to get the correct format type depending on 32 or 64bit-ness. Signed-off-by: Tom Rini <[email protected]>
2025-10-28mtd: spi: sf_dataflash.c: Make use of 'z' for printing size_tTom Rini
When printing the contents of an size_t variable we need to use z prefix to the format character in order to get the correct format type depending on 32 or 64bit-ness. Signed-off-by: Tom Rini <[email protected]>
2025-10-28mtd: Correct dependency on SYS_FLASH_CHECKSUMTom Rini
This feature requires that CFG_SYS_FLASH_BASE is defined and this in turn is only done in the case of FLASH_CFI_DRIVER && !CFI_FLASH or in other words, when DM_MTD is not enabled. Signed-off-by: Tom Rini <[email protected]>
2025-10-28mtd: Add function prototype for mtd_read_oob_bf(...)Tom Rini
The function mtd_read_oob_bf is called by cmd/nand.c but does not have a prototype in any header. Add this to include/linux/mtd/mtd.h as that is the most logical place currently. Fixes: 1fac57720719 ("nand: Add a watch command") Signed-off-by: Tom Rini <[email protected]>
2025-10-28clk: Add missing <dm/device.h> to include/clk.hTom Rini
In this header we make direct references to some dm/device.h functions while not including the header directly. Add the missing include. Signed-off-by: Tom Rini <[email protected]>
2025-10-28mtd: nand: Prevent dereference of NULL pointerAndrew Goodbody
In nand_wait_ready there is a loop that includes a NULL check for chip->dev_ready before it is dereferenced. Use a NULL check once the loop is exited as well to cover the case where it exits due to a timeout and it is therefore not known if chip->dev_ready is NULL or not. This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Michael Trimarchi <[email protected]>
2025-10-28cmd: mtd: Prevent use of uninitialised variableAndrew Goodbody
ret maybe used uninitialised in some cases so instead initialise it first to prevent this. This issue was found by Smatch. Fixes: 9671243e8d10 (cmd: mtd: Use the subcmd infrastructure to declare mtd sub-commands) Signed-off-by: Andrew Goodbody <[email protected]> Reviewed-by: Quentin Schulz <[email protected]>
2025-10-28ARM: renesas: Drop 'imply MULTI_DTB_FIT_USER_DEFINED_AREA' linesTom Rini
As the code is today, we get a warning about "select" statements on "choice" options not doing anything. This is why for all of the boards which had an 'imply MULTI_DTB_FIT_USER_DEFINED_AREA' they then also had to set the option in the defconfig. Drop the imply lines here. Signed-off-by: Tom Rini <[email protected]>
2025-10-28ufs: Add UFS driver for Renesas R-Car X5HTuyen Dang
Add UFS driver for UFS controller present on Renesas R-Car X5H R8A78000. The controller uses different initialization code compared to previous generation UFS controller present in Renesas R-Car S4 R8A779F0, and the majority of the driver is the initialization, hence a new driver. [Marek: Clean driver up, add SCMI reset handling, use read_poll_timeout(), pass error values out of ufs_renesas_pre_init(), change the compatible string to "renesas,r8a78000-ufs" to align with previous generation "renesas,r8a779f0-ufs"] Signed-off-by: Yoshihiro Shimoda <[email protected]> Signed-off-by: Tuyen Dang <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Neil Armstrong <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28ufs: renesas: Update Kconfig entry help textMarek Vasut
The current Renesas UFS driver contains initialization code that is specific to R-Car S4 R8A779F0. The upcoming R-Car X5H initialization code is different and contained in a separate driver. Update the Kconfig entry help text for the current driver to help discern it from the X5H driver. No functional change. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28ufs: Call ufs_scsi_bind() from uclass .post_bindMarek Vasut
Instead of duplicating the ufs_scsi_bind() call in every driver, call it from UFS uclass .post_bind callback for every driver in one place. While doing so, inline ufs_scsi_bind() directly into ufs_post_bind() as trivial device_bind_driver() call. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] [narmstrong: also updated the rockchip and mediatek drivers] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28spi: spi-uclass: Use unwind gotoAndrew Goodbody
In _spi_get_bus_and_cs the check for stacked parallel support needing multiple chip select support does a direct return on error. Instead it should set the error code in ret and then use the unwind goto. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28spi: fspi: Logical or used instead of logical andAndrew Goodbody
In erratum_err050568 the test for apllicability uses logical or to check multiple chip IDs but this means the test will always evaluate to true as at least 1 term will always be true. Logical and should have been used so that the expression evaluates to true if all terms are true which would mean that no chip ID of interest was in use. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28spi: npcm-fiu: Remove repeated testAndrew Goodbody
In npcm_fiu_uma_operation to enter a code block nbytes must be non-zero. So testing for nbytes inside the code block is redundant and can be removed. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28spi: ich: Do not use uninitialised valueAndrew Goodbody
In ich_spi_exec_op_swseq the variable with_address is only assigned a value in the case of op->addr.nbytes being non-zero. Initialise with_address to zero. so that it is always valid. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28Merge patch series "spi: cadence_qspi: Fix Smatch reported issues"Tom Rini
Andrew Goodbody <[email protected]> says: Smatch reported issues with an off by 1 error in a test for a timeout and also an error exit that did not set an error code. Link: https://lore.kernel.org/r/[email protected]
2025-10-28clk: Return value calculated by ERR_PTRAndrew Goodbody
In clk_set_default_get_by_id ret is passed to ERR_PTR but nothing is done with the value that this calculates which is obviously not the intention of the code. This is confirmed by the code around where this function is called. Instead return the value from ERR_PTR. This issue found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]> Acked-by: Quentin Schulz <[email protected]>
2025-10-28Merge patch series "clk: versaclock: Fix two issues found by Smatch"Tom Rini
Andrew Goodbody <[email protected]> says: Should return value calculated by ERR_PTR as calling code attempts to check for it. Also do not dereference a pointer that could be an error pointer before checking it with IS_ERR. Link: https://lore.kernel.org/r/[email protected]
2025-10-28mmc: owl_mmc: Do not dereference data before NULL checkAndrew Goodbody
In owl_mmc_prepare_data there is a NULL check for the pointer data but it happens after data has already been dereferenced. Refactor the code so that the NULL check happens before any code dereferences data. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28gpio: intel_gpio: Initialise or0 and or1Andrew Goodbody
In intel_gpio_set_flags the two variables or0 and or1 may be used uninitialised. Correct this by setting initial values in the declaration. Also there is no need to use '|=' when the initial value is 0 and there is only one assignment performed to each variable so just use '=' instead. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28ufs: amd-versal2: Fix indentMarek Vasut
Fix indent, use tabs. No functional change. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28ufs: core: Rename ufs.c to ufs-uclass.cMarek Vasut
Previous commit folded existing ufs-uclass.c into ufs.c , which produced a nice and reviewable change , but also broke the UCLASS should be in *-uclass.c pattern. Fix it. Keep the change separate from the previous one to make this reviewable. Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28ufs: core: Fold ufs-uclass into ufsMarek Vasut
Move the few lines of ufs-uclass.c into ufs.c and remove the ufs-uclass.c . No functional change. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28ufs: core: Keep Makefile and Kconfig list sortedMarek Vasut
Sort the Makefile and Kconfig lists alphabetically. No functional change. Reviewed-by: Neil Armstrong <[email protected]> Signed-off-by: Marek Vasut <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Neil Armstrong <[email protected]>
2025-10-28spi: cadence_qspi: Do not return unset error codeAndrew Goodbody
In spi_calibration if the low range fails to calibrate then the code attempted to return the variable err but this has not been set in this case. Instead just return -EIO. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>
2025-10-28spi: cadence_qspi: Off by 1 in test for timeoutAndrew Goodbody
In cadence_qspi_apb_exec_flash_cmd the test for a timeout uses a post-decrement on the variable retry which will result in a value of -1 after the loop exit, or it would if the variable were signed. To fix this make retry a signed variable and test its value for being equal to -1. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <[email protected]>