Commit Graph
106391 Commits
Author SHA1 Message Date
Pranav TilakandTom Rini b2062131b4 cmd: i3c: fix list and current needing pre-selected controller
The !currdev guard in do_i3c() was placed before the list and current
handlers, causing both to fail when no controller is pre-selected.
Move the guard to only protect device_list, write and read which
actually need a controller.

Fixes: b875409da7 ("cmd: Add i3c command support.")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
Reviewed-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
2026-07-22 13:10:17 -06:00
Pranav TilakandTom Rini f077a6b07b i3c: dw: make resets optional in probe
Treat -ENOENT and -ENOTSUPP from reset_get_bulk() as non-fatal to
support platforms where no resets are defined in the DTS. The resets
property is not yet documented in the DT binding.

Fixes: 1009c96f15 ("drivers: i3c: Add driver for MIPI DWI3C")
Signed-off-by: Pranav Tilak <pranav.vinaytilak@amd.com>
Reviewed-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
2026-07-22 13:09:54 -06:00
Tom Rini 964a26cc6d Merge tag 'ubi-updates-for-2026.10-rc1' of https://source.denx.de/u-boot/custodians/u-boot-ubi
ubi updates for 2026.10-rc1

- fs: ubifs: fix ubifs_finddir() from Patrick
  Fixes: 0cab29ff46 ("fs: ubifs: Fix and rework error handling in ubifs_finddir")
  fix test -e

- cmd: ubi: rework from Weijie
  - env: ubi: add support to create environment volume if it does not exist
  - cmd: ubi: allow creating volume with all free spaces in ubi_create_vol
  - cmd: ubi: export more APIs to public
  - cmd: ubi: reorganize command messages
  - cmd: ubi: change all positive error return value to negative
  - cmd: ubi: change the type of parameter dynamic to bool
  - cmd: ubifs: mark string parameters with const
  - cmd: ubi: use void * for buf parameter in ubi_volume_read
  - cmd: ubi: mark read-only function parameters with const
  - ubi: remove unnecessary extern directive from function prototypes
2026-07-09 08:02:23 -06:00
Tom Rini c991faf4f7 Merge patch series "pinctrl: add support of Airoha SoCs"
Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> says:

This patch series add pin controller and gpio driver support for EN7523/
AN7581/AN7583 SoCs. The driver based on official linux airoha pinctrl
and gpio driver with Matheus Sampaio Queiroga changes.

The original Matheus Sampaio Queiroga driver can be taken from the repo:
  https://sirherobrine23.com.br/airoha_en7523/kernel/src/branch/airoha_en7523_pinctrl

Additionally in the EN7523 case the patches removes existing gpio dts
nodes and replaces them with pinctrl node. It should not be very
dangerous, because:
 * No official EN7523 gpio support present in U-Boot
 * Legacy Linux EN7523 GPIO driver is mostly abandoned
 * The same driver is planned for upstream linux/openwrt

This patchset includes bitfield.h patches created for Linux kernel by
Geert Uytterhoeven. It suits U-Boot fine. I preserve original author and
original commit messages. Please note me, if there is a better way.

The patches were tested on EN7523/AN7581/AN7583 boards.

Link: https://lore.kernel.org/r/20260703115627.2317120-1-mikhail.kshevetskiy@iopsys.eu
2026-07-08 13:42:17 -06:00
Mikhail KshevetskiyandTom Rini c56c7298c4 arm: dts: en7523: add pinctrl/gpio support, drop legacy gpio support
This patch adds pinctrl/gpio dts nodes for airoha pinctrl driver.
It also removes legacy gpio nodes.

It should not be very dangerous, because:
 * No official EN7523 gpio support present in U-Boot
 * The same driver is planned for upstream linux/openwrt

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 4c7f94a738 configs: airoha: en7523: enable pinctrl/gpio support
This enables EN7523 pin controller and gpio driver.
Defconfig was minimized with 'make savedefconfig'.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 8f99a782fd configs: airoha: an7581: enable pinctrl/gpio support
This enables AN7581 pin controller and gpio driver.
Defconfig was minimized with 'make savedefconfig'.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 5c07bb5896 pinctrl: airoha: add pin controller and gpio driver for EN7523 SoC
This patch adds U-Boot pin controller and gpio driver for Airoha EN7523 SoC.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 56d820371f pinctrl: airoha: add pin controller and gpio driver for AN7583 SoC
This patch adds U-Boot pin controller and gpio driver for Airoha AN7583 SoC.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 1c98e84c04 pinctrl: airoha: add pin controller and gpio driver for AN7581 SoC
This patch adds U-Boot pin controller and gpio driver for Airoha AN7581 SoC.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini dcdd7aa264 pinctrl: airoha: add shared pinctrl code
This patch introduce shared Airoha pinctrl code.
Also it sorts contents of pinctrl makefile.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 05a8f13bbd pinctrl: sort and format the contents of the makefile
sorting rules:
 * rules for generic pinctrl files placed first,
 * obj-y rules,
 * obj-$(CONFIG_ARCH_something) rules
 * obj-$(CONFIG_PINCTRL_something) rules

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 7518f6fbc4 pinctrl: add more pinconf/pinctrl definitions
These pinconf/pinctrl definitions will be used by the next patches.

