]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
10 months agonet: mvpp2: Use field just assigned in error test
Andrew Goodbody [Tue, 5 Aug 2025 14:18:19 +0000 (15:18 +0100)] 
net: mvpp2: Use field just assigned in error test

In mvpp2_probe the code attempts to get a value for "gop-port-id" and
assigns it to port->gop_id but it then tests port->id for being equal to
-1. That is an impossible test as port->id is a field of type u8 so
cannot be negative. Change the test to port->gop_id.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: mvpp2: Cannot test unsigned variable to be negative
Andrew Goodbody [Tue, 5 Aug 2025 14:18:18 +0000 (15:18 +0100)] 
net: mvpp2: Cannot test unsigned variable to be negative

In phy_info_parse all uses of the variable phyaddr are as an int so
declaring as u32 is not useful and prevents the test for an error return
from fdtdec_get_int ever detecting an error. Change phyaddr to be an
int.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: mvpp2: Return -ENOMEM for failed alloc
Andrew Goodbody [Tue, 5 Aug 2025 14:18:17 +0000 (15:18 +0100)] 
net: mvpp2: Return -ENOMEM for failed alloc

Instead of returning -1 on a failed alloc, return -ENOMEM.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: mvpp2: Fix impossible test
Andrew Goodbody [Tue, 5 Aug 2025 14:18:16 +0000 (15:18 +0100)] 
net: mvpp2: Fix impossible test

You cannot test an unsigned char to be >= 256. Instead make the
variables start and end to be ints.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: mv88e6xxx: Fix logical operator instead of bitwise
Andrew Goodbody [Tue, 5 Aug 2025 11:14:14 +0000 (12:14 +0100)] 
net: mv88e6xxx: Fix logical operator instead of bitwise

In mv88e6xxx_port_enable when attempting to mask out the previous
settings of two bits a logical operator was used instead of a bitwise
operator. Fix this.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: mediatek: Use correct variable for return
Andrew Goodbody [Tue, 5 Aug 2025 11:04:00 +0000 (12:04 +0100)] 
net: mediatek: Use correct variable for return

In mtk_eth_of_to_plat, the last error check has the value in
'priv->phy_addr' but returns ret. Correct to return 'priv->phy_addr'
instead.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: ldpaa_eth: Fix buffer overflow in memset
Andrew Goodbody [Tue, 5 Aug 2025 10:52:00 +0000 (11:52 +0100)] 
net: ldpaa_eth: Fix buffer overflow in memset

In ldpaa_eth_open a memset is used to initialise a struct to 0 but the
size passed is that of a different struct. Correct to pass the sizeof
the struct that is being initialised.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: add missing SPDX-License-Identifier for files originating from LiMon
Max Merchel [Thu, 14 Aug 2025 12:03:52 +0000 (14:03 +0200)] 
net: add missing SPDX-License-Identifier for files originating from LiMon

The header of LiMon imported files reference a License file which
does not exist in U-Boot. Some files were forgotten when adding the
SPDX-License-Identifier.
The LiMon files were originally licensed under GPLv2 as can be seen in
commit [2ea91039].

Based on this commit, add the correct SPDX license identifier.
While at it drop the reference to the non-existing License file from all
LiMon files and update the SPDX-License-Identifier to SPDX version 3.

Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com>
10 months agonet: lwip: add Kconfig option to show ICMP unreachable errors
Jerome Forissier [Tue, 12 Aug 2025 12:43:19 +0000 (14:43 +0200)] 
net: lwip: add Kconfig option to show ICMP unreachable errors

Add Kconfig symbol LWIP_ICMP_SHOW_UNREACH which, when enabled, prints a
message to the console upon reception of ICMP unreachable messages. For
example:

 $ make qemu_arm64_lwip_defconfig
 $ qemu-system-aarch64 -M virt -cpu max -nographic -bios u-boot.bin
 [...]
 => dhcp
 DHCP client bound to address 10.0.2.15 (0 ms)
 => tftp 192.168.0.100:69:Image
 Using virtio-net#32 device
 TFTP from server 192.168.0.100; our IP address is 10.0.2.15
 Filename 'Image'.
 Load address: 0x40200000
 Loading: ICMP destination unreachable (host unreachable) from 192.168.0.16
 Timeout!
 => tftp 192.168.0.16:69:Image
 Using virtio-net#32 device
 TFTP from server 192.168.0.16; our IP address is 10.0.2.15
 Filename 'Image'.
 Load address: 0x40200000
 Loading: ICMP destination unreachable (port unreachable) from 192.168.0.16
 Timeout!
 =>

Submitted upstream as https://github.com/lwip-tcpip/lwip/pull/73.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
10 months agolwip: icmp: allow reporting ICMP destination unreachable
Jerome Forissier [Tue, 12 Aug 2025 12:43:18 +0000 (14:43 +0200)] 
lwip: icmp: allow reporting ICMP destination unreachable

Allow reporting ICMP destination unreachable messages via a user-defined
callback.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
10 months agonet: phy: broadcom: add support for BCM54612E
Jim Liu [Thu, 7 Aug 2025 05:29:31 +0000 (13:29 +0800)] 
net: phy: broadcom: add support for BCM54612E

It's Broadcom PHY simply described as single-port
RGMII 10/100/1000BASE-T PHY.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
10 months agonet: designware: Fix get_timer value overflow
Jim Liu [Thu, 7 Aug 2025 05:28:32 +0000 (13:28 +0800)] 
net: designware: Fix get_timer value overflow

get_timer returns a ulong value representing system time in ms.
On a 64-bit system, this ulong value is 64 bits long. However,
the driver stores it in a 32-bit unsigned integer, which overflows
after 49 days up time, causing the driver to get an incorrect time.

Replace the unsigned int variable with a ulong type to properly store
the value returned by get_timer.

