]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
10 months agoconfigs: tiger-rk3588: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:15 +0000 (18:18 +0200)] 
configs: tiger-rk3588: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agoconfigs: jaguar-rk3588: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:14 +0000 (18:18 +0200)] 
configs: jaguar-rk3588: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agoconfigs: ringneck-px30: enable exFAT support
Quentin Schulz [Wed, 14 May 2025 16:18:13 +0000 (18:18 +0200)] 
configs: ringneck-px30: enable exFAT support

Our upcoming Mass Flasher solution will be storing boot artifacts on an
exFAT partition so enable its support.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agorockchip: px30: Fix hard dependency to DEBUG_UART_BOARD_INIT
Lukasz Czechowski [Tue, 20 May 2025 11:36:44 +0000 (13:36 +0200)] 
rockchip: px30: Fix hard dependency to DEBUG_UART_BOARD_INIT

Because DEBUG_UART_BOARD_INIT depends on DEBUG_UART, hard dependency
to DEBUG_UART_BOARD_INIT in ROCKCHIP_PX30 can cause warnings if
DEBUG_UART is disabled.
The DEBUG_UART_BOARD_INIT is already implied by ARCH_ROCKCHIP entry.
Remove hard dependency from ROCKCHIP_PX30, so that it will be
consistent with other rockchip boards.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agorockchip: px30: Weaken dependency TPL/SPL serial
Lukasz Czechowski [Tue, 20 May 2025 11:36:43 +0000 (13:36 +0200)] 
rockchip: px30: Weaken dependency TPL/SPL serial

Allow to disable serial console in TPL and SPL. Weak dependency
to SPL_SERIAL and TPL_SERIAL is also used in other Rockchip boards.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agodebug_uart: Replace debug functions with dummies if CONFIG_DEBUG_UART is not set
Lukasz Czechowski [Tue, 20 May 2025 11:36:42 +0000 (13:36 +0200)] 
debug_uart: Replace debug functions with dummies if CONFIG_DEBUG_UART is not set

In case DEBUG UART is not used, define dummy macros replacing
the actual function implementations that will not be available.
This allows to compile code and avoid linker errors.
Redefine the DEBUG_UART_FUNCS macro if DEBUG UART is not available,
to avoid compilation errors.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agoram: rockchip: Fix dependency of RAM_ROCKCHIP_DEBUG
Lukasz Czechowski [Tue, 20 May 2025 11:36:41 +0000 (13:36 +0200)] 
ram: rockchip: Fix dependency of RAM_ROCKCHIP_DEBUG

The RAM_ROCKCHIP_DEBUG can be used only if DEBUG_UART is
available.
The next commit introduces changes in definition of debug
uart functions, so that DEBUG_UART is required to be defined
in order to initialize uart and use print functions.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
10 months agoefi: stub: Change _debug_uart_putc function to inline
Lukasz Czechowski [Tue, 20 May 2025 11:36:40 +0000 (13:36 +0200)] 
efi: stub: Change _debug_uart_putc function to inline

Update definition of _debug_uart_putc to static inline.
This will allow to avoid compilation warnings about unused code
after introduction of patch changing debug uart functions to
dummies if CONFIG_DEBUG_UART is not set.
This also matches the instructions in include/debug_uart.h and
provides consistency with implementations for other platforms.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agoarm: uniphier: Change _debug_uart_putc function to inline
Lukasz Czechowski [Tue, 20 May 2025 11:36:39 +0000 (13:36 +0200)] 
arm: uniphier: Change _debug_uart_putc function to inline

Update the definition of _debug_uart_putc to static inline.
This matches the instructions in include/debug_uart.h and
provides consistency with implementations for other platforms.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
10 months agoarm: dts: remove k3-serdes.h
Heiko Thiery [Wed, 28 May 2025 09:05:37 +0000 (11:05 +0200)] 
arm: dts: remove k3-serdes.h

This file is a duplicate and also comes with the sync of the linux
mainline dts files. By removing this the one from the dts folder should
be taken that is more up-to-date.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
10 months agoarmv8: fix Clang warning on writing 32-bit variable to a 64-bit register
Raymond Mao [Tue, 27 May 2025 21:04:31 +0000 (14:04 -0700)] 
armv8: fix Clang warning on writing 32-bit variable to a 64-bit register

Clang is stricter than GCC when it comes to inline assembly and expects the
register to be written with explicitly same type of variable.

Fixes: c0e1775a867c ("armv8: Add arch-specific sysinfo platform driver")
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
10 months agoscripts/setlocalversion: sync with linux v6.15
Tom Rini [Mon, 26 May 2025 13:35:10 +0000 (07:35 -0600)] 
scripts/setlocalversion: sync with linux v6.15

The changes upstream since the last sync at commit 5c02350fa03d
("scripts/setlocalversion: sync with linux v6.9") are

e2ff1219a554 setlocalversion: add -e option
523f3dbc187a setlocalversion: work around "git describe" performance

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agocmd: bootmenu: permit to select bootmenu entry with a shortcut
Christian Marangi [Sun, 25 May 2025 13:43:58 +0000 (15:43 +0200)] 
cmd: bootmenu: permit to select bootmenu entry with a shortcut

Permit to select a bootmenu entry with a key shortcut. This is
especially useful in production or testing scenario to automate flashing
procedure or testing procedure.

The boot entry are changed to append the shortcut key to it.

Example:
      1. Run default boot command.
      2. Boot system via TFTP.
      3. Boot production system from NAND.
      4. Boot recovery system from NAND.
      5. Load production system via TFTP then write to NAND.
      6. Load recovery system via TFTP then write to NAND.
      7. Load BL31+U-Boot FIP via TFTP then write to NAND.
      8. Load BL2 preloader via TFTP then write to NAND.
      9. Reboot.
      a. Reset all settings to factory defaults.
      0. Exit

0 is always reserved for Exit to console.
On pressing the keyboard key 2, the bootmenu entry 2 is selected and
executed.

Up to 34 key shortcut (0 excluded as reserved) are supported from 1-9
and a-z.
If a shortcut key not present in the bootmenu list is pressed, it is
simply ignored and eventually the autoboot is interrupted.

Capital A-Z are converted to lower a-z and the related option is
selected.