The definitions was taken from public headers of linux-7.0. It's used
by several linux pinctrl drivers, so it might be helpful for U-Boot as
well.

Pinconf definitions are placed near the corresponding U-Boot definitions
in file include/dm/pinctrl.h. Pin/group/function definitions stored within
the same path as in linux (include/linux/pinctrl/pinctrl.h).

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini d26cb20e6b board: renesas: gen5-cm33: Convert to common field_{get, prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 575717f4b6 clk: renesas: rcar-cpg-lib: Convert to common field_{get, prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 3253f2b326 mtd: nand: raw: sunxi: Convert to common field_{get, prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini d2f172f305 net: hifemac: Convert to common field_{get, prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 0a1ca728f9 power: domain: renesas-r8a78000: Convert to common field_{get, prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini c02633a823 watchdog: renesas_wwdt: Convert to common field_{get, prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor
of the globally available variants from <linux/bitfield.h>.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-08 13:29:18 -06:00
Geert UytterhoevenandTom Rini da10fca9b0 bitfield: Add non-constant field_{prep, get}() helpers
The existing FIELD_{GET,PREP}() macros are limited to compile-time
constants.  However, it is very common to prepare or extract bitfield
elements where the bitfield mask is not a compile-time constant.

To avoid this limitation, the AT91 clock driver and several other
drivers already have their own non-const field_{prep,get}() macros.
Make them available for general use by adding them to
<linux/bitfield.h>, and improve them slightly:
  1. Avoid evaluating macro parameters more than once,
  2. Replace "ffs() - 1" by "__ffs()",
  3. Support 64-bit use on 32-bit architectures,
  4. Wire field_{get,prep}() to FIELD_{GET,PREP}() when mask is
     actually constant.

This is deliberately not merged into the existing FIELD_{GET,PREP}()
macros, as people expressed the desire to keep stricter variants for
increased safety, or for performance critical paths.

Yury: use __mask within new macros.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Crt Mori <cmo@melexis.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Acked-by: Richard Genoud <richard.genoud@bootlin.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Reviewed-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
[Linux commit: c1c6ab80b25c8db1e2ef5ae3ac8075d2c242ae13]
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-08 13:29:18 -06:00
Geert UytterhoevenandTom Rini 9c10cba536 bitfield: Add less-checking __FIELD_{GET,PREP}()
The BUILD_BUG_ON_MSG() check against "~0ull" works only with "unsigned
(long) long" _mask types.  For constant masks, that condition is usually
met, as GENMASK() yields an UL value.  The few places where the
constant mask is stored in an intermediate variable were fixed by
changing the variable type to u64.

However, for non-constant masks, smaller unsigned types should be valid,
too, but currently lead to "result of comparison of constant
18446744073709551615 with expression of type ... is always
false"-warnings with clang and W=1.

Hence refactor the __BF_FIELD_CHECK() helper, and factor out
__FIELD_{GET,PREP}().  The later lack the single problematic check, but
are otherwise identical to FIELD_{GET,PREP}(), and are intended to be
used in the fully non-const variants later.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
[Linux commit: 2a6c045640c38a407a39cd40c3c4d8dd2fd89aa8]
Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini ab447ac617 bitops: import BITS_PER_TYPE() macro from linux
This macro will be used by include/linux/bitfield.h header.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 08badbd7d8 board: renesas: gen5-cm33: #undef field_{get, prep}() before definition
Prepare for the advent of globally available common field_get() and
field_prep() macros by undefining the symbols before defining local
variants.  This prevents redefinition warnings from the C preprocessor
when introducing the common macros later.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 6bbf6cfc91 clk: renesas: #undef field_{get, prep}() before definition
Prepare for the advent of globally available common field_get() and
field_prep() macros by undefining the symbols before defining local
variants.  This prevents redefinition warnings from the C preprocessor
when introducing the common macros later.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 9b5c0b8834 mtd: nand: raw: sunxi: #undef field_{get, prep}() before definition
Prepare for the advent of globally available common field_get() and
field_prep() macros by undefining the symbols before defining local
variants.  This prevents redefinition warnings from the C preprocessor
when introducing the common macros later.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini cd36be5a47 net: hifemac: #undef field_{get, prep}() before definition
Prepare for the advent of globally available common field_get() and
field_prep() macros by undefining the symbols before defining local
variants.  This prevents redefinition warnings from the C preprocessor
when introducing the common macros later.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:18 -06:00
Mikhail KshevetskiyandTom Rini 40db9d313b power: domain: renesas-r8a78000: #undef field_{get, prep}() before definition
Prepare for the advent of globally available common field_get() and
field_prep() macros by undefining the symbols before defining local
variants.  This prevents redefinition warnings from the C preprocessor
when introducing the common macros later.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:17 -06:00
Mikhail KshevetskiyandTom Rini b8b9ca05c7 watchdog: renesas_wwdt: #undef field_{get, prep}() before definition
Prepare for the advent of globally available common field_get() and
field_prep() macros by undefining the symbols before defining local
variants.  This prevents redefinition warnings from the C preprocessor
when introducing the common macros later.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
2026-07-08 13:29:17 -06:00
Tom Rini 913fedc816 Merge tag 'xilinx-for-v2026.10-rc1-v3' of https://git.u-boot-project.org/u-boot/custodians/u-boot-amd
AMD/Xilinx/FPGA changes for v2026.10-rc1 v3

AMD:
- Firmware interface decoupling (part 1)

ZynqMP:
- DT updates
- Add TCG variant detection

Versal/Versal2:
- Drop DDR MMU mapping and map it dynamically

tools:
- Add register initialization to mkimage

MAINTAINERS:
- Clean Zynq/ZynqMP fragments

ufs:
- Fix driver reregistration

fpga:
- altera: Simplify driver conditional compilation selection
2026-07-08 10:13:24 -06:00
Weijie GaoandHeiko Schocher 93ae75361f env: ubi: add support to create environment volume if it does not exist
When U-Boot is booting from a fresh device, the environment volume may not
exist in the factory UBI image. This is a common case where factory UBI
image contains only volumes with valid data.

With the current design, even if the volume is created manually, the
environment will still be unusable (e.g., saveenv) before a reboot.

This patch adds support to automatically create missing volumes before
loading environment. This will make environment available at first boot.

There are two options:
CONFIG_ENV_UBI_VOLUME_CREATE: whether to enable volume creation
CONFIG_ENV_UBI_VOLUME_STATIC: create static volume (default is dynamic)

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:35:29 +02:00
Weijie GaoandHeiko Schocher c719d2627a cmd: ubi: allow creating volume with all free spaces in ubi_create_vol
Although the ubi command itself supports creating volume with all
free spaces, the api ubi_create_vol() does not.

Since negative size is invalid, this patch replaces negative size
with all free space size in ubi_create_vol().

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:34:44 +02:00
Weijie GaoandHeiko Schocher 14fe02ac5e cmd: ubi: export more APIs to public
Export the following functions to public:

- ubi_detach(): this is paired with ubi_part(). One may call this function
  to completely clean up the ubi subsystem after using ubi_part().

- ubi_{create,find,remove}_vol: this is a set of functions for volume
  management.

The original ubi_remove_vol is renamed to __ubi_remove_vol to allow the new
ubi_remove_vol() being used as a wrapper for __ubi_remove_vol() with volume
name.

Also, comments are added for all exported functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:34:12 +02:00
Weijie GaoandHeiko Schocher 75d8b453ab cmd: ubi: reorganize command messages
This patch moves normal subcommand messages into the main command function.
This will allow current and potential api functions being called with clean
output on success.

A new function ubi_require_volume() is added for finding and printing error
message if volume not found. The original ubi_find_volume() will be silent
for being an api function.

To avoid ubi_require_volume() being called twice for volume read/remove,
some changes are required:
- The parameter of ubi_remove_vol() is changed to accept
'struct ubi_volume *' directly.
- The original ubi_volume_read() is renamed to __ubi_volume_read, with its
  first parameter changed to accept also 'struct ubi_volume *' directly.
- A new ubi_volume_read() is added to wrap __ubi_volume_read() to accept
  volume name as its first parameter.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:33:09 +02:00
Weijie GaoandHeiko Schocher b452246c8d cmd: ubi: change all positive error return value to negative
Change all return value using errno codes to negative. This makes it
consistent with the linux ubi layer.

Also, to follow the standard definition of U-Boot command, in the do_ubi()
command handler, the return value is converted to CMD_RET_FAILURE for error
returning, and CMD_RET_USAGE for incorrect usage.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:30:53 +02:00
Weijie GaoandHeiko Schocher 2818e67821 cmd: ubi: change the type of parameter dynamic to bool
This patch changes the type of the 'dynamic' parameter of ubi_create_vol()
to bool as it's used as a boolean.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:30:37 +02:00
Weijie GaoandHeiko Schocher d9a9d72e45 cmd: ubifs: mark string parameters with const
File name and volume name should be const as they will not be modified in
these functions.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:30:14 +02:00
Weijie GaoandHeiko Schocher b63af5e2c2 cmd: ubi: use void * for buf parameter in ubi_volume_read
Use void * to avoid explicit type casting as what ubi_volume_write has done
already.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:29:55 +02:00
Weijie GaoandHeiko Schocher 065b0ba3b1 cmd: ubi: mark read-only function parameters with const
Parameters like part/volume name and buffer for writing are not being
modified by the callee functions and should be marked const.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:29:28 +02:00
Weijie GaoandHeiko Schocher a7d690cf3a ubi: remove unnecessary extern directive from function prototypes
The extern directive is unnecessary for function declaration and should be
removed.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2026-07-08 11:28:52 +02:00
Patrick DelaunayandHeiko Schocher 4c600f9813 fs: ubifs: fix ubifs_finddir() result check
ubifs_finddir() can return a negative error code (-ENOMEM or
PTR_ERR(dent)) and returns 1 when the name is found in the directory.
Fix the result check accordingly.

This fixes file existence detection (for "test -e") when U-Boot uses
UBIFS through ops ubifs_exists(). Since this function is also called
before other file operations, commands such as "load" could be executed
on a non-existing file without reporting an error.

Fixes: 0cab29ff46 ("fs: ubifs: Fix and rework error handling in ubifs_finddir")
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2026-07-08 11:28:23 +02:00
Michal Simek 34c89c840c arm: dts: zynqmp: Fix space indentation to use tabs
Fix indentation issues where spaces were used instead of tabs in several
ZynqMP device tree overlay files. Device tree files should use tabs for
indentation to maintain consistency with the kernel coding style.

Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/0dc7b65ebd48676719ace15a505ecec2f324822a.1782726386.git.michal.simek@amd.com
2026-07-08 08:55:52 +02:00
Michal Simek ad1d2c9d20 arm64: xilinx: Add missing newline in kr260-revA
Add missing newline available in Linux already.

Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/ab6f006ee87efb54ee17f24a12c9f31aafc2f2ae.1782726386.git.michal.simek@amd.com
2026-07-08 08:55:52 +02:00
Michal Simek fa1a638e7d arm64: zynqmp: Disable ina226 iio-hwmon nodes
ina226 IIO driver doesn't need to be enabled by default in Linux that's why
disable iio-hwmon nodes to avoid warnings about it.

Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/deb2e92d5030a31dbb91b36fa77de3ad2de38a71.1782726386.git.michal.simek@amd.com
2026-07-08 08:55:52 +02:00
Harini TandMichal Simek f717b9cf39 arch: arm: dts: Add RTC clock nodes for ZynqMP platform
Add fixed RTC clock nodes at 32.768 kHz for ZynqMP. The RTC driver uses
this clock to calculate the calibration value, replacing the deprecated
calibration device tree property.

Signed-off-by: Harini T <harini.t@amd.com>
Reviewed-by: Tomas Melin <tomas.melin@vaisala.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/8838c8c4fcd0dfe151bcee2a6c4da51df81e23cb.1782726386.git.michal.simek@amd.com
2026-07-08 08:55:52 +02:00
Michal Simek bbc71f8c28 arm64: versal-net: Add mmc_get_env_dev() and deduplicate MMC handling
The SD and eMMC cases in boot_targets_setup() duplicated the MMC device
lookup, and versal-net relied on the weak mmc_get_env_dev() default
instead of selecting the device matching the boot mode (unlike versal and
zynqmp).

Factor the lookup into mmc_get_bootseq(), mirroring spi_get_bootseq():
it maps the boot mode to the MMC node and returns the device sequence,
optionally handing back the mode banner so only boot_targets_setup()
prints it. mmc_get_env_dev() is now provided as a thin wrapper, and the
SD/eMMC cases call the helper instead of open-coding the lookups. The
local udevice pointer in boot_targets_setup() is no longer needed.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/7750a79c17146c66adeb83ad6d1bfa78b22ec8fa.1782219202.git.michal.simek@amd.com
2026-07-08 08:55:52 +02:00
Michal Simek d18ebbf339 arm64: versal-net: Look up eMMC device in boot_targets_setup()
The EMMC_MODE case set bootseq from dev_seq(dev) without ever assigning
dev, so it used an uninitialized pointer and produced a bogus device
sequence in boot_targets.

eMMC is wired to the SD1 controller (mmc@f1050000, see
versal-net-mini-emmc.dts). Look that device up like the SD cases do
before using its sequence number.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/bf779dcdd30c900d7614c0fa8382cb3f4cb57c20.1782219202.git.michal.simek@amd.com
2026-07-08 08:55:51 +02:00
Michal Simek e8f4248fc3 arm64: versal-net: Do not print bootmode from spi_get_env_dev()
spi_get_bootseq() printed the QSPI/OSPI mode banner, which is noise when
called from spi_get_env_dev() during environment setup. The banner is
only meaningful for the "Bootmode:" announcement in boot_targets_setup().

Make spi_get_bootseq() a pure lookup that returns the banner string
through an optional output argument instead of printing it.
spi_get_env_dev() passes NULL and stays silent, while
boot_targets_setup() prints the returned mode name as before.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/ae257af9d2fe026306b32c647e406450319a3c7a.1782219202.git.michal.simek@amd.com
2026-07-08 08:55:51 +02:00
Michal Simek d993827474 arm64: versal-net: Simplify spi_get_bootseq() bootmode switch
The QSPI and OSPI cases only differ in the SPI device name. Pick the name
in the switch and perform a single uclass_get_device_by_name() lookup
afterwards, instead of repeating the lookup and dev_seq() in every case.

No functional change.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/191f0f583e2d02c184ea2a2a2fe0ef473ca9fe61.1782219202.git.michal.simek@amd.com
2026-07-08 08:55:51 +02:00
Michal Simek fb3801be12 arm64: versal-net: Deduplicate SPI bootmode handling
spi_get_env_dev() and boot_targets_setup() both decoded the QSPI/OSPI
boot modes into a SPI device sequence number with identical
uclass_get_device_by_name() lookups.

Factor that logic into a single spi_get_bootseq() helper that takes the
bootmode and returns the device sequence. spi_get_env_dev() becomes a
thin wrapper around it, and boot_targets_setup() calls it for the
QSPI/OSPI cases instead of open-coding the lookups. Passing the bootmode
in avoids reading the bootmode register twice in boot_targets_setup().

No functional change.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/f98037220a20c441f0ea964f94647948bc035997.1782219202.git.michal.simek@amd.com
2026-07-08 08:55:51 +02:00
Michal Simek 4b62fc1b7e arm64: zynqmp: Decouple MMIO accessors from firmware
zynqmp_mmio_read() and zynqmp_mmio_write() selected between direct MMIO
and the firmware (PM_MMIO_READ/WRITE) interface with an in-function
IS_ENABLED(CONFIG_ZYNQMP_FIRMWARE) / current_el() check. Generic arch
code should not carry firmware-specific ifdefs, and with SCMI the access
method changes again.

Split the accessors like the multiboot and bootmode hooks: the weak
default in arch/arm/mach-zynqmp does the direct MMIO access (used in SPL,
at EL3 and when no firmware is present), while firmware-zynqmp.c provides
a strong definition that issues the firmware call and falls back to the
direct access in SPL/EL3 where the SMC path is unavailable. The raw MMIO
primitives zynqmp_mmio_rawread() and zynqmp_mmio_rawwrite() are exported
for the shared fallback, and the read-modify-write helper now uses the
raw read instead of routing through the firmware-aware accessor.

The firmware-vs-MMIO decision is selected at link time, so adding SCMI
later only requires a third strong definition with no changes to generic
code.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://patch.msgid.link/d532df144d2c8e34be835bad6d0de3b26befdf01.1782219202.git.michal.simek@amd.com
2026-07-08 08:55:51 +02:00