Signed-off-by: Stanley Chu <yschu@nuvoton.com>
Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
10 months agophy: marvell: Cannot test unsigned field to be negative
Andrew Goodbody [Wed, 6 Aug 2025 16:43:25 +0000 (17:43 +0100)] 
phy: marvell: Cannot test unsigned field to be negative

In comphy_cp110_init_serdes_map in comphy_cp110.c there are two fields
in cfg, comphy_lanes_count and comphy_mux_bitcount, which are fetched
from the FDT blob with fdtdec_get_int which returns an int. These two
fields are then tested for being negative. However the fields are
declared as unsigned so those tests must always fail. Change the
declaration of those fields to be int instead of u32 and the code will
work as expected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
10 months agophy: marvell: Fix off by 1 limit checks
Andrew Goodbody [Wed, 6 Aug 2025 16:43:24 +0000 (17:43 +0100)] 
phy: marvell: Fix off by 1 limit checks

The limit checks in get_speed_string and get_type_string are off by 1 as
they do not account for the maximum index into an array that can be used
is 1 less than the number of elements in that array. Adjust the limit
checks to allow for this.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Stefan Roese <stefan.roese@mailbox.org>
10 months agonet: phy: vitesse: Fix incorrect test for timeout
Andrew Goodbody [Wed, 6 Aug 2025 09:37:26 +0000 (10:37 +0100)] 
net: phy: vitesse: Fix incorrect test for timeout

In vsc8514_config there is a while loop for detecting a config failure
using a timeout counter with a post-decrement. In the case of a timeout
this will result in the loop exiting with timeout == -1 so use that as
the test below the loop to detect that the timeout occurred.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
10 months agonet: octeontx: Free allocated memory on error
Andrew Goodbody [Tue, 5 Aug 2025 15:45:49 +0000 (16:45 +0100)] 
net: octeontx: Free allocated memory on error

In octeontx_smi_probe if an error is detected then memory that was
allocated is not freed. Small refactor of the code to use a common
return and free memory. Also return -ENOMEM for an allocation failure.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: octeontx: Remove unneeded test
Andrew Goodbody [Tue, 5 Aug 2025 15:45:48 +0000 (16:45 +0100)] 
net: octeontx: Remove unneeded test

In nicvf_cq_handler there is a test for !cqe_count which will return if
true so it is guaranteed that cqe_count will true after that point. This
makes the later test for cqe_count redundant so it can be removed.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: octeontx: Remove unneeded code
Andrew Goodbody [Tue, 5 Aug 2025 15:45:47 +0000 (16:45 +0100)] 
net: octeontx: Remove unneeded code