Suggested-by: Weijie Gao <weijie.gao@mediatek.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Petr Štetiar <ynezz@true.cz>
10 months agoMerge patch series "Add baudrate accuracy compensation for MediaTek UART driver"
Tom Rini [Thu, 5 Jun 2025 20:31:02 +0000 (14:31 -0600)] 
Merge patch series "Add baudrate accuracy compensation for MediaTek UART driver"

Weijie Gao <weijie.gao@mediatek.com> says:

This patch series adds baudrate accuracy compensation for MediaTek UART
driver in high-speed mode 3.

Link: https://lore.kernel.org/r/cover.1747991898.git.weijie.gao@mediatek.com
10 months agoserial: mediatek: enable baudrate accuracy compensation
Weijie Gao [Fri, 23 May 2025 09:26:02 +0000 (17:26 +0800)] 
serial: mediatek: enable baudrate accuracy compensation

The high-speed UART from MediaTek supports baudrate accuracy
compensation when using high-speed mode 3.

This is done by calculating the first digit of the fraction part of
sample count value. The fraction value will be then used as the
reference to insert 0 to 10 sample cycle(s) to one frame (assume
that frame format is 8n1, i.e. 10 bits per frame).

The fracdiv_[l/m] registers are used to determine whether a bit in one frame
should be inserted with one sample cycle.

With typical 40MHz source clock, the actual baudrates with/without
accuracy compensation are:

Ideal    w/o compensation w/ compensation
======== ================ ===============
9600     9603             9600
115200   114942           115207
921600   930232           921659
3000000  3076923          3007519

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
10 months agoserial: mediatek: fix register names and offsets
Weijie Gao [Fri, 23 May 2025 09:25:55 +0000 (17:25 +0800)] 
serial: mediatek: fix register names and offsets

Fix UART register names and offsets according to the programming
guide to allow implementing some enhanced features.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
10 months agoMerge tag 'xilinx-for-v2025.07-rc4' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 5 Jun 2025 14:40:42 +0000 (08:40 -0600)] 
Merge tag 'xilinx-for-v2025.07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx/FPGA changes for v2025.07-rc4

usb:
- Fix regulator handling

net:
- Fix MII clock handling

phy:
- Fix GTR line logic for sgmii

pci:
- Fix pcireg_base logic

fpga:
- Fix change handling in intel_sdm_mb driver

10 months agomach-k3: am62ax: enable caches for the SPL stage
Anshul Dalal [Thu, 22 May 2025 12:33:04 +0000 (18:03 +0530)] 
mach-k3: am62ax: enable caches for the SPL stage

board_init_f for the am62a is missing the call to spl_enable_cache which
exists for all other am62 platforms (check am625_init.c &
am62p5_init.c).

This allows the usage of caches while loading and parsing the u-boot.img
FIT resulting in ~2x speedup in the A53 SPL stage.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
10 months agoboard: ti: am62ax: env: Use default MMC related args
Andrew Davis [Thu, 22 May 2025 16:40:13 +0000 (11:40 -0500)] 
board: ti: am62ax: env: Use default MMC related args

There are common MMC args for TI plats in include/environment/ti/mmc.env.
Since we already include this, there is no need to redefine these
MMC vars. Use the defaults.

This seems like something that could have been done while refactoring
these vars in the first place as it happened after this AM62A file
was available hence the fixes tag.

Reported-by: Chirag Shilwant <c-shilwant@ti.com>
Fixes: 3709b529156e ("env: ti: mmc.env: Move mmc related args to common place")
Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Chirag Shilwant <c-shilwant@ti.com>
Reviewed-by: Judith Mendez <jm@ti.com>
10 months agommc: am654_sdhci: Clear UHS_MODE_SELECT when <= MMC_HS_52
Judith Mendez [Thu, 22 May 2025 15:05:50 +0000 (10:05 -0500)] 
mmc: am654_sdhci: Clear UHS_MODE_SELECT when <= MMC_HS_52

This clears UHS_MODE_SELECT for timing modes <= MMC_HS_52.

When initializing to HS400 mode, the host controller downgrades to non-uhs
modes so clear UHS_MODE_SELECT at modes <= MMC_HS_52.

This fixes eMMC writes on j7200 EVM.

Fixes: 6067aa66b3bb ("mmc: am654_sdhci: Add am654_sdhci_set_control_reg")
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agox86: Correct condition for init_cache_f_r()
Simon Glass [Wed, 4 Jun 2025 13:09:02 +0000 (07:09 -0600)] 
x86: Correct condition for init_cache_f_r()

The condition here is reversed, which makes link and coral very slow,
leading to lab failures.

Fixes 6c171f7a184 ("common: board: make initcalls static")

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
10 months agotoradex: verdin-am62p: Add missing <linux/sizes.h>
Tom Rini [Wed, 4 Jun 2025 13:34:21 +0000 (07:34 -0600)] 
toradex: verdin-am62p: Add missing <linux/sizes.h>

This file uses SZ_1G but does not directly include <linux/sizes.h>, add
it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agousb: onboard-hub: Fix return type for regulator APIs
Padmarao Begari [Fri, 11 Apr 2025 05:55:38 +0000 (07:55 +0200)] 
usb: onboard-hub: Fix return type for regulator APIs

Apart from ENOENT observing return value as ENOSYS when
!DM_REGULATOR that's why cover both configurations.
Changed code is not working as operation should be "&&"
not "||" (ret != -ENOENT && ret != -ENOSYS).

Also fix the remove function where the regulator_set_enable_if_allowed()
function is returning an error.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/a2d520f14efc30fc28ec59881205e156dabbfcd9.1744350937.git.michal.simek@amd.com
10 months agoboard: toradex: add verdin am62p support
Parth Pancholi [Mon, 19 May 2025 15:47:45 +0000 (16:47 +0100)] 
board: toradex: add verdin am62p support

This adds initial support for the Toradex Verdin AM62P module.

The module consists of an TI AM62P family SoC, a TPS65219 PMIC, a
Gigabit Ethernet PHY, up to 8GB of LPDDR4 RAM, an eMMC, a TLA2024 ADC,
an I2C EEPROM, an RX8130 RTC, plus an optional Bluetooth/Wi-Fi module.

These specific changes adds support for Toradex Verdin AM62P Quad 2GB WB
IT module.

Link: https://www.toradex.com/computer-on-modules/verdin-arm-family/ti-am62p
Link: https://www.toradex.com/products/carrier-board/verdin-development-board-kit
Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
10 months agolinux/sizes.h: sync from kernel
Emanuele Ghidoli [Tue, 20 May 2025 09:09:17 +0000 (11:09 +0200)] 
linux/sizes.h: sync from kernel

