]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
5 months agoMerge tag 'mmc-power-2025-10-30' of https://source.denx.de/u-boot/custodians/u-boot-mmc
Tom Rini [Thu, 30 Oct 2025 13:31:14 +0000 (07:31 -0600)] 
Merge tag 'mmc-power-2025-10-30' of https://source.denx.de/u-boot/custodians/u-boot-mmc

CI: https://source.denx.de/u-boot/custodians/u-boot-mmc/-/pipelines/28083

- Add support for Samsung Exynos 7870 DW-MMC device
- Add support for Samsung S2MPU05 PMIC device
- Add compatible string for Exynos5250 in Exynos DW-MMC driver
- Add support for handling UHS-I voltage signaling without power-cycle
- Minor misc cleanup

5 months agommc: exynos_dw_mmc: guard execute_tuning
Peng Fan [Thu, 23 Oct 2025 13:11:04 +0000 (21:11 +0800)] 
mmc: exynos_dw_mmc: guard execute_tuning

Guard execute_tuning with MMC_SUPPORTS_TUNING, otherwise there will be
build failure:
drivers/mmc/exynos_dw_mmc.c:484:10: error: 'struct dm_mmc_ops' has no member
named 'execute_tuning'
         .execute_tuning = exynos_dwmmc_execute_tuning,
          ^~~~~~~~~~~~~~

Cc: Kaustabh Chakraborty <kauschluss@disroot.org>
Acked-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: regulator: Remove duplicate include of regulator_common.h
Tanmay Kathpalia [Thu, 23 Oct 2025 05:00:17 +0000 (22:00 -0700)] 
power: regulator: Remove duplicate include of regulator_common.h

Remove duplicate #include "regulator_common.h" statements from regulator
driver files.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agosdhci: Reorder interrupt flags in SDHCI_INT_DATA_MASK definition
Tanmay Kathpalia [Tue, 21 Oct 2025 20:54:10 +0000 (13:54 -0700)] 
sdhci: Reorder interrupt flags in SDHCI_INT_DATA_MASK definition

Reorder the SDHCI_INT_SPACE_AVAIL and SDHCI_INT_DATA_AVAIL flags in the
SDHCI_INT_DATA_MASK definition to match the bit order as defined in the
SDHCI specification and maintain consistency with the register layout.

The functional behavior remains unchanged as this only affects the
order of OR operations in the mask definition.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: sd: Handle UHS-I voltage signaling without power cycle
Tanmay Kathpalia [Tue, 21 Oct 2025 20:45:26 +0000 (13:45 -0700)] 
mmc: sd: Handle UHS-I voltage signaling without power cycle

Some boards have SD card connectors where the power rail cannot be switched
off by the driver. However there are various circumstances when a card
might be re-initialized, such as after system resume, warm re-boot, or
error handling. However, a UHS card will continue to use 1.8V signaling
unless it is power cycled.

If the card has not been power cycled, it may still be using 1.8V
signaling. According to the SD spec., the Bus Speed Mode (function group 1)
bits 2 to 4 are zero if the card is initialized at 3.3V signal level. Thus
they can be used to determine if the card has already switched to 1.8V
signaling. Detect that situation and try to initialize a UHS-I (1.8V)
transfer mode.

Signed-off-by: Tanmay Kathpalia <tanmay.kathpalia@altera.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: pmic: s2mps11: add support for Samsung S2MPU05 PMIC
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:28:21 +0000 (20:58 +0530)] 
power: pmic: s2mps11: add support for Samsung S2MPU05 PMIC

Samsung S2MPU05 PMIC is used in devices with the Exynos7870 SoC, it
houses voltage regulators and an RTC module. Add support for this device
variant in the driver, which also binds the corresponding voltage
regulator driver.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: regulator: s2mps11: add support for S2MPU05 PMIC
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:28:20 +0000 (20:58 +0530)] 
power: regulator: s2mps11: add support for S2MPU05 PMIC