In nicvf_rcv_pkt_handler there is no need to initialise err as it is
assigned to immediately after. Also the test for !pkt will return if
true meaning that pkt is guaranteed to be true after that code block and
so no need to test for it and the redundant test can be removed.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Sun, 17 Aug 2025 23:48:14 +0000 (17:48 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

Fixes for newer revision of Retronix R-Car V4H Sparrow Hawk and fixes
for boards which enable POSITION_INDEPENDENT and also set non-zero
CONFIG_TEXT_BASE.

10 months agoconfigs: Remove redundant CONFIG_TEXT_BASE assignments for Renesas defconfigs
Lad Prabhakar [Wed, 23 Jul 2025 08:10:15 +0000 (09:10 +0100)] 
configs: Remove redundant CONFIG_TEXT_BASE assignments for Renesas defconfigs

The Renesas board defconfigs explicitly set CONFIG_TEXT_BASE=0x50000000,
however U-Boot's POSITION_INDEPENDENT=y build default already places text
at 0x0. These hardcoded overrides are therefore unnecessary and will be
pruned automatically in upcoming resyncs.

Remove the CONFIG_TEXT_BASE lines from the following defconfigs:
  - hihope_rzg2_defconfig
  - r8a77970_eagle_defconfig
  - r8a77970_v3msk_defconfig
  - r8a77990_ebisu_defconfig
  - r8a77995_draak_defconfig
  - r8a779a0_falcon_defconfig
  - renesas_rzg2l_smarc_defconfig
  - rz2_beacon_defconfig
  - silinux_ek874_defconfig

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agoarm64: dts: renesas: r8a779g3: Describe generic SPI NOR support on Retronix R-Car...
Marek Vasut [Wed, 13 Aug 2025 21:25:56 +0000 (23:25 +0200)] 
arm64: dts: renesas: r8a779g3: Describe generic SPI NOR support on Retronix R-Car V4H Sparrow Hawk board

Retronix R-Car V4H Sparrow Hawk EVTA1 is populated with Spansion S25FS512S,
EVTB1 is populated with Winbond W77Q51NW. Describe the SPI NOR using generic
"jedec,spi-nor" compatible, because both flashes can be auto-detected based
on their built-in IDs.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agoarm64: dts: renesas: r8a779g3: Set VDDQ18_25_AVB voltage on Retronix R-Car V4H Sparro...
Marek Vasut [Wed, 13 Aug 2025 21:26:59 +0000 (23:26 +0200)] 
arm64: dts: renesas: r8a779g3: Set VDDQ18_25_AVB voltage on Retronix R-Car V4H Sparrow Hawk EVTB1

The Retronix R-Car V4H Sparrow Hawk EVTB1 uses 1V8 IO voltage supply
for VDDQ18_25_AVB power rail. Update the AVB0 pinmux to reflect the
change in IO voltage. Since the VDDQ18_25_AVB power rail is shared,
all four AVB0, AVB1, AVB2, TSN0 PFC/GPIO POC[7..4] registers have to
be configured the same way.

Correct the voltage for EVTA1 boards accordingly by patching the U-Boot
control DT in SPL.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agoarm64: dts: renesas: r8a779g3: Invert microSD voltage selector on Retronix R-Car...
Marek Vasut [Wed, 13 Aug 2025 21:26:27 +0000 (23:26 +0200)] 
arm64: dts: renesas: r8a779g3: Invert microSD voltage selector on Retronix R-Car V4H Sparrow Hawk EVTB1

Invert the polarity of microSD voltage selector on Retronix R-Car V4H
Sparrow Hawk board. The voltage selector was not populated on prototype
EVTA1 boards, and is implemented slightly different on EVTB1 boards. As
the EVTA1 boards are from a limited run and generally not available,
update the DT to make it compatible with EVTB1 microSD voltage selector.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agoarm64: renesas: r8a779g3: Enable xHCI USB on Retronix R-Car V4H Sparrow Hawk board
Marek Vasut [Wed, 6 Aug 2025 00:58:30 +0000 (02:58 +0200)] 
arm64: renesas: r8a779g3: Enable xHCI USB on Retronix R-Car V4H Sparrow Hawk board

Enable support for PCIe based xHCI USB 3.0 driver and USB mass
storage support on Retronix R-Car V4H Sparrow Hawk board .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agoarm64: renesas: r8a779g3: Disable dual-rank DRAM on Retronix R-Car V4H ES2 Sparrow...
Marek Vasut [Wed, 6 Aug 2025 00:57:14 +0000 (02:57 +0200)] 
arm64: renesas: r8a779g3: Disable dual-rank DRAM on Retronix R-Car V4H ES2 Sparrow Hawk

The R-Car V4H SoC before rev.3.0 can not support dual-rank LPDDR5 DRAM.
This affects 16 GiB dual-rank DRAM configuration of Retronix R-Car V4H
Sparrow Hawk board. Fall back to 8 GiB single-rank DRAM configuration
on such systems instead.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agoarm64: renesas: r8a779g3: Disable MicroSD UHS modes on Retronix R-Car V4H Sparrow...
Marek Vasut [Wed, 6 Aug 2025 00:56:15 +0000 (02:56 +0200)] 
arm64: renesas: r8a779g3: Disable MicroSD UHS modes on Retronix R-Car V4H Sparrow Hawk EVTA1

The Retronix R-Car V4H Sparrow Hawk old revision EVTA1 does not have MicroSD
voltage switch populated on the board, therefore the board supports only 3V3
and non-UHS MicroSD cards. While the EVTB1 board is populated with Winbond
W77Q51NW SPI NOR, the EVTA1 board is populated with Spansion S25FS512S SPI
NOR, those those SPI NOR IDs to discern the two board revisions and apply
the MicroSD related DT changes.

The MicroSD related DT changes modify the regulator node, which is now a
regulator-fixed and supplies only 3V3, and remove sd-uhs-sdr50 and
sd-uhs-sdr104 properties from the MicroSD slot controller node.

The MicroSD related DT changes cannot be applied as DTO, because the base
DT contains nodes which have to be removed in case of EVTA1, but have to
be present in case of EVTB1 and newer revisions of the board. Because the
EVTA1 is an old revision of the board that is not generally available, it
is better to special case it and keep the base DT compatible with EVTB1
and newer revisions of the board which are actually available.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agopci: pcie-rcar-gen4: Fix PHY initialization
Marek Vasut [Wed, 6 Aug 2025 19:23:54 +0000 (21:23 +0200)] 
pci: pcie-rcar-gen4: Fix PHY initialization

R-Car V4H Reference Manual R19UH0186EJ0130 Rev.1.30 Apr. 21, 2025
page 4581 Figure 104.3b Initial Setting of PCIEC(example) middle
of the figure indicates that fourth write into register 0x148 [2:0]
is 0x3 or GENMASK(1, 0). The current code writes GENMASK(11, 0)
which is a typo. Fix the typo.

Fixes: be3dd0dc2fd9 ("pci: pcie-rcar-gen4: Add Renesas R-Car Gen4 DW PCIe controller driver")
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
10 months agopinctrl: stmfx: Remove duplicated code
Andrew Goodbody [Thu, 7 Aug 2025 10:04:03 +0000 (11:04 +0100)] 
pinctrl: stmfx: Remove duplicated code

In stmfx_read_reg there is duplicated code to detect ret < 0 and return
ret if so. Remove one version of it.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agopinctrl: single: Remove unreachable code
Andrew Goodbody [Thu, 7 Aug 2025 10:04:02 +0000 (11:04 +0100)] 
pinctrl: single: Remove unreachable code

In single_read there is a switch block with a default label. All cases
in the switch block, including the default, return directly. So any code
following the switch block is unreachable. Remove the unreachable code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agoram: k3-ddrss: Use logical and not bitwise
Andrew Goodbody [Fri, 8 Aug 2025 10:47:43 +0000 (11:47 +0100)] 
ram: k3-ddrss: Use logical and not bitwise

The test for the interrupt LPDDR4_INTR_BIST_DONE is using a bitwise and
but the test is simple logic so use the more appropriate logical and.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agophy: ti: j721e-wiz: Set error code before goto
Andrew Goodbody [Wed, 6 Aug 2025 17:03:26 +0000 (18:03 +0100)] 
phy: ti: j721e-wiz: Set error code before goto

In j721e_wiz_probe the test for too many lanes jumps to the error exit
path without assigning an error code which could lead to calling code
silently ignoring the failure. Set the error code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agophy: keystone-usb: Do not negate return code
Andrew Goodbody [Wed, 6 Aug 2025 15:47:46 +0000 (16:47 +0100)] 
phy: keystone-usb: Do not negate return code

In keystone_usb_init the return code from psc_enable_module should be
returned as is rather than being negated.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agotimer: Tighten some timer driver dependencies
Tom Rini [Wed, 6 Aug 2025 14:55:03 +0000 (08:55 -0600)] 
timer: Tighten some timer driver dependencies

A few timer 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>
10 months agotimer: fttmr010_timer: Remove unused driver
Tom Rini [Wed, 6 Aug 2025 14:55:02 +0000 (08:55 -0600)] 
timer: fttmr010_timer: Remove unused driver

This driver is unused. Remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agonet: ti: icssg: Remove impossible test
Andrew Goodbody [Wed, 6 Aug 2025 10:56:58 +0000 (11:56 +0100)] 
net: ti: icssg: Remove impossible test

port_id is an unsigned variable so cannot be negative. Remove the test
checking for port_id being less than 0.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: ti: am65-cpsw-nuss: Initialise ret
Andrew Goodbody [Wed, 6 Aug 2025 10:43:47 +0000 (11:43 +0100)] 
net: ti: am65-cpsw-nuss: Initialise ret

In am65_cpsw_phy_init it is not certain that ret will be assigned to
before it reaches the 'return ret' statement. Initialise ret to ensure
that ret is valid.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agonet: phy: cortina: Ensure memory allocated is freed
Andrew Goodbody [Tue, 5 Aug 2025 16:10:26 +0000 (17:10 +0100)] 
net: phy: cortina: Ensure memory allocated is freed

In cs4340_upload_firmware a buffer is allocated with malloc but this is
never freed. The pointer to this buffer, addr, is not even kept
unchanged. But in some cases addr is not a buffer allocated by malloc.
Introduce the use of another pointer to keep track of the buffer and to
know if it needs to be freed.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agoram: Tighten some ram driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:54:23 +0000 (15:54 -0600)] 
ram: Tighten some ram driver dependencies