The kernel added new size definitions and substituted the
boilerplate/reference to the license with a SPDX identifier.

Drop a local SZ_8G definition in MediaTek MT7988 SoC board file.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Weijie Gao <weijie.gao@mediatek.com>
10 months agotoradex: tdx-cfg-block: add new pid4 support
Vitor Soares [Mon, 19 May 2025 08:46:30 +0000 (09:46 +0100)] 
toradex: tdx-cfg-block: add new pid4 support

Add the new PID4 to the ConfigBlock handling:
 - 0098 Aquila iMX95 Hexa 16GB WB IT
 - 0099 Verdin AM62P Quad 2GB WB IT
 - 0201 SMARC iMX95 Hexa 8GB IT
 - 0202 SMARC iMX95 Hexa 4GB WB IT
 - 0203 SMARC iMX95 Hexa 4GB ET
 - 0204 SMARC iMX95 Hexa 2GB WB IT
 - 0205 SMARC iMX95 Hexa 2GB ET
 - 0206 SMARC iMX8M Plus Quad 4GB IT
 - 0207 SMARC iMX8M Plus Quad 2GB WB IT
 - 0208 SMARC iMX8M Plus Quad 2GB IT
 - 0209 SMARC iMX8M Plus Quadlite 1GB WB ET
 - 0210 SMARC iMX8M Plus Quadlite 1GB ET
 - 0211 Aquila AM69 Octa 32GB IT
 - 0212 Aquila AM69 Octa 16GB WB IT
 - 0213 Aquila AM69 Octa 16GB IT
 - 0214 Aquila AM69 Octa 8GB WB IT
 - 0215 Aquila AM69 Octa 8GB IT

Signed-off-by: Vitor Soares <vitor.soares@toradex.com>
10 months agopinctrl: gpio: sx150x: add Semtech SX150x I2C GPIO expander and pinctrl driver
Anis Chali [Sun, 18 May 2025 21:25:24 +0000 (17:25 -0400)] 
pinctrl: gpio: sx150x: add Semtech SX150x I2C GPIO expander and pinctrl driver

 implement a driver to use semtech pinctrl and
 gpio expander, this driver is adapted from a
 existent linux driver that is written by
 Gregory Bean <gbean@codeaurora.org>.

Signed-off-by: Anis Chali <chalianis1@gmail.com>
10 months agotools: fix handle leak in ifdtool.c
Anton Moryakov [Fri, 16 May 2025 15:25:38 +0000 (18:25 +0300)] 
tools: fix handle leak in ifdtool.c

Prevent file descriptor leaks by properly closing 'fd' and 'new_fd'
when fstat() or write() operations fail.

- Added close(fd) before return in open_for_read() if fstat() fails.
- Added close(new_fd) before return in write_image() if write() fails.
- No close needed if open() fails (fd == -1 is invalid).

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
10 months agoMerge tag 'qcom-more-for-2025.07' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 3 Jun 2025 15:00:52 +0000 (09:00 -0600)] 
Merge tag 'qcom-more-for-2025.07' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon

More Qualcomm fixes for 2025.07

* Adjust fdtfile logic to support more boards
* Support linux,code variable in qcom-pmic button driver
* Minor CLK API adjustments and apq8096/msm8916 fixes
* vbus regulator register fixes
* dragonboard410c KASLR support and other fixes

10 months agoMerge patch series "Audit include list for include/[a-m]*.h"
Tom Rini [Mon, 2 Jun 2025 23:43:56 +0000 (17:43 -0600)] 
Merge patch series "Audit include list for include/[a-m]*.h"

Tom Rini <trini@konsulko.com> says:

Hey all,

Related to my other series I've posted recently on cleaning up some
headers, this series here is the result of at least lightly auditing the
#includes used in include/[a-m]*.h. This ignores subdirectories, as at
least in part I think the top-level includes we've constructed are the
most likely places to have some extra transitive include paths. I'm sure
there's exceptions and I'll likely audit deeper once this first pass is
done. This only gets as far as "include/m*.h" because I didn't want this
to get too big. This also sets aside <miiphy.h> and <phy.h>. While
miiphy.h does not directly need <phy.h> there are *so* many users and I
think I had half of the tree just about not building when I first tried.
It might be worth further investigation, but it might just be OK as-is.

Link: https://lore.kernel.org/r/20250521230119.2084088-1-trini@konsulko.com
10 months agoglobal: Cleanup usage of "ETH_ALEN"
Tom Rini [Wed, 21 May 2025 22:51:22 +0000 (16:51 -0600)] 
global: Cleanup usage of "ETH_ALEN"

The value of "ETH_ALEN" is defined to 6 in <linux/if_ether.h>. This file
is included in <net.h>. In the places where we had ETH_ALEN but no
direct include of <net.h>, add <linux/if_ether.h>. In the places where
we had a custom name used, make use of ETH_ALEN instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/mtd.h: Cleanup usage
Tom Rini [Wed, 21 May 2025 22:51:21 +0000 (16:51 -0600)] 
include/mtd.h: Cleanup usage

There are only a few things found in <mtd.h> today. Go through and audit
the C files which include <mtd.h> and remove it when not required. Then,
add it to the files which had either missed it or had an indirect
inclusion of it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/mmc.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:20 +0000 (16:51 -0600)] 
include/mmc.h: Audit include list

This file does not need <linux/sizes.h> nor <linux/compiler.h> so remove
them. This exposes however that a number of other files had been relying
on this implicit include for <linux/sizes.h> so add that where needed.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/ide.h: Cleanup usage
Tom Rini [Wed, 21 May 2025 22:51:19 +0000 (16:51 -0600)] 
include/ide.h: Cleanup usage

At this point in time, <ide.h> provides the IDE_BUS macro and the
function prototype for ide_set_reset, which is used with IDE_RESET. The
only files which should include this header are the ones that either use
that macro or that function. Remove <blk.h> from <ide.h> and remove
<ide.h> from places which do not need it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/fat.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:18 +0000 (16:51 -0600)] 
include/fat.h: Audit include list

This file does not need <asm/cache.h> so remove it. However the file
common/spl/spl_fat.c does need it, so add it there.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/efi_loader.h, include/efi_tcg2.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:17 +0000 (16:51 -0600)] 
include/efi_loader.h, include/efi_tcg2.h: Audit include list