Samsung's S2MPU05 PMIC is used by Exynos7870 SoC. It has 5 buck and 38
LDO regulators. Add support for this device variant in the driver.

Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: regulator: s2mps11: declaratively get/set regulator mode
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:28:19 +0000 (20:58 +0530)] 
power: regulator: s2mps11: declaratively get/set regulator mode

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: regulator: s2mps11: declaratively define LDOs and BUCKs
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:28:18 +0000 (20:58 +0530)] 
power: regulator: s2mps11: declaratively define LDOs and BUCKs

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: pmic: s2mps11: add support for allowing multiple device variants
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:28:17 +0000 (20:58 +0530)] 
power: pmic: s2mps11: add support for allowing multiple device variants

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agopower: pmic: s2mps11: change the probe function to bind
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:28:16 +0000 (20:58 +0530)] 
power: pmic: s2mps11: change the probe function to bind

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: exynos_dw_mmc: add compatible for exynos7870-dw-mshc-smu
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:14 +0000 (20:54 +0530)] 
mmc: exynos_dw_mmc: add compatible for exynos7870-dw-mshc-smu

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
Signed-off-by: Kaustabh Chakraborty <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: exynos_dw_mmc: add support for SD UHS mode
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:13 +0000 (20:54 +0530)] 
mmc: exynos_dw_mmc: add support for SD UHS mode

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: exynos_dw_mmc: add support for MMC HS200 and HS400 modes
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:12 +0000 (20:54 +0530)] 
mmc: exynos_dw_mmc: add support for MMC HS200 and HS400 modes

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: enable/disable VQMMC regulator only during MMC power cycle
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:11 +0000 (20:54 +0530)] 
mmc: enable/disable VQMMC regulator only during MMC power cycle

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 <kauschluss@disroot.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: dw_mmc: return error for invalid voltage setting
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:10 +0000 (20:54 +0530)] 
mmc: dw_mmc: return error for invalid voltage setting

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: dw_mmc: add voltage switch command flag
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:09 +0000 (20:54 +0530)] 
mmc: dw_mmc: add voltage switch command flag

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 <kauschluss@disroot.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: dw_mmc: properly address command completion in dwmci_control_clken()
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:08 +0000 (20:54 +0530)] 
mmc: dw_mmc: properly address command completion in dwmci_control_clken()

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 <kauschluss@disroot.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: dw_mmc: do not skip dwmci_setup_bus() for same non-zero clock frequency
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:07 +0000 (20:54 +0530)] 
mmc: dw_mmc: do not skip dwmci_setup_bus() for same non-zero clock frequency

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: dw_mmc: export dwmci_send_cmd() and dwmci_set_ios()
Kaustabh Chakraborty [Fri, 17 Oct 2025 15:24:06 +0000 (20:54 +0530)] 
mmc: dw_mmc: export dwmci_send_cmd() and dwmci_set_ios()

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 <kauschluss@disroot.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agommc: exynos_dw_mmc: Add compatible string for Exynos5250
Lukas Timmermann [Tue, 14 Oct 2025 11:40:32 +0000 (13:40 +0200)] 
mmc: exynos_dw_mmc: Add compatible string for Exynos5250

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 <uboot@timmermann.space>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
5 months agoMerge tag 'u-boot-ufs-20251029' of https://source.denx.de/u-boot/custodians/u-boot-ufs
Tom Rini [Wed, 29 Oct 2025 13:41:43 +0000 (07:41 -0600)] 
Merge tag 'u-boot-ufs-20251029' of 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