A few ram 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>
10 months agoserial: linflexuart: Remove unused driver
Tom Rini [Mon, 4 Aug 2025 21:57:14 +0000 (15:57 -0600)] 
serial: linflexuart: Remove unused driver

This driver is unused. Remove it.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoserial: Tighten some serial driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:57:13 +0000 (15:57 -0600)] 
serial: Tighten some serial driver dependencies

A few serial 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>
10 months agortc: pl031: Correct function type of pl031_write_reg
Tom Rini [Mon, 4 Aug 2025 21:57:12 +0000 (15:57 -0600)] 
rtc: pl031: Correct function type of pl031_write_reg

When calling writel we do not have a return value to check or pass
along. This function should therefore be void and not return what writel
gives us.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agortc: mc146818: Fix building on more architectures
Tom Rini [Mon, 4 Aug 2025 21:57:11 +0000 (15:57 -0600)] 
rtc: mc146818: Fix building on more architectures

This driver makes calls to in8/out8(). On PowerPC these are separate and
real calls but elsewhere they are able to simply be wrappers to
inb/outb. Rework this logic to be able to build this driver on more
platforms.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agortc: Tighten some rtc driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:57:10 +0000 (15:57 -0600)] 
rtc: Tighten some rtc driver dependencies

The Marvell RTC rtc driver cannot build without access to some
platform specific header files. Express that requirements in Kconfig as
well.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agosysreset: Tighten some sysreset driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:57:19 +0000 (15:57 -0600)] 
sysreset: Tighten some sysreset driver dependencies

The MPC83xx sysreset driver cannot build without access to some
architecture specific header files. Express that requirements in Kconfig
as well.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agosound: Tighten some sound driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:57:16 +0000 (15:57 -0600)] 
sound: Tighten some sound driver dependencies

A few sound drivers cannot build without access to some platform
specific header files. Express those requirements in Kconfig as well.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agosoc: Tighten some soc driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:57:15 +0000 (15:57 -0600)] 
soc: Tighten some soc driver dependencies

The Qualcomm Snapdragon "SoC" driver cannot build without access to some
ARM64 specific functionality. Express that requirements in Kconfig as
well.

Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoremoteproc: Tighten some remoteproc driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:54:24 +0000 (15:54 -0600)] 
remoteproc: Tighten some remoteproc driver dependencies

The TI IPU remoteproc driver cannot build without access to some
platform specific header files. Express that requirements in Kconfig as
well.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoreset: Tighten some reset driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:54:25 +0000 (15:54 -0600)] 
reset: Tighten some reset driver dependencies

A few reset 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>
10 months agopwm: pwm-aspeed: Add missing <linux/log2.h> to pwm-aspeed.c
Tom Rini [Mon, 4 Aug 2025 21:53:54 +0000 (15:53 -0600)] 
pwm: pwm-aspeed: Add missing <linux/log2.h> to pwm-aspeed.c

This driver references the logarithmic macros while relying on an
indirection inclusion of <linux/log2.h>. Add the missing include
directly.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agopwm: Tighten some pwm driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:53:53 +0000 (15:53 -0600)] 
pwm: Tighten some pwm driver dependencies

A few pwm 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>
10 months agopinctrl: Tighten some pinctrl driver dependencies
Tom Rini [Mon, 4 Aug 2025 21:52:53 +0000 (15:52 -0600)] 
pinctrl: Tighten some pinctrl driver dependencies

A few pinctrl 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>
10 months agosm: Rework the Kconfig logic here
Tom Rini [Mon, 4 Aug 2025 21:51:11 +0000 (15:51 -0600)] 
sm: Rework the Kconfig logic here

The symbol "SM" is a library symbol and should not be prompted for. It
should be selected by the drivers that use it. In this case we need to
add a SANDBOX_SM symbol for the sandbox driver. The meson SM driver
cannot build on other platforms, so add the appropriate dependency.

Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agosandbox: Add an additional dummy sync macro
Tom Rini [Mon, 4 Aug 2025 21:50:08 +0000 (15:50 -0600)] 
sandbox: Add an additional dummy sync macro

There are some drivers which call a "dmb" for a type of sync. Add that
as well to sandbox.

Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agonet: e1000: Free temporary buffer on exit
Andrew Goodbody [Mon, 4 Aug 2025 15:32:51 +0000 (16:32 +0100)] 
net: e1000: Free temporary buffer on exit

In do_e1000_spi_checksum a temporary buffer is allocated but never
freed. Add code to free on exit. Also refactor the code to make the exit
code common.

This issue found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agobootstd: rauc: Change global method to check any partition
Martin Schwan [Tue, 12 Aug 2025 12:38:34 +0000 (14:38 +0200)] 
bootstd: rauc: Change global method to check any partition