In include/efi_loader.h we do not directly need <log.h>, <part_efi.h>,
<pe.h> nor <linux/oid_registry.h> so remove them. In include/efi_tcg2.h
we make use of <part_efi.h> but did not include it, so add it directly.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/dwmmc.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:16 +0000 (16:51 -0600)] 
include/dwmmc.h: Audit include list

This file does not need <asm/cache.h> so remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/dw_hdmi.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:15 +0000 (16:51 -0600)] 
include/dw_hdmi.h: Audit include list

This file does not need <edid.h> so remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/dfu.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:14 +0000 (16:51 -0600)] 
include/dfu.h: Audit include list

This file does not need a forward declaration of 'struct list_head' as
it includes <linux/list.h> so remove it.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/compiler.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:13 +0000 (16:51 -0600)] 
include/compiler.h: Audit include list

This file does not need <time.h> so remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/cbfs.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:12 +0000 (16:51 -0600)] 
include/cbfs.h: Audit include list

This file does not need <compiler.h> but does directly need
<linux/types.h>.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/cadence-nand.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:11 +0000 (16:51 -0600)] 
include/cadence-nand.h: Audit include list

This file does not need <linux/mtd/mtd.h> but does directly need
<linux/types.h>.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/bootstd.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:10 +0000 (16:51 -0600)] 
include/bootstd.h: Audit include list

This file does not need <linux/list.h> so remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/bootflow.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:09 +0000 (16:51 -0600)] 
include/bootflow.h: Audit include list

This file does not need <linux/list.h> but does directly need
<linux/types.h>.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/bios_emul.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:08 +0000 (16:51 -0600)] 
include/bios_emul.h: Audit include list

This file does not need <pc.h> but does directly need
<linux/types.h>. Furthermore, arch/x86/lib/bios.c was getting <pci.h>
via <bios_emul.h> so add it there.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/arm_ffa.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:07 +0000 (16:51 -0600)] 
include/arm_ffa.h: Audit include list

This file does not need <linux/printk.h> but does directly need
<linux/types.h>.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoinclude/ahci.h: Audit include list
Tom Rini [Wed, 21 May 2025 22:51:06 +0000 (16:51 -0600)] 
include/ahci.h: Audit include list

This file does not need <pci.h> but does directly need <linux/types.h>.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoARM: Align image end to 8 bytes to fit DT alignment
Marek Vasut [Sun, 18 May 2025 16:02:58 +0000 (18:02 +0200)] 
ARM: Align image end to 8 bytes to fit DT alignment

Align U-Boot image end to 8 bytes to make sure DT alignment requirement
is fulfilled. This fixes a possible failure in fdt_find_separate() in
case the U-Boot image is aligned to 4 Bytes and DT is appended at the
end at already 8 Byte aligned offset.

Link: https://source.denx.de/u-boot/u-boot/-/issues/30
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Marek Vasut <marek.vasut@mailbox.org>
10 months agoarm/dts/qemu-sbsa: Fix interrupt
Patrick Rudolph [Tue, 27 May 2025 09:33:31 +0000 (11:33 +0200)] 
arm/dts/qemu-sbsa: Fix interrupt

Change the vcpumntirq in the GICv3 node from SPI to PPI.

Prevents Linux from complaining:
'[Firmware Bug]: CPU interface incapable of MMIO access'

Fixes: 6d722894fd48 "board: emulation: Add QEMU sbsa support"
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
10 months agoscripts/spelling.txt: Sync script with kernel v6.15
Tom Rini [Fri, 30 May 2025 14:05:48 +0000 (08:05 -0600)] 
scripts/spelling.txt: Sync script with kernel v6.15

Keep spelling.txt in sync with the version from kernel v6.15.

Reported-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Yao Zi <ziyao@disroot.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agomach-snapdragon: Update fdtfile logic to work for RB1 and RB2
Sumit Garg [Mon, 5 May 2025 12:43:33 +0000 (18:13 +0530)] 
mach-snapdragon: Update fdtfile logic to work for RB1 and RB2

RB1 and RB2 have three root compatibles where the last one can't be used
to decode fdtfile name (qcm* vs qrb*). So rather just rely on the first
compatible to retrieve the SoC name.

Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250505124333.12344-1-sumit.garg@kernel.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agobutton: qcom-pmic: allow to specify code in devicetree
Alexey Minnekhanov [Thu, 24 Apr 2025 01:48:11 +0000 (04:48 +0300)] 
button: qcom-pmic: allow to specify code in devicetree

Most device vendors put "Volume Down" button onto PMIC RESIN.
But Sony is special: see
dts/upstream/src/arm64/qcom/sdm630-sony-xperia-nile.dtsi or [1].
They put "Volume Down" on PMIC GPIO 7 where others usually put
"Volume Up", and KEY_VOLUMEUP is inside &pon_resin.

Currently if you boot U-Boot on such Sony device, you end up
with 2 "Volume Down" buttons, and no "Volume Up", which makes
navigating menu problematic.

Support reading devicetree "linux,code" property and override
statically defined button code & label based on that.

[1] https://elixir.bootlin.com/linux/v6.15-rc3/source/arch/
arm64/boot/dts/qcom/sdm630-sony-xperia-nile.dtsi#L263

Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Alexey Minnekhanov <alexeymin@minlexx.ru>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424014811.3809818-1-alexeymin@minlexx.ru
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoclk: qcom: apq8016: Fix SDCC clock warnings
Stephan Gerhold [Thu, 24 Apr 2025 09:16:46 +0000 (11:16 +0200)] 
clk: qcom: apq8016: Fix SDCC clock warnings

As of commit dc8754e8e408 ("clk/qcom: apq8016: improve clk_enable logging")
there are now warnings in the U-Boot console on DragonBoard 410c:

  apq8016_clk_enable: unknown clk id 122
  apq8016_clk_enable: unknown clk id 123
  apq8016_clk_enable: unknown clk id 124
  apq8016_clk_enable: unknown clk id 125

This is because we don't implement enable() properly for the SDCC clocks.
Currently they are being enabled as part of set_rate().