5 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Wed, 29 Oct 2025 13:40:40 +0000 (07:40 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv

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

5 months agophy: qcom-qmp-ufs: Import SM7150 tables from Linux
Danila Tikhonov [Sun, 31 Aug 2025 00:46:01 +0000 (02:46 +0200)] 
phy: qcom-qmp-ufs: Import SM7150 tables from Linux

Import the init sequence for the UFS on SM7150.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Jens Reidel <adrian@mainlining.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250831004602.699953-4-adrian@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agopinctrl: qcom: add SM7150 pinctrl driver
Danila Tikhonov [Sun, 31 Aug 2025 00:46:00 +0000 (02:46 +0200)] 
pinctrl: qcom: add SM7150 pinctrl driver

This SoC features a pinctrl block with north, south, and west tiles
accessible to the AP.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Co-developed-by: Jens Reidel <adrian@mainlining.org>
Signed-off-by: Jens Reidel <adrian@mainlining.org>
Link: https://lore.kernel.org/r/20250831004602.699953-3-adrian@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoclk/qcom: add driver for SM7150 GCC
Danila Tikhonov [Sun, 31 Aug 2025 00:45:59 +0000 (02:45 +0200)] 
clk/qcom: add driver for SM7150 GCC

Add a clock driver for the SM7150 SoC. This driver can enable necessary
clocks for UART, UFS, USB, and MMC.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Co-developed-by: Jens Reidel <adrian@mainlining.org>
Signed-off-by: Jens Reidel <adrian@mainlining.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250831004602.699953-2-adrian@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoserial: msm: Use single character mode
Stephan Gerhold [Mon, 8 Sep 2025 11:31:26 +0000 (13:31 +0200)] 
serial: msm: Use single character mode

The UART DM controller supports different channel data packing modes,
either the 4-character packing mode (where 32-bit are read/written at once)
or the single-character mode (where only a single character is read/written
at a time). The 4-character mode can be more efficient, but the
single-character mode is much easier to implement.

At the moment, serial_msm uses the 4-character mode. Since the
dm_serial_ops operate on one character at the time, the code goes through
quite some hoops in order to break this down to single characters. This
code is prone to race conditions (e.g. priv->chars_cnt is read from the
registers, then a command is issued, what if another char came in
inbetween?). It also seems to cause another subtle issue with autoboot:

Unlike the previous autoboot failures that happened when UART was
disconnected, this problem occurs when UART is connected and open in a
terminal: For EFI boot, the console size is queried in efi_console.c
query_console_serial() by sending an ANSI escape code via UART. For some
reason, with the current driver we get yet another 0x00 byte (UART break
event?) when reading the reply from serial input. Because of that, reading
the console size fails in efi_console.c, the actual reply remains in the
UART buffer, and later the boot flow aborts because it detects input after
printing a prompt.

Rather than trying to fix the issue in the current complicated approach,
switch the driver to use the single-character mode. This is simple and
straightforward to implement without race conditions:

 - We write one character at a time to UARTDM_TF, as long as the TX FIFO
   has space available (TX_READY). To flush the console before starting
   Linux, we wait for TX_EMPTY.

 - We read one character at a time from UARTDM_RF and strip off the
   additional error information (assuming there is something in the
   RX FIFO, as indicated by RX_READY).

In this mode, querying the serial console size works and autoboot is no
longer interrupted. The overall code is also much shorter.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-6-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoserial: msm: Re-enable after resetting
Stephan Gerhold [Mon, 8 Sep 2025 11:31:25 +0000 (13:31 +0200)] 
serial: msm: Re-enable after resetting

The documentation for the UART controller in the APQ8016E specifies that
both RESET and ENABLE commands must be issued to set up the receiver and
transmitter, but at the moment we only issue RESET. This doesn't seem to
cause issues in practice (looks like the reset already re-enables the
receiver/transmitter), but let's add the two writes to RX_ENABLE/TX_ENABLE
to better match the recommendations in the documentation.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-5-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoserial: msm: Reset after writing to DMEN
Stephan Gerhold [Mon, 8 Sep 2025 11:31:24 +0000 (13:31 +0200)] 
serial: msm: Reset after writing to DMEN

According to the documentation of the UART controller in the APQ8016E TRM,
clearing bits inside UARTDM_DMEN requires resetting the transmitter and/or
receiver. We do reset inside uart_dm_init(), but before writing to
UARTDM_DMEN. This doesn't seem to cause problems in practice, but let's
move the reset to the end of uart_dm_init() to better match the
recommendations in the documentation.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-4-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoserial: msm: Cleanup register naming
Stephan Gerhold [Mon, 8 Sep 2025 11:31:23 +0000 (13:31 +0200)] 
serial: msm: Cleanup register naming

Some of the register definitions are inconsistently named (likely copied
as-is from Qualcomm's Little Kernel/LK bootloader, which uses the
MSM_BOOT_UART naming scheme). Rename them to be in line with the other
register definitions and move them up to be next to the related register.

No functional change.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-3-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoRevert "serial: serial_msm: Delay initialization to let pins stabilize"
Stephan Gerhold [Mon, 8 Sep 2025 11:31:22 +0000 (13:31 +0200)] 
Revert "serial: serial_msm: Delay initialization to let pins stabilize"

There have been issues with autoboot on DB410c for years, where autoboot
gets interrupted by spurious input on the UART console. Back in 2021, I've
tried to fix this by inserting a delay before UART initialization, but it
has turned out this is not working reliably either.

It looks like the root cause has always been the lack of bias-pull-up,
which was causing the RX line to be floating when UART is disconnected.
The delay does not seem to be needed anymore when applying bias-pull-up,
so drop it again in favor of the proper fix.

This reverts commit ad7e967738a9c639e07cf50b83ffccdf9a8537b0.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-2-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoboard: dragonboard410c: Drop now unneeded bootph-all for console
Stephan Gerhold [Mon, 8 Sep 2025 11:31:21 +0000 (13:31 +0200)] 
board: dragonboard410c: Drop now unneeded bootph-all for console

This is applied for all devices upstream in Linux now (when using the
console-specific pinctrl templates).

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Tested-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250908-db410c-autoboot-fixes-v2-1-316ed98e0143@linaro.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoqcom_defconfig: Enable pinctrl driver for SDM630/660
Alexey Minnekhanov [Sun, 14 Sep 2025 14:56:20 +0000 (17:56 +0300)] 
qcom_defconfig: Enable pinctrl driver for SDM630/660

Pin controller driver for SDM630/636/660 SoCs was added in
b4420a0c9ed ("drivers: pinctrl: Add Qualcomm SDM630/660 TLMM driver"),
but not enabled in qcom_defconfig. Correct that omission.

Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250914145620.1962735-1-alexeymin@minlexx.ru
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agogpio: qcom: Support GPIOs on PM7325 PMIC
Luca Weiss [Wed, 17 Sep 2025 12:52:22 +0000 (14:52 +0200)] 
gpio: qcom: Support GPIOs on PM7325 PMIC

The GPIOs on PM7325 work fine using the qcom_spmi_gpio driver and
enables the use of the Volume Up button Fairphone 5 smartphone.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250917-spmi-gpio-pm7325-v1-1-6b75c2c62d8b@fairphone.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoboard/qualcomm: add debug config fragment for SM6350
Luca Weiss [Wed, 17 Sep 2025 12:47:42 +0000 (14:47 +0200)] 
board/qualcomm: add debug config fragment for SM6350

Add a fragment similar to others to enable earlycon.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agoqcom_defconfig: Enable SM6350 clock and pinctrl drivers
Luca Weiss [Wed, 17 Sep 2025 12:47:41 +0000 (14:47 +0200)] 
qcom_defconfig: Enable SM6350 clock and pinctrl drivers

Enable the drivers so that SM6350 devices can boot with qcom_defconfig.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agogpio: qcom: Support GPIOs on PM6350 PMIC
Luca Weiss [Wed, 17 Sep 2025 12:47:40 +0000 (14:47 +0200)] 
gpio: qcom: Support GPIOs on PM6350 PMIC

The GPIOs on PM6350 work fine using the qcom_spmi_gpio driver and
enables the use of the Volume Up button Fairphone 4 smartphone.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agoregulator: qcom-rpmh-regulator: add support for pm6150l regulators
Luca Weiss [Wed, 17 Sep 2025 12:47:39 +0000 (14:47 +0200)] 
regulator: qcom-rpmh-regulator: add support for pm6150l regulators

Add the pm6150l regulator data found on the Qualcomm SM6350 platform.
The tables are imported from the Linux driver. The SMPS regulators were
not added now.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agophy: qcom: Add SM6350 to QMP UFS PHY driver
Luca Weiss [Wed, 17 Sep 2025 12:47:38 +0000 (14:47 +0200)] 
phy: qcom: Add SM6350 to QMP UFS PHY driver

The UFS on SM6350 can reuse the SDM845 configuration, just like in
Linux.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agoiommu: qcom-smmu: Add qcom,sm6350-smmu-500 compatible
Luca Weiss [Wed, 17 Sep 2025 12:47:37 +0000 (14:47 +0200)] 
iommu: qcom-smmu: Add qcom,sm6350-smmu-500 compatible

This SoC doesn't have the generic compatible.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agodrivers: pinctrl: Add Qualcomm SM6350 TLMM driver
Luca Weiss [Wed, 17 Sep 2025 12:47:36 +0000 (14:47 +0200)] 
drivers: pinctrl: Add Qualcomm SM6350 TLMM driver

Add support for TLMM pin controller block (Top Level Mode Multiplexer)
on SM6350 SoC, with support for special pins.

Correct pin configuration is required for working debug UART and eMMC/SD
cards.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agoclk/stub: add sm6350-rpmh clock
Luca Weiss [Wed, 17 Sep 2025 12:47:35 +0000 (14:47 +0200)] 
clk/stub: add sm6350-rpmh clock

Stub the RPMh clock controller on SM6350.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agoclk/qcom: Add SM6350 clock driver
Luca Weiss [Wed, 17 Sep 2025 12:47:34 +0000 (14:47 +0200)] 
clk/qcom: Add SM6350 clock driver

Add Clock driver for the GCC block found in the SM6350 SoC.

Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
5 months agoqcom_defconfig: enable watchdog command
Paul Sajna [Wed, 24 Sep 2025 02:05:19 +0000 (19:05 -0700)] 
qcom_defconfig: enable watchdog command

CONFIG_WDT and CONFIG_WDT_QCOM were previously added in
https://source.denx.de/u-boot/u-boot/-/commit/530764de9fc8539cd2354501e9c42804bc4c4dac

U-Boot and Linux pet the watchdog by default,
but it's helpful to also have the command to control the watchdog,
(CONFIG_CMD_WDT)
so it can be manually disabled by the user, for example, if the kernel
is expected to stall during debugging with kgdb.

Signed-off-by: Paul Sajna <sajattack@postmarketos.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250923-qcom_config_enable_cmd_wdt-v1-1-70cccf9f01e3@postmarketos.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoboard/qualcomm: add debug config fragment for MSM8953
Luca Weiss [Wed, 24 Sep 2025 11:30:11 +0000 (13:30 +0200)] 
board/qualcomm: add debug config fragment for MSM8953

Add a fragment similar to others to enable earlycon.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250924-2025-10-misc-v1-5-7e75842ca714@fairphone.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agodoc: board/qualcomm: Clean up debug options for QUP UART
Luca Weiss [Wed, 24 Sep 2025 11:30:10 +0000 (13:30 +0200)] 
doc: board/qualcomm: Clean up debug options for QUP UART

CONFIG_BAUDRATE is not relevant for the QUP driver, and neither is
CONFIG_DEBUG_UART_SKIP_INIT so remove them from the doc.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250924-2025-10-misc-v1-4-7e75842ca714@fairphone.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoserial: msm-geni: Update kconfig name for DEBUG_UART_MSM_GENI
Luca Weiss [Wed, 24 Sep 2025 11:30:09 +0000 (13:30 +0200)] 
serial: msm-geni: Update kconfig name for DEBUG_UART_MSM_GENI

The previous description "Qualcomm snapdragon" barely tells the user
anything, update the name so that it's clear which configs the user can
choose between, namely the older QUP driver, or the newer GENI driver.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250924-2025-10-misc-v1-3-7e75842ca714@fairphone.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoclk/qcom: sm8250: Remove unused defines
Luca Weiss [Wed, 24 Sep 2025 11:30:08 +0000 (13:30 +0200)] 
clk/qcom: sm8250: Remove unused defines

Clean up some defines which are not used in the driver.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250924-2025-10-misc-v1-2-7e75842ca714@fairphone.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agopinctrl: qcom: sc7280: Fix offset of UFS_RESET
Luca Weiss [Wed, 24 Sep 2025 11:30:07 +0000 (13:30 +0200)] 
pinctrl: qcom: sc7280: Fix offset of UFS_RESET

There's no WEST, SOUTH or NORTH in sc7280 pinctrl. Fix the offset of the
ufs_reset pin.

Fixes: 51ec7fdb64b ("pinctrl: qcom: add sc7280 pinctrl driver")
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250924-2025-10-misc-v1-1-7e75842ca714@fairphone.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agogpio: qcom_spmi: add pm660l
David Wronek [Fri, 3 Oct 2025 10:01:13 +0000 (12:01 +0200)] 
gpio: qcom_spmi: add pm660l

This is used for the volume keys on some SDM670 devices.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: David Wronek <david.wronek@mainlining.org>
Link: https://lore.kernel.org/r/20251003-sdm670-v2-5-52c0fa481286@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoqcom_defconfig: enable pinctrl for sdm670
David Wronek [Fri, 3 Oct 2025 10:01:12 +0000 (12:01 +0200)] 
qcom_defconfig: enable pinctrl for sdm670

Enable the SDM670 pinctrl driver.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: David Wronek <david.wronek@mainlining.org>
Link: https://lore.kernel.org/r/20251003-sdm670-v2-4-52c0fa481286@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agopinctrl: qcom: add sdm670 pinctrl driver
David Wronek [Fri, 3 Oct 2025 10:01:11 +0000 (12:01 +0200)] 
pinctrl: qcom: add sdm670 pinctrl driver

Add a pinctrl driver for the TLMM block found in the SDM670 SoC.

Signed-off-by: David Wronek <david.wronek@mainlining.org>
Link: https://lore.kernel.org/r/20251003-sdm670-v2-3-52c0fa481286@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoclk/qcom: sdm845: add support for sdm670
David Wronek [Fri, 3 Oct 2025 10:01:10 +0000 (12:01 +0200)] 
clk/qcom: sdm845: add support for sdm670

The global clock controller on SDM670 is similar to SDM845, so let's add
support here.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: David Wronek <david.wronek@mainlining.org>
Link: https://lore.kernel.org/r/20251003-sdm670-v2-2-52c0fa481286@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoclk/stub: add sdm670 rpmh clock
David Wronek [Fri, 3 Oct 2025 10:01:09 +0000 (12:01 +0200)] 
clk/stub: add sdm670 rpmh clock

Necessary for MMC to successfully probe all clocks.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: David Wronek <david.wronek@mainlining.org>
Link: https://lore.kernel.org/r/20251003-sdm670-v2-1-52c0fa481286@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agophy: qcom: Rework Kconfig logic around MSM8916_USB_PHY
Tom Rini [Fri, 3 Oct 2025 20:39:27 +0000 (14:39 -0600)] 
phy: qcom: Rework Kconfig logic around MSM8916_USB_PHY

This PHY driver is required by USB_EHCI_MSM and not useful on its own.
Rather than have it be a prompted option, it should (and currently is)
select'd by USB_EHCI_MSM. Remove the prompt for this option and then
correct the dependency chain (it must select PHY).

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20251003203927.1030052-1-trini@konsulko.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agogpio: qcom: qcom_spmi_gpio: add compatible for pm6150l
Jens Reidel [Sun, 5 Oct 2025 15:44:43 +0000 (17:44 +0200)] 
gpio: qcom: qcom_spmi_gpio: add compatible for pm6150l

Add support for the GPIOs in the PM6150L to the new driver.

Signed-off-by: Jens Reidel <adrian@mainlining.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20251005154443.71477-1-adrian@mainlining.org
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoqcom_defconfig: Enable meminfo command with mapping
Abbarapu Venkatesh Yadav [Fri, 10 Oct 2025 05:12:00 +0000 (10:42 +0530)] 
qcom_defconfig: Enable meminfo command with mapping

Enable meminfo command to be able to see where things are mapped.

Signed-off-by: Abbarapu Venkatesh Yadav <venkyada@qti.qualcomm.com>
Link: https://lore.kernel.org/r/20251010051200.2313081-1-venkyada@qti.qualcomm.com
Signed-off-by: Casey Connolly <kcxt@postmarketos.org>
5 months agoMerge branch 'master' of git://source.denx.de/u-boot-usb
Tom Rini [Wed, 29 Oct 2025 01:43:19 +0000 (19:43 -0600)] 
Merge branch 'master' of git://source.denx.de/u-boot-usb

- Fix assorted issues found by Smatch

5 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Wed, 29 Oct 2025 01:43:02 +0000 (19:43 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

5 months agoMAINTAINERS: update my email address
Raymond Mao [Tue, 28 Oct 2025 20:26:17 +0000 (13:26 -0700)] 
MAINTAINERS: update my email address

Update my email address in the maintainers list.

Signed-off-by: Raymond Mao <raymondmaoca@gmail.com>
5 months agoRevert "clk: Return value calculated by ERR_PTR"
Tom Rini [Tue, 28 Oct 2025 19:24:44 +0000 (13:24 -0600)] 
Revert "clk: Return value calculated by ERR_PTR"

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 <trini@konsulko.com>
5 months agospi: altera_spi: Add missing <time.h> to altera_spi.c
Tom Rini [Mon, 4 Aug 2025 21:57:18 +0000 (15:57 -0600)] 
spi: altera_spi: Add missing <time.h> to altera_spi.c

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 <trini@konsulko.com>
5 months agospi: Tighten some spi driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:57:17 +0000 (15:57 -0600)] 
spi: Tighten some spi driver dependencies

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 <trini@konsulko.com>
5 months agoclk: Tighten some clock driver dependencies
Tom Rini [Fri, 18 Jul 2025 01:14:18 +0000 (19:14 -0600)] 
clk: Tighten some clock driver dependencies

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 <trini@konsulko.com>
5 months agox86: Rename arch/x86/include/asm/pnp_def.h to include/pnp_def.h
Tom Rini [Fri, 11 Jul 2025 15:20:19 +0000 (09:20 -0600)] 
x86: Rename arch/x86/include/asm/pnp_def.h to include/pnp_def.h

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 <trini@konsulko.com>
5 months agomtd: nvmxip: Make use of LBAF for printing lbaint_t
Tom Rini [Fri, 11 Jul 2025 15:16:01 +0000 (09:16 -0600)] 
mtd: nvmxip: Make use of LBAF for printing lbaint_t

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 <trini@konsulko.com>
5 months agomtd: spi: sf_dataflash.c: Make use of 'z' for printing size_t
Tom Rini [Fri, 11 Jul 2025 15:15:57 +0000 (09:15 -0600)] 
mtd: spi: sf_dataflash.c: Make use of 'z' for printing size_t

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 <trini@konsulko.com>
5 months agomtd: Correct dependency on SYS_FLASH_CHECKSUM
Tom Rini [Fri, 4 Jul 2025 21:45:56 +0000 (15:45 -0600)] 
mtd: Correct dependency on SYS_FLASH_CHECKSUM

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 <trini@konsulko.com>
5 months agomtd: Add function prototype for mtd_read_oob_bf(...)
Tom Rini [Wed, 2 Jul 2025 01:06:09 +0000 (19:06 -0600)] 
mtd: Add function prototype for mtd_read_oob_bf(...)

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 <trini@konsulko.com>
5 months agoclk: Add missing <dm/device.h> to include/clk.h
Tom Rini [Wed, 2 Jul 2025 01:05:33 +0000 (19:05 -0600)] 
clk: Add missing <dm/device.h> to include/clk.h

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 <trini@konsulko.com>
5 months agomtd: nand: Prevent dereference of NULL pointer
Andrew Goodbody [Tue, 1 Jul 2025 16:12:44 +0000 (17:12 +0100)] 
mtd: nand: Prevent dereference of NULL pointer

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 <andrew.goodbody@linaro.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
5 months agocmd: mtd: Prevent use of uninitialised variable
Andrew Goodbody [Thu, 26 Jun 2025 10:49:32 +0000 (11:49 +0100)] 
cmd: mtd: Prevent use of uninitialised variable

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 <andrew.goodbody@linaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
5 months agoARM: renesas: Drop 'imply MULTI_DTB_FIT_USER_DEFINED_AREA' lines
Tom Rini [Sat, 15 Mar 2025 01:29:11 +0000 (19:29 -0600)] 
ARM: renesas: Drop 'imply MULTI_DTB_FIT_USER_DEFINED_AREA' lines

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 <trini@konsulko.com>
5 months agoufs: Add UFS driver for Renesas R-Car X5H
Tuyen Dang [Tue, 28 Oct 2025 14:22:27 +0000 (15:22 +0100)] 
ufs: Add UFS driver for Renesas R-Car X5H

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 <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Tuyen Dang <tuyen.dang.xa@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251028142335.18125-7-marek.vasut+renesas@mailbox.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: renesas: Update Kconfig entry help text
Marek Vasut [Tue, 28 Oct 2025 14:22:26 +0000 (15:22 +0100)] 
ufs: renesas: Update Kconfig entry help text

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 <neil.armstrong@linaro.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20251028142335.18125-6-marek.vasut+renesas@mailbox.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: Call ufs_scsi_bind() from uclass .post_bind
Marek Vasut [Tue, 28 Oct 2025 14:22:25 +0000 (15:22 +0100)] 
ufs: Call ufs_scsi_bind() from uclass .post_bind

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 <neil.armstrong@linaro.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20251028142335.18125-5-marek.vasut+renesas@mailbox.org
[narmstrong: also updated the rockchip and mediatek drivers]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agospi: spi-uclass: Use unwind goto
Andrew Goodbody [Mon, 6 Oct 2025 15:09:25 +0000 (16:09 +0100)] 
spi: spi-uclass: Use unwind goto

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 <andrew.goodbody@linaro.org>
5 months agospi: fspi: Logical or used instead of logical and
Andrew Goodbody [Tue, 12 Aug 2025 16:42:59 +0000 (17:42 +0100)] 
spi: fspi: Logical or used instead of logical and

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 <andrew.goodbody@linaro.org>
5 months agospi: npcm-fiu: Remove repeated test
Andrew Goodbody [Tue, 12 Aug 2025 16:29:07 +0000 (17:29 +0100)] 
spi: npcm-fiu: Remove repeated test

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 <andrew.goodbody@linaro.org>
5 months agospi: ich: Do not use uninitialised value
Andrew Goodbody [Tue, 12 Aug 2025 13:31:16 +0000 (14:31 +0100)] 
spi: ich: Do not use uninitialised value

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 <andrew.goodbody@linaro.org>
5 months agoMerge patch series "spi: cadence_qspi: Fix Smatch reported issues"
Tom Rini [Tue, 28 Oct 2025 16:32:26 +0000 (10:32 -0600)] 
Merge patch series "spi: cadence_qspi: Fix Smatch reported issues"

Andrew Goodbody <andrew.goodbody@linaro.org> 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/20250812-cadence_qspi-v1-0-0d693d810145@linaro.org
5 months agoclk: Return value calculated by ERR_PTR
Andrew Goodbody [Thu, 3 Jul 2025 14:40:46 +0000 (15:40 +0100)] 
clk: Return value calculated by ERR_PTR

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 <andrew.goodbody@linaro.org>
Acked-by: Quentin Schulz <quentin.schulz@cherry.de>
5 months agoMerge patch series "clk: versaclock: Fix two issues found by Smatch"
Tom Rini [Tue, 28 Oct 2025 15:59:55 +0000 (09:59 -0600)] 
Merge patch series "clk: versaclock: Fix two issues found by Smatch"

Andrew Goodbody <andrew.goodbody@linaro.org> 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/20250723-clk_versaclock-v1-0-9d70f2530871@linaro.org
5 months agommc: owl_mmc: Do not dereference data before NULL check
Andrew Goodbody [Thu, 31 Jul 2025 11:11:47 +0000 (12:11 +0100)] 
mmc: owl_mmc: Do not dereference data before NULL check

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 <andrew.goodbody@linaro.org>
5 months agogpio: intel_gpio: Initialise or0 and or1
Andrew Goodbody [Fri, 25 Jul 2025 12:04:26 +0000 (13:04 +0100)] 
gpio: intel_gpio: Initialise or0 and or1

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 <andrew.goodbody@linaro.org>
5 months agoufs: amd-versal2: Fix indent
Marek Vasut [Tue, 28 Oct 2025 14:22:24 +0000 (15:22 +0100)] 
ufs: amd-versal2: Fix indent

Fix indent, use tabs. No functional change.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20251028142335.18125-4-marek.vasut+renesas@mailbox.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: core: Rename ufs.c to ufs-uclass.c
Marek Vasut [Tue, 28 Oct 2025 14:22:23 +0000 (15:22 +0100)] 
ufs: core: Rename ufs.c to ufs-uclass.c

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 <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20251028142335.18125-3-marek.vasut+renesas@mailbox.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: core: Fold ufs-uclass into ufs
Marek Vasut [Tue, 28 Oct 2025 14:22:22 +0000 (15:22 +0100)] 
ufs: core: Fold ufs-uclass into ufs

Move the few lines of ufs-uclass.c into ufs.c and remove the
ufs-uclass.c . No functional change.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20251028142335.18125-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: core: Keep Makefile and Kconfig list sorted
Marek Vasut [Tue, 28 Oct 2025 14:22:21 +0000 (15:22 +0100)] 
ufs: core: Keep Makefile and Kconfig list sorted

Sort the Makefile and Kconfig lists alphabetically. No functional change.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Link: https://patch.msgid.link/20251028142335.18125-1-marek.vasut+renesas@mailbox.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agospi: cadence_qspi: Do not return unset error code
Andrew Goodbody [Tue, 12 Aug 2025 11:34:39 +0000 (12:34 +0100)] 
spi: cadence_qspi: Do not return unset error code

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 <andrew.goodbody@linaro.org>
5 months agospi: cadence_qspi: Off by 1 in test for timeout
Andrew Goodbody [Tue, 12 Aug 2025 11:34:38 +0000 (12:34 +0100)] 
spi: cadence_qspi: Off by 1 in test for timeout

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 <andrew.goodbody@linaro.org>
5 months agoMAINTAINERS: Add UFS to MediaTek section
Igor Belwon [Sat, 11 Oct 2025 19:10:07 +0000 (21:10 +0200)] 
MAINTAINERS: Add UFS to MediaTek section

Add the UFS driver files to the ARM MediaTek section in MAINTAINERS.
Add myself as its maintainer.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
Link: https://patch.msgid.link/20251011-mtk-ufs-uboot-v1-4-a05f991ee150@mentallysanemainliners.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: Add MediaTek UFS driver
Igor Belwon [Sat, 11 Oct 2025 19:10:06 +0000 (21:10 +0200)] 
ufs: Add MediaTek UFS driver

Add the UFS driver for MediaTek platforms.

Loosely based on the Linux driver, this UFS driver can successfully get a
link and R/W access to the UFS chip on the MediaTek MT6878 mobile SoC,
when U-Boot is running as lk, or as the kernel (Secure world access is
not tested)

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
Link: https://patch.msgid.link/20251011-mtk-ufs-uboot-v1-3-a05f991ee150@mentallysanemainliners.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: unipro: Add PA_SCRAMBLING property
Igor Belwon [Sat, 11 Oct 2025 19:10:05 +0000 (21:10 +0200)] 
ufs: unipro: Add PA_SCRAMBLING property

This property is required for proper I/O access on the MediaTek MT6878
UFS controller, and is part of UniPro specifications.

Signed-off-by: Igor Belwon <igor.belwon@mentallysanemainliners.org>
Link: https://patch.msgid.link/20251011-mtk-ufs-uboot-v1-2-a05f991ee150@mentallysanemainliners.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: rockchip: Add initial support
Shawn Lin [Mon, 20 Oct 2025 08:16:22 +0000 (16:16 +0800)] 
ufs: rockchip: Add initial support

This patch adds initial support for UFS controller on Rockchip
platforms.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://patch.msgid.link/1760948182-128561-2-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: core: Add ufshcd_dme_enable() and ufshcd_dme_reset()
Shawn Lin [Mon, 20 Oct 2025 08:16:21 +0000 (16:16 +0800)] 
ufs: core: Add ufshcd_dme_enable() and ufshcd_dme_reset()

In order for host drivers to use.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://patch.msgid.link/1760948182-128561-1-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: Add bRefClkFreq attribute setting
Jared McArthur [Fri, 10 Oct 2025 19:55:56 +0000 (14:55 -0500)] 
ufs: Add bRefClkFreq attribute setting

A UFS device needs its bRefClkFreq attribute set to the correct value
before switching to high speed. If bRefClkFreq is set to the wrong
value, all transactions after the power mode change will fail.

The bRefClkFreq depends on the host controller and the device.
Query the device's current bRefClkFreq and compare with the ref_clk
specified in the device-tree. If the two differ, set the bRefClkFreq
to the device-tree's ref_clk frequency.

Taken from Linux kernel v6.17 (drivers/ufs/core/ufshcd.c and
include/ufs/ufs.h) and ported to U-Boot.

Signed-off-by: Jared McArthur <j-mcarthur@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Link: https://patch.msgid.link/20251010195556.1772611-3-j-mcarthur@ti.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: Add support for sending UFS attribute requests
Jared McArthur [Fri, 10 Oct 2025 19:55:55 +0000 (14:55 -0500)] 
ufs: Add support for sending UFS attribute requests

Some UFS attributes must be set before a UFS device is initialized.
Add ufshcd_query_attr and ufshcd_query_attr_retry to send UFS
attribute requests.

Taken from Linux Kernel v6.17 (drivers/ufs/core/ufshcd.c) and ported
to U-Boot.

Signed-off-by: Jared McArthur <j-mcarthur@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Link: https://patch.msgid.link/20251010195556.1772611-2-j-mcarthur@ti.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: Fix wrong bitfield usage for Data Direction in Transfer Request
Kunihiko Hayashi [Fri, 10 Oct 2025 02:45:57 +0000 (11:45 +0900)] 
ufs: Fix wrong bitfield usage for Data Direction in Transfer Request

Commit d232d7fdbf6f ("ufs: core: sync ufshci.h with Linux v6.12") updated
the Data Direction values from bitmask values to simple enumerations.

Before:
    enum {
        UTP_NO_DATA_TRANSFER    = 0x00000000,
        UTP_HOST_TO_DEVICE      = 0x02000000,
        UTP_DEVICE_TO_HOST      = 0x04000000,
    };

Updated:
    enum utp_data_direction {
        UTP_NO_DATA_TRANSFER    = 0,
        UTP_HOST_TO_DEVICE      = 1,
        UTP_DEVICE_TO_HOST      = 2,
    };

However, the U-Boot code still uses these values directly without shifting,
and resulting in wrong bitfield placement in the Transfer Request
Descriptor.

This fixes the issue by applying the necessary shift to align the value.

Fixes: d232d7fdbf6f ("ufs: core: sync ufshci.h with Linux v6.12")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patch.msgid.link/20251010024557.673787-1-hayashi.kunihiko@socionext.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
5 months agoufs: ti-j721e: Correct error detection
Andrew Goodbody [Tue, 7 Oct 2025 11:42:12 +0000 (12:42 +0100)] 
ufs: ti-j721e: Correct error detection

In ti_j721e_ufs_probe there is a call to clk_get_rate but the code after
that attempts to detect an error from that call incorrectly uses
IS_ERR_VALUE.  Instead the test should just be for regular error codes.
The call returns an unsigned long so that needs to be cast to a signed type
first of all.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Anshul Dalal <anshuld@ti.com>
Link: https://patch.msgid.link/20251007-ufs_ti-v2-1-501f575b6947@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>