The bootmeth rauc should scan all partitions, in particular whole
devices, and not be a global method. There may exist multiple RAUC
systems on different devices and they should all be detected. This also
fixes a bug, where both a global bootflow and one using an actual,
complete device would be detected at the same time, when scanning for
valid bootflows.

Signed-off-by: Martin Schwan <m.schwan@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
10 months agoenv: Correct Kconfig type for ENV_MMC_SW_PARTITION
Tom Rini [Tue, 12 Aug 2025 17:31:09 +0000 (11:31 -0600)] 
env: Correct Kconfig type for ENV_MMC_SW_PARTITION

As part of renaming environment related Kconfig options,
ENV_MMC_SW_PARTITION was inadvertently changed from a string to a bool.
Correct this.

Fixes: ffc4914703a2 ("env: Rename ENV_MMC_PARTITION to ENV_MMC_SW_PARTITION")
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
10 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 14 Aug 2025 14:51:42 +0000 (08:51 -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/27379

- Board: mbv: Prepare MBV for CI
- Board: MPFS Icicle Kit cleanup
- Board: Add Andes Voyager board support
- RISCV: Update SYS_BOOTM_LEN to commonly used value
- starfive: fix return code of `mac write_eeprom`
- arch/riscv/lib: update memmove and memcpy for big-endian

10 months agoarch/riscv/lib: update memmove and memcpy for big-endian
Ben Dooks [Thu, 7 Aug 2025 16:49:33 +0000 (17:49 +0100)] 
arch/riscv/lib: update memmove and memcpy for big-endian

Change the shift patterns for the unaligned memory move and copy code
to deal with big-endian by definign macros to change the shfit left and
right to go the opposite way.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agostarfive: fix return code of `mac write_eeprom`
Heinrich Schuchardt [Sat, 9 Aug 2025 08:21:55 +0000 (10:21 +0200)] 
starfive: fix return code of `mac write_eeprom`

When writing the EEPROM fails, the command usage help text is displayed
after the error message. We should only display the error message instead.

If writing the EEPROM fails, return CMD_RET_FAILURE (1) instead of
CMD_RET_USAGE (-1).

Fixes: aea1bd95b61e ("eeprom: starfive: Enable ID EEPROM configuration")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: E Shattow <e@freeshell.de>
10 months agoboard: MAINTAINERS: Add Voyager board maintainer
Leo Yu-Chi Liang [Thu, 7 Aug 2025 11:38:27 +0000 (19:38 +0800)] 
board: MAINTAINERS: Add Voyager board maintainer

Add Voyager board maintainer.

Signed-off-by: Randolph Sheng-Kai Lin <randolph@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agodoc: board: voyager: Add documentation for Voyager
Leo Yu-Chi Liang [Thu, 7 Aug 2025 11:40:55 +0000 (19:40 +0800)] 
doc: board: voyager: Add documentation for Voyager

Add documentation for Voyager board.

Signed-off-by: Randolph Sheng-Kai Lin <randolph@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoconfigs: andes: add Voyager board defconfig
Leo Yu-Chi Liang [Thu, 7 Aug 2025 11:40:40 +0000 (19:40 +0800)] 
configs: andes: add Voyager board defconfig

Add default configuration file for Voyager board.

Signed-off-by: Randolph Sheng-Kai Lin <randolph@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoboard: andestech: Add Voyager board support
Leo Yu-Chi Liang [Thu, 7 Aug 2025 11:38:32 +0000 (19:38 +0800)] 
board: andestech: Add Voyager board support

Introduce Voyager board specific code, including
- dram info
- shared cache enabling

Signed-off-by: Randolph Sheng-Kai Lin <randolph@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: dts: andes: Add Voyager device tree
Leo Yu-Chi Liang [Thu, 7 Aug 2025 11:38:17 +0000 (19:38 +0800)] 
riscv: dts: andes: Add Voyager device tree

Introduce the initial device tree support for Andes Voyager board.
We will convert to OF_UPSTREAM once the patch series for kernel is merged.

Signed-off-by: Randolph Sheng-Kai Lin <randolph@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: board: Add Andes Voyager board Kconfig support
Leo Yu-Chi Liang [Thu, 7 Aug 2025 11:38:07 +0000 (19:38 +0800)] 
riscv: board: Add Andes Voyager board Kconfig support

The Voyager is Andes' first RISC-V development board.
It is built around Qilai SoC,
which includes Andes AX45MP quad-core cluster.

Introduce the Kconfig entry for the Voyager board.

Signed-off-by: Randolph Sheng-Kai Lin <randolph@andestech.com>
Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agocommon: spl: fix compilation warning
Leo Yu-Chi Liang [Wed, 13 Aug 2025 06:01:04 +0000 (14:01 +0800)] 
common: spl: fix compilation warning

Explicitly specify the type by replacing macro with variable
to fix the possible compilation warning.

Signed-off-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoboard: microchip: mpfs_icicle: update to use system controller
Jamie Gibbons [Fri, 1 Aug 2025 12:36:26 +0000 (13:36 +0100)] 
board: microchip: mpfs_icicle: update to use system controller

A new system controller driver has been created to make code modular and
improve and clean code. Update and remove functions to account for these
additional drivers.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoboard: microchip: mpfs_icicle: enable new driver configs
Jamie Gibbons [Fri, 1 Aug 2025 12:36:25 +0000 (13:36 +0100)] 
board: microchip: mpfs_icicle: enable new driver configs

Enable the MPFS mailbox and system controller drivers for use with the
Icicle kit. These functions are crucial for the board setup functions
that run in the Icicle board file - mpfs_icicle.c.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agomisc: add PolarFire SoC system controller
Jamie Gibbons [Fri, 1 Aug 2025 12:36:24 +0000 (13:36 +0100)] 
misc: add PolarFire SoC system controller

This driver provides an interface to access the functions of the system
controller on the Microchip PolarFire SoC.
This driver includes functions to use the system controller to read
the device serial number.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agomailbox: add PolarFire SoC mailbox driver
Jamie Gibbons [Fri, 1 Aug 2025 12:36:23 +0000 (13:36 +0100)] 
mailbox: add PolarFire SoC mailbox driver

This driver adds support for the single mailbox channel of the MSS
system controller on the Microchip PolarFire SoC.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoboard: microchip: mpfs_icicle: make use of ft_board_setup()
Jamie Gibbons [Fri, 1 Aug 2025 12:36:22 +0000 (13:36 +0100)] 
board: microchip: mpfs_icicle: make use of ft_board_setup()

Move ethernet mac address setting to ft_board_setup() to remove the need
for fdt set in custom boot script.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoconfigs: microchip_mpfs_icicle: enable CONFIG_OF_BOARD_SETUP
Jamie Gibbons [Fri, 1 Aug 2025 12:36:21 +0000 (13:36 +0100)] 
configs: microchip_mpfs_icicle: enable CONFIG_OF_BOARD_SETUP

Enable CONFIG_OF_BOARD_SETUP and other dependencies to allow the use of
the ft_board_setup() function to replace fdt set in boot scripts for
Microchip's MPFS Icicle kit.

Signed-off-by: Jamie Gibbons <jamie.gibbons@microchip.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoxilinx: mbv: Use separate DTB for binman nodes
Michal Simek [Tue, 22 Jul 2025 11:03:46 +0000 (13:03 +0200)] 
xilinx: mbv: Use separate DTB for binman nodes

The commit d92fdb60677b ("binman: Add option for pointing to separate
description") added support for separating binman description to own file
not the be the part of DT for OS.
The main reason is that binman is not passing dt schema validation that's
why want to keep it separated.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Acked-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoxilinx: mbv: Fix dt properties in interrupt controller node
Michal Simek [Tue, 22 Jul 2025 11:03:45 +0000 (13:03 +0200)] 
xilinx: mbv: Fix dt properties in interrupt controller node

Properties didn't match dt binding that's why should be fixed.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoxilinx: mbv: Add missing mmu-type cpu property
Michal Simek [Tue, 22 Jul 2025 11:03:44 +0000 (13:03 +0200)] 
xilinx: mbv: Add missing mmu-type cpu property

OpenSBI expects mmu-type to be present in DT that's why add it. Without it
OpenSBI disable CPU node which ends up in not working boot.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoxilinx: mbv: Disable OF_HAS_PRIOR_STAGE
Michal Simek [Tue, 22 Jul 2025 11:03:43 +0000 (13:03 +0200)] 
xilinx: mbv: Disable OF_HAS_PRIOR_STAGE

There is no reason to use OF_BOARD for MBV because reduced DT is used by
SPL and full DT is passed via u-boot.img or u-boot.itb. There is no reason
to pick up DTB from certain address.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: Increase Microchip Icicle's SYS_BOOTM_LEN
Martin Herren [Sat, 19 Jul 2025 21:46:35 +0000 (23:46 +0200)] 
riscv: Increase Microchip Icicle's SYS_BOOTM_LEN

Increase Icicle's SYS_BOOTM_LEN to 0x4000000 which is the new default
value.
Done on Conor Dooley's request.

Signed-off-by: Martin Herren <sputnik@on-the-web.ch>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: Remove default SYS_BOOTM_LEN from defconfig
Martin Herren [Sat, 19 Jul 2025 21:46:34 +0000 (23:46 +0200)] 
riscv: Remove default SYS_BOOTM_LEN from defconfig

Remove CONFIG_SYS_BOOTM_LEN from all riscv defconfigs where the new
default value is used.

Signed-off-by: Martin Herren <sputnik@on-the-web.ch>
Acked-by: Michal Simek <michal.simek@amd.com> # xilinx_mbv
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: Set SYS_BOOTM_LEN default to 0x4000000
Martin Herren [Sat, 19 Jul 2025 21:46:33 +0000 (23:46 +0200)] 
riscv: Set SYS_BOOTM_LEN default to 0x4000000

This changes the default value to the most commonly used one among
existing defconfigs.

Signed-off-by: Martin Herren <sputnik@on-the-web.ch>
Acked-by: Michal Simek <michal.simek@amd.com> # xilinx_mbv
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
10 months agoriscv: Set SYS_BOOTM_LEN explicitly to 0x800000
Martin Herren [Sat, 19 Jul 2025 21:46:32 +0000 (23:46 +0200)] 
riscv: Set SYS_BOOTM_LEN explicitly to 0x800000

For all riscv defconfigs that use the current default value.

This is done in provision of changing the default value to the most
common used value of 0x4000000.

Signed-off-by: Martin Herren <sputnik@on-the-web.ch>
Acked-by: Michal Simek <michal.simek@amd.com> # xilinx_mbv
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agoriscv: cpu: Use CONFIG_IS_ENABLED(CPU) instead of plain ifdef
Michal Simek [Thu, 17 Jul 2025 06:26:15 +0000 (08:26 +0200)] 
riscv: cpu: Use CONFIG_IS_ENABLED(CPU) instead of plain ifdef

ifdef CONFIG_CPU only works in U-Boot proper but macro is not working when
XPL phases are used. In this case CONFIG_SPL_CPU is also defined and can be
disabled which is causing compilation error.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
10 months agorockchip: add /chosen/bootsource to U-Boot proper DT
Quentin Schulz [Wed, 30 Jul 2025 12:03:18 +0000 (14:03 +0200)] 
rockchip: add /chosen/bootsource to U-Boot proper DT

U-Boot typically can be loaded from different storage media, such as
eMMC, SD card, SPI flash, but also from non-persistent media such as USB
(via proprietary protocols loading directly into SRAM, or fastboot, DFU,
 etc..), JTAG, ...

This information is usually reported by the BootROM via some proprietary
mechanism (some specific address in registers/DRAM for example). For
Rockchip, that information is stored in a register
(BROM_BOOTSOURCE_ID_ADDR).

While we already have the information about which medium was used to
load U-Boot proper from SPL (via /chosen/u-boot,spl-boot-device), this
new property represents the medium used to load U-Boot first phase
(depending on configuration, can be VPL/TPL/SPL) which absolutely may
differ from the one used to load U-Boot proper!

It would be useful to know which medium was used to load the first phase
of U-Boot, for example to check fallback mechanisms (proper loaded from
a different medium than first phase) are actually working.

For now, this only applies to Rockchip's U-Boot proper DT but could be
applied to the kernel's as well and possibly for other architectures or
vendors.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
10 months agoMerge tag 'qcom-fixes-13Aug2025' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 13 Aug 2025 14:57:49 +0000 (08:57 -0600)] 
Merge tag 'qcom-fixes-13Aug2025' of https://source.denx.de/u-boot/custodians/u-boot-snapdragon

CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/27364

Quite a few Smatch issues reported by Andrew, and the LMB allocation
fix.

10 months agopinctrl: qcom: sdm845: Limit check off by 1
Andrew Goodbody [Thu, 7 Aug 2025 11:20:02 +0000 (12:20 +0100)] 
pinctrl: qcom: sdm845: Limit check off by 1

The driver specifies 154 pins so should have a maximum selector of 153
to ensure that the index into the array special_pins_names does not
overflow.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250807-pinctrl_qcom-v1-2-42fac6707fd5@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agopinctrl: qcom: sa8775: Limit check for array index not correct
Andrew Goodbody [Thu, 7 Aug 2025 11:20:01 +0000 (12:20 +0100)] 
pinctrl: qcom: sa8775: Limit check for array index not correct

In sa8775p_get_pin_name the limit check for the index into
msm_special_pins_data allows for more elements than exist. Add code to
ensure the array index remains in bounds.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250807-pinctrl_qcom-v1-1-42fac6707fd5@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agobutton: qcom-pmic: Fix dereference of uninitialised pointer
Andrew Goodbody [Wed, 23 Jul 2025 10:58:04 +0000 (11:58 +0100)] 
button: qcom-pmic: Fix dereference of uninitialised pointer

The pointer 'label' is declared and later dereferenced without ever
having a value assigned to it. Add an assignment to this pointer so it
will be valid later when dereferenced.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250723-button-qcom-pmic-v1-1-9c317ac71167@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoserial: msm-geni: No need to NULL check priv
Andrew Goodbody [Mon, 11 Aug 2025 17:03:40 +0000 (18:03 +0100)] 
serial: msm-geni: No need to NULL check priv

The NULL check for priv in qcom_geni_serial_poll_bit serves no useful
prupose as too much other code surrounding it relies on priv being
valid. Remove the NULL check for priv and other related code.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Link: https://lore.kernel.org/r/20250811-serial_msm_geni-v1-2-4499179491bc@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agoserial: msm-geni: Detect error from get_clk_div_rate
Andrew Goodbody [Mon, 11 Aug 2025 17:03:39 +0000 (18:03 +0100)] 
serial: msm-geni: Detect error from get_clk_div_rate

In msm_serial_setbrg if the call to get_clk_div_rate fails then there
will not have been an assignment to clk_div which will lead to the call
to geni_serial_baud using an uninitialised value.
Check for an error from get_clk_div_rate and return an error code if so.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://lore.kernel.org/r/20250811-serial_msm_geni-v1-1-4499179491bc@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agomach-snapdragon: fix erroneous lmb allocations
Casey Connolly [Mon, 11 Aug 2025 10:45:13 +0000 (12:45 +0200)] 
mach-snapdragon: fix erroneous lmb allocations

In commit 6e4675b8e5d8 ("lmb: replace the lmb_alloc() and
lmb_alloc_base() API's") an additional allocation was mistakenly
introduced resulting in ${kernel_comp_size} containing the address of a
second 64mb region rather than the actual value of KERNEL_COMP_SIZE.

Additionally, in commit b40d7b8f72f1 ("Merge patch series "lmb: use
a single API for all allocations"") merge conflict resulted in an
additional 128mb allocation for ${loadaddr} when CONFIG_FASTBOOT
is enabled, where it should actually be set to the same value as
${fastboot_addr_r} to respect size constraints (and since it doesn't
seem to interfer with any bootflows).

Fixup both of these, freeing up 192mb of memory.

Fixes: 6e4675b8e5d8 ("lmb: replace the lmb_alloc() and lmb_alloc_base() API's")
Fixes: b40d7b8f72f1 ("Merge patch series "lmb: use a single API for all allocations"")
Link: https://lore.kernel.org/r/20250811104710.1896382-1-casey.connolly@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agophy: qcom: Fix ret is uninitialised
Andrew Goodbody [Wed, 6 Aug 2025 16:55:04 +0000 (17:55 +0100)] 
phy: qcom: Fix ret is uninitialised

In qcom_snps_eusb2_phy_probe after the call to devm_clk_get if an error
is found then ret is printed but has not been assigned to by the code.
Decode the error from the pointer and assign it to ret.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250806-phy_qcom_snps-v1-1-5cda830026c7@linaro.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
10 months agommc: gen_atmel_mci: NULL check variable before use
Andrew Goodbody [Tue, 29 Jul 2025 16:16:17 +0000 (17:16 +0100)] 
mmc: gen_atmel_mci: NULL check variable before use

In mci_send_cmd the pointer 'data' is optional so guard its use with a
NULL check to prevent any attempt to dereference it when not provided.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agommc: gen_atmel_mci: Remove duplicate checks
Andrew Goodbody [Tue, 29 Jul 2025 16:16:16 +0000 (17:16 +0100)] 
mmc: gen_atmel_mci: Remove duplicate checks

Remove duplicate checks on status from mci_data_read and mci_data_write
which are guaranteed to be true as exiting the above do..while loop
above requires that to be so.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
10 months agomfd: atmel-smc: Ensure match is initialised
Andrew Goodbody [Mon, 28 Jul 2025 16:12:13 +0000 (17:12 +0100)] 
mfd: atmel-smc: Ensure match is initialised

If the test in the for loop is never matched then the variable 'match'
will never be assigned to. Provide an initial value so this cannot be a
problem.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agoclk: at91: Fix use of unsigned loop index
Andrew Goodbody [Wed, 23 Jul 2025 14:13:49 +0000 (15:13 +0100)] 
clk: at91: Fix use of unsigned loop index

The use of the unsigned variable 'i' as a loop index leads to the test
for i being non-negative always being true. Instead declare 'i' as an
int so that the for loop will terminate as expected.
If the original for loop completes 'i' will be 1 past the end of the
array so decrement it in the subsequent error path to prevent an out of
bounds access occurring.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agoclk: at91: Fix testing of unsigned variable to be negative
Andrew Goodbody [Wed, 23 Jul 2025 14:13:48 +0000 (15:13 +0100)] 
clk: at91: Fix testing of unsigned variable to be negative

The variable 'index' is declared as unsigned but used to receive the
return value of a function returning 'int'. This value is then tested
for being less than zero to detect an error condition but as index is
unsigned this can never be true. Change the variable 'index' to be an
int so that the error condition can be detected.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
10 months agospi: atmel_qspi: fix race condition in transfer completion check
Ramin Moussavi [Tue, 22 Jul 2025 18:27:09 +0000 (20:27 +0200)] 
spi: atmel_qspi: fix race condition in transfer completion check

In atmel_qspi_transfer(), the status register is polled with:

  imr = QSPI_SR_INSTRE | QSPI_SR_CSR;
  return readl_poll_timeout(aq->regs + QSPI_SR, sr,
                            (sr & imr) == imr,
                            ATMEL_QSPI_TIMEOUT);

However, this is racy: QSPI_SR_INSTRE can be set before QSPI_SR_CSR,
and will then be cleared by the read. If that happens, the condition
"(sr & imr) == imr" can never be true, and the function times out.

This race condition is avoided in at91bootstrap by accumulating the
status bits across reads until both bits have been observed:

  /* Poll INSTruction End and Chip Select Rise flags. */
  imr = (QSPI_SR_INSTRE | QSPI_SR_CSR);
  sr = 0;
  do {
    udelay(1);
    sr |= qspi_readl(qspi, QSPI_SR) & imr;
  } while ((--timeout) && (sr != imr));

Update U-Boot's atmel_qspi_transfer() to use the same pattern,
ensuring that both flags are observed even if they are not set
simultaneously.

Signed-off-by: Ramin Moussavi <lordrasmus@gmail.com>
[eugen.hristev@linaro.org: remove 'sr' and fix commit msg]
Signed-off-by: Eugen Hristev <eugen.hristev@linaro.org>
10 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Tue, 12 Aug 2025 13:53:33 +0000 (07:53 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

These changes are  mostly smaller fixes, and some additions that were
dependent on recent DT updates: We switch the S3/V3/V3s over to
OF_UPSTREAM, the DTs were already identical anyway. While at it, Paul
sent more fixes for this SoC, I am pulling in two easy fixes that were
ready and low risk. Apart from other assorted fixes, this PR also
enables Ethernet on the new A527/T527 boards, made possible by the DT
update from the DT rebasing repository.

This passed the CI, and was boot tested on boards with Allwinner A10,
A20, A33, V40, A80, A83T, T113s3, F1C100s, H3, A64, H6, H616, A133 and
T527 SoCs.

10 months agosunxi: H616: dram: fix LPDDR3 mode register settings
Andre Przywara [Sun, 27 Jul 2025 13:04:09 +0000 (14:04 +0100)] 
sunxi: H616: dram: fix LPDDR3 mode register settings

The JEDEC LPDDR3 spec defines mode register 0 (MR0) as being read-only,
so there is no point in trying to set its value.
Also the H616 memory controller encodes the mode register index to be
written starting from bit 8 in MRCTRL1 (for LPDDR3 and LPDDR4 chips), so
we need to OR in that number to tell the controller which MR to program.

On top of that, the mode registers between DDR3 and LPDDR3 are
completely different, so writing values crafted for DDR3 into a LPDDR3
chip is just wrong. Due to the above mentioned bugs the writes for
MR0-MR2 did not have any effect (as they were all trying to set the
read-only MR0), so the mode registers just stayed unchanged.

Looking at the LPDDR3 spec and the BSP code, let's write the proper MR
values into LPDDR3 chips, using the proper addressing mode.
Use the opportunity to document the LPDDR3 mode register bits written.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
10 months agosunxi: Enable SPL/SPI boot for OLinuXino Lime2
Eric Anderson [Sun, 13 Jul 2025 00:27:41 +0000 (17:27 -0700)] 
sunxi: Enable SPL/SPI boot for OLinuXino Lime2

58e9502e6 "arm: sunxi: Enable SPL/SPI boot for Olinuxino Lime2-eMMC
boards" enabled SPI boot for the eMMC variant. Olimex offers the
"s16MB" variant with SPI flash populated but without eMMC populated.
Tested on board rev L.

Signed-off-by: Eric Anderson <ejona86@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
10 months agosunxi: spl: initialise timer before clocks
Andre Przywara [Sun, 20 Jul 2025 15:29:19 +0000 (16:29 +0100)] 
sunxi: spl: initialise timer before clocks

Recent changes in the H6 clock code added delay() calls into the SPL clock
setup routine, which requires the timers to work. When compiling for
AArch64, we are always using the Arm Generic Timer (aka. arch timer),
which does not require further setup, hence having an empty timer_init()
routine.
However for 32-bit SoCs we use the Allwinner timers, which require some
setup routine, and hence we need timer_init() to be called before
clock_init().

Swap the order of the two calls, to be more robust when compiling the H6
clock code for AArch32 or when using the Allwinner timers for whatever
reason.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>