Fix this by moving the enable calls out of the apq8016_clk_init_sdc()
function and convert them to the equivalent GATE_CLK_POLLED() definitions.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424-apq8016-clock-fixes2-v2-6-fcc371c9e45f@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoclk: qcom: apq8016: Convert GATE_CLK() to GATE_CLK_POLLED()
Stephan Gerhold [Thu, 24 Apr 2025 09:16:45 +0000 (11:16 +0200)] 
clk: qcom: apq8016: Convert GATE_CLK() to GATE_CLK_POLLED()

Convert the usages of GATE_CLK() in clock-apq8016 to GATE_CLK_POLLED() to
make sure that we poll the status when enabling clocks:

 - PRNG_AHB_CLK is a vote clock, so we poll a different register address.
 - The USB clocks are simple branches, so enable/poll is the same register.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424-apq8016-clock-fixes2-v2-5-fcc371c9e45f@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoclk: qcom: Allow polling for clock status in qcom_gate_clk_en()
Stephan Gerhold [Thu, 24 Apr 2025 09:16:44 +0000 (11:16 +0200)] 
clk: qcom: Allow polling for clock status in qcom_gate_clk_en()

GATE_CLK() in its current state is unsafe: A simple write to the clock
enable register does not guarantee that the clock is immediately running.
Without polling the clock status, we may issue writes to registers before
the necessary clocks start running. This doesn't seem to cause issues in
U-Boot at the moment, but for example removing the CLK_OFF polling in TF-A
for the SMMU clocks on DB410c reliably triggers an exception during boot.

Make it possible to poll the branch clock status register, by adding a new
GATE_CLK_POLLED() macro that takes the extra register address. Existing
usages work just as before, without polling the clock status. Ideally all
usages should be updated to specify the correct poll address in the future.

The Qualcomm naming for these clocks is "branch" and not "gate", but let's
keep the existing naming for now to avoid confusion until all others
drivers have been converted.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424-apq8016-clock-fixes2-v2-4-fcc371c9e45f@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoclk: qcom: Use setbits_le32() for qcom_gate_clk_en()
Stephan Gerhold [Thu, 24 Apr 2025 09:16:43 +0000 (11:16 +0200)] 
clk: qcom: Use setbits_le32() for qcom_gate_clk_en()

The other clock enable functions in clock-qcom.c use setbits_le32() to
read/modify/write the enable registers. Use the same for qcom_gate_clk_en()
to simplify the code a bit.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424-apq8016-clock-fixes2-v2-3-fcc371c9e45f@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoclk: qcom: Move qcom_gate_clk_en() to C file
Stephan Gerhold [Thu, 24 Apr 2025 09:16:42 +0000 (11:16 +0200)] 
clk: qcom: Move qcom_gate_clk_en() to C file

This avoids having to inline it separately into every single clock driver,
when U-Boot is built with support for multiple SoCs.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424-apq8016-clock-fixes2-v2-2-fcc371c9e45f@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoclk: qcom: apq8016: Fix SDCC clock addresses
Stephan Gerhold [Thu, 24 Apr 2025 09:16:41 +0000 (11:16 +0200)] 
clk: qcom: apq8016: Fix SDCC clock addresses

The SDCC_...(n) macros in clock-apq8016.c result in the wrong addresses:

 - SDCC1: SDCC_APPS_CBCR(0) = ((0 * 0x1000) + 0x41018) = 0x41018
   Should be 0x42018, this is an invalid register close to the USB clocks.
 - SDCC2: SDCC_APPS_CBCR(1) = ((1 * 0x1000) + 0x41018) = 0x42018
   Should be 0x43018, this is the SDCC1 clock.

When we try to enable SDCC2, we actually end up enabling SDCC1. When we try
to enable SDCC1, we just issue some broken register writes.

This hasn't caused any trouble so far, because the boot firmware is keeping
both SDCC clocks running. However, if these clocks are disabled when
entering U-Boot, MMC initialization is failing.

Fix this by using the proper offset for the macros. The SDCC_CMD_RCGR() was
already correct, but change it the same way for consistency.

Fixes: 085921368b7d ("arm: Add support for Qualcomm Snapdragon family")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250424-apq8016-clock-fixes2-v2-1-fcc371c9e45f@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agopower: qcom_vbus_regulator: add and fix support for pmic variants
Rui Miguel Silva [Sat, 12 Apr 2025 17:41:31 +0000 (18:41 +0100)] 
power: qcom_vbus_regulator: add and fix support for pmic variants

Fix and add support for different pmic variants pm8x50b to handle
the vbus regulator.

Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org>
Link: https://lore.kernel.org/r/20250412174157.104419-1-rui.silva@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoboard: dragonboard410c: Enable support for KASLR in Linux
Stephan Gerhold [Thu, 17 Apr 2025 13:49:13 +0000 (15:49 +0200)] 
board: dragonboard410c: Enable support for KASLR in Linux

When booting Linux, there is currently the following warning in the console
when using the default dragonboard410c_defconfig:

  [    0.000000] KASLR disabled due to lack of seed

Fix this by enabling DM_RNG and RNG_MSM in the defconfig to generate the
KASLR seed:

  [    0.000000] KASLR enabled

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by:
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250417-db410c-fixes2-v1-3-76ad994da152@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoboard: dragonboard410c: Drop custom reduced malloc size
Stephan Gerhold [Thu, 17 Apr 2025 13:49:12 +0000 (15:49 +0200)] 
board: dragonboard410c: Drop custom reduced malloc size

At the moment, the dragonboard410c_defconfig specifies a custom
SYS_MALLOC_LEN, lower than the default for Qualcomm boards defined in
arch/arm/mach-snapdragon/Kconfig. It looks like it's too low, since
flashing larger sparse partition images using Fastboot fails with:

  FAILED (remote: 'Malloc failed for: CHUNK_TYPE_RAW')

We are not really that memory-constrained for U-Boot on DB410c, so fix
this by just dropping the custom malloc size and using the default.

Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by:
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250417-db410c-fixes2-v1-2-76ad994da152@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoboard: dragonboard410c: Fix button cmd name
Stephan Gerhold [Thu, 17 Apr 2025 13:49:11 +0000 (15:49 +0200)] 
board: dragonboard410c: Fix button cmd name

Commit 359e1d4a57e0 ("board: dragonboard410c: Use button_cmd instead of
custom code") was made in parallel with commit 8f5685d5d32f ("button:
qcom-pmic: prettify and standardise button labels"), which changed the
default button label from "vol_down" to "Volume Down". This is causing
errors in the console during boot now:

  No button labelled 'vol_down'

Fix this by using the new label.

Fixes: 359e1d4a57e0 ("board: dragonboard410c: Use button_cmd instead of custom code")
Fixes: 8f5685d5d32f ("button: qcom-pmic: prettify and standardise button labels")
Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org>
Reviewed-by:
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250417-db410c-fixes2-v1-1-76ad994da152@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoMerge tag 'u-boot-dfu-next-20250602' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 2 Jun 2025 14:43:10 +0000 (08:43 -0600)] 
Merge tag 'u-boot-dfu-next-20250602' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

u-boot-dfu-20250602

CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/26466

Usb gadget:
dwc2: Fix incorrect ULPI_UTMI_SEL bit setting
dwc2: Fix HBstLen setting for external DMA mode
dwc2: Various refactors to get the code closer to Linux
dwc2: Support reset logic for v4.20a

10 months agoMerge tag 'i2cfixes-for-2025.07-rc4' of https://source.denx.de/u-boot/custodians...
Tom Rini [Mon, 2 Jun 2025 14:42:04 +0000 (08:42 -0600)] 
Merge tag 'i2cfixes-for-2025.07-rc4' of https://source.denx.de/u-boot/custodians/u-boot-i2c

i2c bugfixes for v2025.07-rc4
- designware_i2c: fix globally wrong return value -1 into -ETIMEDOUT
  in driver, which leaded in silent errors as a timeout resulted in
  an uninitialized value being returned, potentially causing
  unexpected behavior.

10 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Mon, 2 Jun 2025 14:40:37 +0000 (08: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/26455

Thanks Conor and Yao for catching this issue.

- Revert "RISC-V 32/64 images support" to fix compatibility issue

10 months agoi2c: designware_i2c Return -ETIMEDOUT for timeout errors
Wojciech Szamocki [Fri, 23 May 2025 10:57:07 +0000 (12:57 +0200)] 
i2c: designware_i2c Return -ETIMEDOUT for timeout errors

Change the return value for timeout errors in i2c-designware from 1 to
-ETIMEDOUT. Returning errors as negative values is standard practice in the
u-boot, which enhances error handling consistency across the codebase.

The current behavior can lead to silent errors when functions check for
negative return values to identify errors. For example, in
`dm_i2c_reg_read` from i2c-uclass.c, a timeout results in an uninitialized
value being returned, potentially causing unexpected behavior.

Cc: Heiko Schocher <hs@denx.de>
Cc: Tom Rini <trini@konsulko.com>
Cc: Wojciech Szamocki <wojciech.szamocki@nokia.com>
Signed-off-by: Wojciech Szamocki <wojciech.szamocki@nokia.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
10 months agoRevert "riscv: image: Add new image type for RV64"
Mayuresh Chitale [Thu, 29 May 2025 03:30:51 +0000 (03:30 +0000)] 
Revert "riscv: image: Add new image type for RV64"

This reverts commit 14a4792a71db3561bea065415ac1f2ac69ef32b5 as
discussed in [1].

[1] https://lists.denx.de/pipermail/u-boot/2025-May/590841.html

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoRevert "riscv: Select appropriate image type"
Mayuresh Chitale [Thu, 29 May 2025 03:30:50 +0000 (03:30 +0000)] 
Revert "riscv: Select appropriate image type"

This reverts commit 027a316828528da95a77d20632370b1bc2823f0b as
discussed in [1].

[1] https://lists.denx.de/pipermail/u-boot/2025-May/590841.html

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoRevert "booti/bootm: riscv: Verify image arch type"
Mayuresh Chitale [Thu, 29 May 2025 03:30:49 +0000 (03:30 +0000)] 
Revert "booti/bootm: riscv: Verify image arch type"

This reverts commit 37b0b22d8b7bbed6aa95b6daed06dcbf4a66f211 as
discussed in [1].

[1] https://lists.denx.de/pipermail/u-boot/2025-May/590841.html

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agousb: dwc2: Refactor register operations with clrsetbits macros
Junhui Liu [Sun, 26 Jan 2025 08:29:59 +0000 (00:29 -0800)] 
usb: dwc2: Refactor register operations with clrsetbits macros

Refactor DWC2 USB gadget driver to replace manual read-modify-write
operations with `clrsetbits_le32`, `setbits_le32`, and `clrbits_le32`
macros, which simplify the code and improve readability.

Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250126-dwc2-clrsetbits-refactor-v1-1-68c27e1b6f84@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Replace uint<x>_t types with u<x>
Kongyang Liu [Fri, 10 Jan 2025 13:55:27 +0000 (21:55 +0800)] 
usb: dwc2: Replace uint<x>_t types with u<x>

Updates all instances of uint8_t, uint16_t, and uint32_t to u8, u16, and
u32 respectively, ensuring consistent use of kernel-preferred types and
resolving checkpatch.pl warnings.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-8-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Unify flush and reset logic with v4.20a support
Kongyang Liu [Fri, 10 Jan 2025 13:55:26 +0000 (21:55 +0800)] 
usb: dwc2: Unify flush and reset logic with v4.20a support

This patch merges flush and reset logic for both host and gadget code
into a common set of functions, reducing duplication. It also adds support
for the updated reset logic to compatible with core version since v4.20a.

This patch mainly refers to the patch in the kernel.
link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=65dc2e725286106f99c6f6b78e3d9c52c15f3a9c
Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-7-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Extract macro definitions to common header
Kongyang Liu [Fri, 10 Jan 2025 13:55:25 +0000 (21:55 +0800)] 
usb: dwc2: Extract macro definitions to common header

Some macros are shared between host and gadget code, causing duplicated
definitions. Move DWC2 macro definitions from host and gadget code into a
common header to reduce duplication.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-6-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Align macros with Linux kernel definitions
Kongyang Liu [Fri, 10 Jan 2025 13:55:24 +0000 (21:55 +0800)] 
usb: dwc2: Align macros with Linux kernel definitions

Update the DWC2 macros to match those used in the Linux kernel, making
it easier to synchronize updates with kernel. Also removed some unused
macros to cleanup the code.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-5-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Clean up with bitfield macros
Kongyang Liu [Fri, 10 Jan 2025 13:55:23 +0000 (21:55 +0800)] 
usb: dwc2: Clean up with bitfield macros

Use FIELD_PREP, FIELD_GET, BIT, and GENMASK macros to standardize bit
manipulation across the DWC2 code, improving readability and
maintainability without altering functionality.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-4-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Fix HBstLen setting for external DMA mode
Kongyang Liu [Fri, 10 Jan 2025 13:55:22 +0000 (21:55 +0800)] 
usb: dwc2: Fix HBstLen setting for external DMA mode

The loop used to calculate HBstLen for extern DMA mode does not produce
the correct result according to the datasheet [1]. Replacing that loop
with a direct calculation using LOG2 to correctly assign the burst length
in the GAHBCFG register for external DMA mode.

[1] https://rockchip.fr/RK312X%20TRM/chapter-26-usb-otg-2-0.pdf#page=24

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-3-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Fix incorrect ULPI_UTMI_SEL bit setting
Junhui Liu [Fri, 10 Jan 2025 13:55:21 +0000 (21:55 +0800)] 
usb: dwc2: Fix incorrect ULPI_UTMI_SEL bit setting

The ULPI_UTMI_SEL bit in the DWC2 driver was set incorrectly. According
to the datasheet [1], this bit should be set to 0 for UTMI interface and 1
for ULPI interface. The existing code had this logic reversed,
causing the interface selection to be incorrect.

This commit corrects the ULPI_UTMI_SEL bit setting to match the
datasheet's description. Referencing the kernel's code [2] also confirms
this fix.

[1] https://rockchip.fr/RK312X%20TRM/chapter-26-usb-otg-2-0.pdf#page=30
[2] https://github.com/torvalds/linux/blob/v6.13-rc3/drivers/usb/dwc2/core.c#L1106

Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-2-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agousb: dwc2: Extract register definitions to common header file
Kongyang Liu [Fri, 10 Jan 2025 13:55:20 +0000 (21:55 +0800)] 
usb: dwc2: Extract register definitions to common header file

The same registers are accessed in both the otg and gatet drivers of
dwc2, and these registers are repeatedly defined in these two parts.
Extract register definitions into a common header file to reduce
redundancy and make the code more maintainable.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Link: https://lore.kernel.org/r/20250110-dwc2-dev-v4-1-987f4fd6f8b2@pigmoral.tech
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agonet: gem: ignore tx_clk if MII is used
Martin Kaistra [Tue, 15 Apr 2025 15:04:00 +0000 (17:04 +0200)] 
net: gem: ignore tx_clk if MII is used

If the MII interface is used, the PHY is the clock master, thus don't
set the clock rate. On Zynq-7000, this will prevent the following
error:
  zynq_gem ethernet@e000b000: failed to set tx clock rate 25000000

Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de>
Link: https://lore.kernel.org/r/20250415150400.136723-1-martin.kaistra@linutronix.de
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agophy: zynqmp: Fix sgmii clk ctrl GTR lane bit shift
Frantisek Bohacek [Thu, 22 May 2025 06:07:03 +0000 (08:07 +0200)] 
phy: zynqmp: Fix sgmii clk ctrl GTR lane bit shift

The bitshift in GEM_CLK_CTRL register is five bits, not two. There are
four bits for each GEM, and one bit reserved in between.

This has caused that using more than one GEM is impossible,
additionally corrupting the GEM0's configuration, leaving GEM0
unusable as well (ie. if GEM0 and GEM1 are used, GEM1 configuration is
going to write to GEM0's registers wrong value, leaving GEM0 unusable)

Signed-off-by: Frantisek Bohacek <rutherther@ditigal.xyz>
Link: https://lore.kernel.org/r/20250522060703.4863-1-rutherther@ditigal.xyz
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agodrivers: fpga: intel_sdm_mb: Flush cache before FPGA configuration
Naresh Kumar Ravulapalli [Tue, 6 May 2025 01:28:51 +0000 (18:28 -0700)] 
drivers: fpga: intel_sdm_mb: Flush cache before FPGA configuration

FPGA configuration encounters failure when the cache is not flushed.
Add cache flushing to the memory region that holds the FPGA
configuration bitstream.

Signed-off-by: Naresh Kumar Ravulapalli <nareshkumar.ravulapalli@altera.com>
Link: https://lore.kernel.org/r/20250506012851.30039-1-nareshkumar.ravulapalli@altera.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agopci: zynqmp: Fix the pcireg base
Venkatesh Yadav Abbarapu [Fri, 16 May 2025 09:23:14 +0000 (14:53 +0530)] 
pci: zynqmp: Fix the pcireg base

The pcireg base is not assigned to any address, reading the
pcireg base with PS_LINKUP_OFFSET which is incorrect and
giving random values. So update the pcireg base from
devicetree so that we can read the valid PCIE link status
and PHY ready status.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Link: https://lore.kernel.org/r/20250516092314.939424-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
10 months agoMerge tag 'u-boot-imx-next-20250601' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sun, 1 Jun 2025 15:36:18 +0000 (09:36 -0600)] 
Merge tag 'u-boot-imx-next-20250601' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/26436

- Add i.MX6UL clk driver.
- Improve the .MX6UL NAND controller performance.
- Add imx6ulz BSH SMM M2B board.
- Several improvements for imx8m venice boards.

10 months agobsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2B board
Michael Trimarchi [Sat, 31 May 2025 14:54:33 +0000 (16:54 +0200)] 
bsh: imx6ulz_smm_m2: Add imx6ulz BSH SMM M2B board

Introduce the BSH SystemMaster (SMM) M2B board. Notably, the M2B is
designed to leverage the existing device tree of its predecessor, the M2.
The primary distinction arises from memory incompatibilities with the M2.
To address this, we've implemented a configuration system that allows for
selective inclusion of the desired memory components.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
10 months agoconfigs/imx6ulz_smm_m2_defconfig: Enable clock framework
Michael Trimarchi [Fri, 30 May 2025 15:16:46 +0000 (17:16 +0200)] 
configs/imx6ulz_smm_m2_defconfig: Enable clock framework

Enable the clock framework on the m2 platform.
This helps to increase the NAND controller performance.

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
10 months agomtd: nand: Add support for EDO mode 1-5 to IMX6ULL platform
Michael Trimarchi [Fri, 30 May 2025 15:16:45 +0000 (17:16 +0200)] 
mtd: nand: Add support for EDO mode 1-5 to IMX6ULL platform

The clock driver allows to boost the NAND performance
controller. Make changes to let it use the new clock driver

=> time nand read ${loadaddr} kernel

NAND read: device 0 offset 0x500000, size 0x800000
 8388608 bytes read: OK

time: 0.488 seconds

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
10 months agomtd: mxs_nand_dt: Move from clk_get/clk_enable to clk_bulk api
Michael Trimarchi [Fri, 30 May 2025 15:16:44 +0000 (17:16 +0200)] 
mtd: mxs_nand_dt: Move from clk_get/clk_enable to clk_bulk api

Make simple the clock registration and enable and allow later
to add support for other platforms

Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
10 months agoclk: imx: add i.MX6UL clk driver
Michael Trimarchi [Fri, 30 May 2025 15:16:43 +0000 (17:16 +0200)] 
clk: imx: add i.MX6UL clk driver

Add i.MX6UL clk driver for i.MX6UL CLK driver model usage

Reviewed-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Tested-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
10 months agoimx8mp-venice-gw74xx: add w_disable2 gpio configuration
Tim Harvey [Fri, 23 May 2025 17:20:18 +0000 (10:20 -0700)] 
imx8mp-venice-gw74xx: add w_disable2 gpio configuration

The GW74xx D revision has added a M2SKT_WDIS2# GPIO which routes to the
W_DISABLE2# pin of the M.2 socket.

Add the iomux and a line name for this and rename the existing
m2_wdis# signal to m2_wdis1#.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: append configuration string to model
Tim Harvey [Fri, 23 May 2025 17:20:17 +0000 (10:20 -0700)] 
board: venice: append configuration string to model

Append the optional board configuration string to the model info.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: update model representation for venice-flex
Tim Harvey [Fri, 23 May 2025 17:20:16 +0000 (10:20 -0700)] 
board: venice: update model representation for venice-flex

Update the model string representation for the Venice-Flex product
family (GW8xxx).

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: add FSA support
Tim Harvey [Fri, 23 May 2025 17:20:15 +0000 (10:20 -0700)] 
board: venice: add FSA support

The Gateworks Flexible Socket Adapters adapt common
busses such as SDIO/UART/USB/PCI to various connectors
such as M.2 B-Key, M.2 E-Key, M.2 M-Key, and MiniPCIe.

Each FSA has an EEPROM onboard describing its details as well as an
optional port-expander for configurable GPIO's.

Add support for identifying the FSA's and configuring their
details such as user description and GPIO's:
 - enable pca953x, pca954x and eeprom support for communicating
   with the I2C eeprom and gpio port expander on the FSA
 - add FSA detection support
 - add FSA gpio configuration support

Each FSA is identified in the device-tree by an alias to it's I2C
bus where an eeprom@54 node must exist as well as an gpio@20 node
for an io-expander. These nodes must be enabled so that
they can be probed to determine if they are actually present in
the system. If not present or not enabled the gpio expander can
not be used. This also requires livetree as the gpio expander
node if not present must be disabled.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: add imx8mp-gw82xx support
Tim Harvey [Fri, 23 May 2025 17:20:14 +0000 (10:20 -0700)] 
board: venice: add imx8mp-gw82xx support

The Gateworks GW82XX-2X is an ARM based single board computer (SBC)
comprised of the i.MX8M Plus based gw702x SoM and the gw82xx
baseboard featuring:
 - i.MX8M Plus SoC
 - LPDDR4 DRAM
 - eMMC FLASH
 - Gateworks System Controller (GSC)
 - microSD (1.8V/3.3V Capable)
 - panel status bi-color LED
 - pushbutton switch
 - fan controller with tachometer
 - USB Type-C connector
 - PCIe switch
 - 2x GbE RJ45 connectors
 - multi-protocol RS232/RS485/RS422 Serial ports
 - 2x Flexible Socket Adapters with SDIO/UART/USB/PCIe
   (for M.2 and miniPCIe expansion)
 - 2x isolated CAN
 - GPS
 - accelerometer
 - magnetometer
 - off-board connectors for: SPI, GPIO, I2C, ADC
 - Wide range DC power input
 - support for 802.3at PoE (via adapter)

Add support for it by providing its device-tree.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: flip logic for GSC supervisor enable
Tim Harvey [Fri, 23 May 2025 17:20:13 +0000 (10:20 -0700)] 
board: venice: flip logic for GSC supervisor enable

Flip the logic used to determine if a board has the proper hardware to
support enabling the GSC voltage supervisor so that we do not need to
keep adding new models to the list.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: use SOM model for PMIC adjustment on SOM
Tim Harvey [Fri, 23 May 2025 17:20:12 +0000 (10:20 -0700)] 
board: venice: use SOM model for PMIC adjustment on SOM

Use the SOM model to adjust PMIC settings on SOM's.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: use baseboard model for family
Tim Harvey [Fri, 23 May 2025 17:20:11 +0000 (10:20 -0700)] 
board: venice: use baseboard model for family

The venice family of baseboards which is normally GW7xxx
is being expanded to GW8xxx so we need to use the baseboard
number instead of the som.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: fix dram size for GW7901-SP486
Tim Harvey [Fri, 23 May 2025 17:20:10 +0000 (10:20 -0700)] 
board: venice: fix dram size for GW7901-SP486

The GW7901-SP486 with the exception of the -C revision has 2GB DRAM
loaded but incorrectly specifies 1GB in the EEPROM. Adjust the DRAM size
to account for this.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: fix dram bus config for GW7902/GW7903/GW7904
Tim Harvey [Fri, 23 May 2025 17:20:09 +0000 (10:20 -0700)] 
board: venice: fix dram bus config for GW7902/GW7903/GW7904

The GW7902/GW7903/GW7904 have an alternate databus layout affecting a few
of the DDRC and DDR PHY registers.

The 512MB configuration used this alternate bus layout. Change
the 512MB config to the standard bus configuration and add a generic
function to patch the DDRC/PHY configs for the alternate bus layout.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoboard: venice: move soc-specific dram config into soc-specific files
Tim Harvey [Fri, 23 May 2025 17:20:08 +0000 (10:20 -0700)] 
board: venice: move soc-specific dram config into soc-specific files

Move the determination of the dram timings into the soc-specific files.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agoconfigs: imx8m*_venice: enable GPT support
Tim Harvey [Fri, 23 May 2025 17:20:07 +0000 (10:20 -0700)] 
configs: imx8m*_venice: enable GPT support

Enable support for working with General Partition Tables via the 'gpt'
command. Also enable support for generating random UUID's for GPT.

See: doc/README.gpt for examples

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>