summaryrefslogtreecommitdiff
path: root/include/linux
AgeCommit message (Collapse)Author
2025-12-04Merge patch series "Add support for SM3 secure hash"Tom Rini
Heiko Schocher <hs@nabladev.com> says: Add SM3 secure hash, as specified by OSCCA GM/T 0004-2012 SM3 and described at https://datatracker.ietf.org/doc/html/draft-sca-cfrg-sm3-02 TPMv2 defines hash algo sm3_256, which is currently not supported and prevented TPMv2 chip with newer firmware to work with U-Boot. Seen this on a ST33TPHF2XI2C u-boot=> tpm2 init u-boot=> tpm2 autostart tpm2_get_pcr_info: too many pcrs: 5 Error: -90 u-boot=> Implement sm3 hash, so we can fix this problem. Link: https://lore.kernel.org/r/20251118043042.27726-1-hs@nabladev.com
2025-12-04lib: Import rol32 function from LinuxHeiko Schocher
sm3 crypto algorithm uses rol32 function from linux, so import it. Linux base was: commit ca91b9500108:("Merge tag 'v6.15-rc4-ksmbd-server-fixes' of git://git.samba.org/ksmbd") Signed-off-by: Heiko Schocher <hs@nabladev.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-11-18mtd: spinand: add support for FudanMicro FM25S01ATianling Shen
Add support for FudanMicro FM25S01A SPI NAND. This driver is ported from linux v6.18 and tested on a MT7981 board. Link: https://lore.kernel.org/linux-mtd/20250824170013.3328777-1-cnsztl@gmail.com/ Reviewed-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Signed-off-by: Tianling Shen <cnsztl@gmail.com>
2025-10-28mtd: Add function prototype for mtd_read_oob_bf(...)Tom Rini
The function mtd_read_oob_bf is called by cmd/nand.c but does not have a prototype in any header. Add this to include/linux/mtd/mtd.h as that is the most logical place currently. Fixes: 1fac57720719 ("nand: Add a watch command") Signed-off-by: Tom Rini <trini@konsulko.com>
2025-10-17clk: at91: remove default values for PMC_PLL_ACRManikandan Muralidharan
Remove default values for PMC PLL Analog Control Register(ACR) as the values are specific for each SoC and PLL, so load them from PLL characteristics structure Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com> Signed-off-by: Varshini Rajendran <varshini.rajendran@microchip.com>
2025-10-10include: completion.h: Convert the rest of the dummy functions to macrosTom Rini
While we declare some of our dummy functions as "inline" we do not also declare them as "static" and so it is possible for the compiler to decide to make these as global functions instead. This can lead to link time failures in some cases, such as "allyesconfig". As these are just dummy functions, convert them to a macro instead. Signed-off-by: Tom Rini <trini@konsulko.com>
2025-10-10Merge branch 'uboot-05102025' of ↵Tom Rini
https://source.denx.de/u-boot/custodians/u-boot-nand-flash This series adds significant and valuable work by Mikhail Kshevetskiy to align spi-mem with Linux 6.16. It also includes contributions to the mtd performance patches, a work started by Miquel Raynal and improved by Mikhail Kshevetskiy. Additionally, two patches tighten dependencies on the Atmel driver. The patches pass the pipeline CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/27873
2025-10-05mtd: spinand: Sync core code and device support with Linux 6.17-rc1Mikhail Kshevetskiy
This makes the U-Boot SPI NAND driver almost the same as in Linux 6.17-rc1. The only major differences are: * support of ECC engines. The Linux driver supports different ECC engines while U-Boot uses on-die ECC only. * per operation maximum SPI bus frequency Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Add a ->configure_chip() hookMiquel Raynal
There is already a manufacturer hook, which is manufacturer specific but not chip specific. We no longer have access to the actual NAND identity at this stage so let's add a per-chip configuration hook to align the chip configuration (if any) with the core's setting. This is a port of linux commit da55809ebb45 ("mtd: spinand: Add a ->configure_chip() hook") Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: add OTP supportMikhail Kshevetskiy
The code was ported from linux-6.15 based on a linux commit c06b1f753bea (mtd: spinand: add OTP support) created by Martin Kurbanov <mmkurbanov@salutedevices.com> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Add read retry supportCheng Ming Lin
When the host ECC fails to correct the data error of NAND device, there's a special read for data recovery method which can be setup by the host for the next read. There are several retry levels that can be attempted until the lost data is recovered or definitely assumed lost. This is the port of linux commit f2cb43c98010 (mtd: spinand: Add read retry support) Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: add support of continuous reading modeMikhail Kshevetskiy
The code was ported from linux-6.12. The original continuous reading support was implemented by Miquel Raynal <miquel.raynal@bootlin.com> in linux commit 631cfdd0520d (mtd: spi-nand: Add continuous read support). Here is an original patch description: -------------------------------------- A regular page read consist in: - Asking one page of content from the NAND array to be loaded in the chip's SRAM, - Waiting for the operation to be done, - Retrieving the data (I/O phase) from the chip's SRAM. When reading several sequential pages, the above operation is repeated over and over. There is however a way to optimize these accesses, by enabling continuous reads. The feature requires the NAND chip to have a second internal SRAM area plus a bit of additional internal logic to trigger another internal transfer between the NAND array and the second SRAM area while the I/O phase is ongoing. Once the first I/O phase is done, the host can continue reading more data, continuously, as the chip will automatically switch to the second SRAM content (which has already been loaded) and in turns trigger the next load into the first SRAM area again. From an instruction perspective, the command op-codes are different, but the same cycles are required. The only difference is that after a continuous read (which is stopped by a CS deassert), the host must observe a delay of tRST. However, because there is no guarantee in Linux regarding the actual state of the CS pin after a transfer (in order to speed-up the next transfer if targeting the same device), it was necessary to manually end the continuous read with a configuration register write operation. Continuous reads have two main drawbacks: * They only work on full pages (column address ignored) * Only the main data area is pulled, out-of-band bytes are not accessible. Said otherwise, the feature can only be useful with on-die ECC engines. Performance wise, measures have been performed on a Zynq platform using Macronix SPI-NAND controller with a Macronix chip (based on the flash_speed tool modified for testing sequential reads): - 1-1-1 mode: performances improved from +3% (2-pages) up to +10% after a dozen pages. - 1-1-4 mode: performances improved from +15% (2-pages) up to +40% after a dozen pages. This series is based on a previous work from Macronix engineer Jaime Liao. -------------------------------------- Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Introduce a way to avoid raw accessTakahiro Kuwano
SkyHigh spinand device has ECC enable bit in configuration register but it must be always enabled. If ECC is disabled, read and write ops results in undetermined state. For such devices, a way to avoid raw access is needed. Introduce SPINAND_NO_RAW_ACCESS flag to advertise the device does not support raw access. In such devices, the on-die ECC engine ops returns error to I/O request in raw mode. Checking and marking BBM need to be cared as special case, by adding fallback mechanism that tries read/write OOB with ECC enabled. This is a port of linux commit 6d9d6ab3a82a (mtd: spinand: Introduce a way to avoid raw access) Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Add support for setting plane select bitsCheng Ming Lin
Add two flags for inserting the Plane Select bit into the column address during the write_to_cache and the read_from_cache operation. Add the SPINAND_HAS_PROG_PLANE_SELECT_BIT flag for serial NAND flash that require inserting the Plane Select bit into the column address during the write_to_cache operation. Add the SPINAND_HAS_READ_PLANE_SELECT_BIT flag for serial NAND flash that require inserting the Plane Select bit into the column address during the read_from_cache operation. This is a port of linux commit ca229bdbef29 (mtd: spinand: Add support for setting plane select bits) Signed-off-by: Cheng Ming Lin <chengminglin@mxic.com.tw> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20240909092643.2434479-2-linchengming884@gmail.com Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Sync core code and device support with Linux 6.10Mikhail Kshevetskiy
This makes the U-Boot SPI NAND driver almost the same as in Linux 6.10. The only major difference is support of ECC engines. The Linux driver supports different ECC engines while U-Boot uses on-die ECC only. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Extend spinand_wait() to match Linux kernel implementationMikhail Kshevetskiy
This aligns spinand_wait() with the linux kernel. Instead of calling into spi_mem_poll_status() which is not implemented in U-Boot, we code the polling logic and make sure that schedule() is called periodically. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: nand: Add a NAND page I/O request typeMiquel Raynal
Use an enum to differentiate the type of I/O (reading or writing a page). Also update the request iterator. This is a port of linux commit 701981cab016 ("mtd: nand: Add a NAND page I/O request type") Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Link: https://lore.kernel.org/linux-mtd/20200827085208.16276-5-miquel.raynal@bootlin.com Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> # U-Boot port Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-05mtd: spinand: Use the spi-mem dirmap APIMikhail Kshevetskiy
Make use of the spi-mem direct mapping API to let advanced controllers optimize read/write operations when they support direct mapping. Based on a linux commit 981d1aa0697c ("mtd: spinand: Use the spi-mem dirmap API") created by Boris Brezillon <bbrezillon@kernel.org> with additional fixes taken from Linux 6.10. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
2025-10-03linux/kernel.h: Update upper_NN_bits() and lower_NN_bits() macrosMarek Vasut
Synchronize upper_NN_bits() and lower_NN_bits() macros with Linux 6.16 commit 118d777c4cb4 ("wordpart.h: Add REPEAT_BYTE_U32()"). This fixes the lower_32_bits() macros and assures it works with 64bit systems correctly. This also adds 16bit variants of these macros, which will be used by the Airoha PHY driver. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2025-09-18ioport: Add resource check helpersPatrice Chotard
Add resource_overlaps() and resource_contains() helpers. Code copied from kernel source. Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
2025-08-06i3c: master: dw-i3c-master: Fix OD_TIMING for spike filterDinesh Maniyam
Fix the I3C device with spike filter unable to detect issue by setting tHIGH_INIT to 200ns for first broadcast address. This is according to MIPI SPEC 1.1.1 for first broadcast address which is already part of linux upstreamed patch. Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
2025-08-06drivers: i3c: Add driver for MIPI DWI3CDinesh Maniyam
Enable driver for Synopsis MIPI DWI3C for the family device agilex5. This driver is migrated from linux version 6.6.37 LTS Signed-off-by: Dinesh Maniyam <dinesh.maniyam@altera.com>
2025-07-14Merge patch series "integer limit macro consolidation"Tom Rini
Rasmus Villemoes <ravi@prevas.dk> says: I was bitten by our limit macros not being usable in #if conditionals when building a standalone app. It turns out that the work to fix that had already been started by the inclusion of the mbedtls library, so it's something that people do hit. Let's finish the job by providing suitable limit macros for all three families: - Standard C types, char, short, ... - Kernel-style fixed-width types s8, u64, ... - POSIX/C99 fixed-width types int16_t, uint32_t, ... Please note that a naive approach like spelling out the full decimal value for the constants doesn't really work, as there is no such thing as a "negative integer constant". That is, doing #define LLONG_MIN -9223372036854775808LL would lead to the compiler complaining warning: integer constant is so large that it is unsigned and the type of that LLONG_MIN would actually be "unsigned long long", so e.g. #if LLONG_MIN >= 0 #warning "LLONG_MIN is not negative?" #endif would fire. Link: https://lore.kernel.org/r/20250707203655.613340-1-ravi@prevas.dk
2025-07-14limits.h: provide all limit macros for standard [u]intNN_t typesRasmus Villemoes
Currently, we only have UINT32_MAX and UINT64_MAX in limits.h, and then stdint.h and kernel.h somewhat randomly define UINT8_MAX and INT32_MAX, respectively. Provide a full set of definitions in terms of the min/max macros for the types that [u]intNN_t are defined in terms of, namely the {s,u}NN ones. Try to avoid breaking whatever depended on getting UINT8_MAX from our compat stdint.h by replacing it with an include of limits.h. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-07-14move limits for sNN/uNN types from kernel.h to limits.hRasmus Villemoes
Since we define the {s,u}{8,16,32,64} types the same way on all architectures, i.e. everybody uses asm-generic/int-ll64.h, we can just define the associated limit macros in terms of those for the corresponding types. This eliminates another set of limit macros that are not usable in #if conditionals. These type names and macros are not C or POSIX, so there's no language violation, but certainly a violation of developers' reasonable expectations. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-07-14move more limits from kernel.h to limits.h and standardize their definitionsRasmus Villemoes
In a customer project that was building a stand-alone application, I hit a problem related to the fact that our LONG_MAX and friends are not standards-compliant, in that they are not "suitable for use in #if preprocessing directives" ... /toolchain_none/arm-cortexa8-eabi/sys-include/machine/_default_types.h:25:31: error: missing binary operator before token "long" 25 | || ( defined(LLONG_MAX) && (LLONG_MAX > 0x7fffffff) ) | ^~~~~~~~~ So following up on commit 13de8483388 ("mbedtls: add mbedtls into the build system"), move the rest of the macros associated to the standard C types {signed,unsigned} {char, short, int, long, long long} (and of course bare 'char') to limits.h. Make use of the fact that both gcc and clang provide suitable predefined __FOO_MAX__ macros for the signed types, and use a standard scheme for defining the FOO_MIN and UFOO_MAX macros in terms of FOO_MAX. Note that suffixes like L and ULL are allowed for preprocessor integers; it is (casts) which are not. And using appropriate suffixes, we can arrange for the type of e.g. UINT_MAX to be "unsigned int" due to integer promotion rules. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-06-18Merge patch series "Print version of the DM firmware"Tom Rini
Moteen Shah <m-shah@ti.com> says: This patch series adds the functionality to print the DM firmware version being used. Before requesting TISCI for the DM version we first check if the DM split mode capability exists, if yes, we proceed onto making the call to TISCI for retrieving the version information. DM split mode capability indicates that the DM is a separate binary altogether and has its own versioning information similar to TIFS. Boot Logs: https://gist.github.com/Jamm02/37864f605445944a0c0caf426e0aba50 Link: https://software-dl.ti.com/tisci/esd/latest/2_tisci_msgs/general/core.html#tisci-msg-query-fw-caps Link: https://lore.kernel.org/r/20250609081434.1000377-1-m-shah@ti.com
2025-06-18ti_sci_* : Add capability to access DM firmware's metadataMoteen Shah
Introduce response and request structs to receive and request information regarding DM version, etc from TI SCI. Signed-off-by: Moteen Shah <m-shah@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Dhruva Gole <d-gole@ti.com>
2025-06-18ti_sci_*: Add utility to access tisci firmware and SOC capabilityMoteen Shah
Introduce response and request structs for receiving information regarding FW/SOC capability from DM. The received capability can further be used to call certain API's based on the feature supoorted by the DM firmware. Signed-off-by: Moteen Shah <m-shah@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com> Reviewed-by: Dhruva Gole <d-gole@ti.com>
2025-06-18Merge patch series "list.h/treewide: get rid of no-op prefetch()"Tom Rini
Rasmus Villemoes <ravi@prevas.dk> says: While looking through list.h, I saw that the regular list_* helpers (and one of the hlist_* ones) still contain the prefetch() that was removed in linux 14 years ago. It doesn't do anything, but makes the macros harder to read, so get rid of it, and the fallback, no-op definition that they relied on. That requires removing a few uses outside list.h as well. checkpatch warns about some whitespace issues in list.h, but as I've copied whole kerneldoc+#define blocks directly from the linux kernel, I think it's better to just accept that so that we don't introduce needless diffs. The "macro argument reuse" arguments should also be ignored, as e.g. the "member" arguments are obviously always just bare identifiers, and the "pos" arguments must be assigned to multiple times. Link: https://lore.kernel.org/r/20250507121246.518691-1-ravi@prevas.dk
2025-06-18linux/list.h: drop fallback definition of prefetch()Rasmus Villemoes
None of the list helpers use prefetch() anymore, and no C code relies on getting this definition from list.h. In any case, such an arch/cpu specific thing does not belong in a header that just consists of cpp helper macros. Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-06-18linux/list.h: drop use of prefetch()Rasmus Villemoes
The use of prefetch() in these list helpers was dropped back in 2011 in linux (e66eed651fd1 ("list: remove prefetching from regular list iterators")). No arch in U-Boot defines any actual prefetch(), and as the referenced commit says, it's usually not a win anyway. Whole-sale sync of list.h is not really feasible, but we can synchronize the macros containing a prefetch() with their linux implementations as of v6.15-rc5, also importing the various helpers needed, e.g. list_is_head() and list_next_entry(). Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
2025-06-14Merge patch series "linux/bitfield.h: sync <linux/bitfield.h> from Linux ↵Tom Rini
6.15 + winbond" Christian Marangi <ansuelsmth@gmail.com> says: This small series sync linux/bitfield.h from Linux 6.15 and fix all the compilation error due to a change in the header include. The sync is needed to make it easier to support the winbond changes. The changes are CI test with [1] [1] https://github.com/u-boot/u-boot/pull/777 Link: https://lore.kernel.org/r/20250607211133.2005-1-ansuelsmth@gmail.com
2025-06-14linux/bitfield.h: sync <linux/bitfield.h> from Linux 6.15Christian Marangi
Sync bitfield.h header with Linux 6.15 version. Mainly is to permit the introduction of FIELD_PREP_CONST. The bug.h header changed to build_bug.h doesn't cause any regression as we also ship split header similar to how it's done with in Linux. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-06-11clk: add CONFIG_CLK_AUTO_IDPatrick Delaunay
Add a new config CONFIG_CLK_AUTO_ID to support a unique clk id for all the clock providers, managed by clk uclass, when the clock reference arg[0] is the same. When the CONFIG is activated, the clock id is limited to the lower CLK_ID_SZ = 24 bits in default clock xlate function and the sequence number + 1 of the clk provider device is added for the 8 higher bits. We use sequence number + 1 to avoid the "dummy" clock id = 0, used for invalid clock when CCF is activated. When this config is activated, the new function clk_get_id() should be used to get back the internal reference to clock for the each clock provider. Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com> Cc: Lukasz Majewski <lukma@denx.de> Cc: Sean Anderson <seanga2@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-06-03linux/sizes.h: sync from kernelEmanuele Ghidoli
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>
2025-04-29mtd: spi-nor: Use CONFIG_IS_ENABLED for CONFIG_SPI_FLASH_BAR definesBernhard Messerklinger
At the moment a mixture of ifdef(CONFIG_IS_ENABLED) and CONFIG_IS_ENABLED(SPI_FLASH_BAR) is used in the spi-nor framework. This leads to misbehaviour in the SPL as there is no Kconfig option CONFIG_SPL_SPI_FLASH_BAR. This commit standardizes the use of CONFIG_SPI_FLASH to get SPLs that load U-Boot proper from the SPI flash to work again. Fixes: 9bb02f7 (mtd: spi-nor: Fix the spi_nor_read() when config SPI_STACKED_PARALLEL is enabled) Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
2025-04-28clk: imx: Pass CCM udevice into clk_register_composite()Marek Vasut
Pass the clock controller udevice into clk_register_composite(), so it can be passed further to any registered composite clocks and used for look up of parent clock referenced in DT "clocks" and "clock-names" properties by phandle and name pair. Use the clock controller udevice in imx8m_clk_mux_set_parent() to perform accurate look up of parent clock referenced in the CCM driver by name. If the clock name that is being looked up matches one of the names listed in the clock controller DT node "clock-names" array property, then the offset of the name is looked up in the "clocks" DT property and the phandle at that offset is resolved to the parent clock udevice. The test to determine whether a particular driver instance registered with clock uclass matches the parent clock is done by comparing the OF nodes of the clock registered with clock uclass and parent clock resolved from the phandle. Example: drivers/clk/imx/clk-imx8mm.c: static const char * const imx8mm_a53_sels[] = {"osc_24m", "arm_pll_out", ... _____________| arch/arm/dts/imx8mm.dtsi: | clk: clock-controller@30380000 { v clock-names = "osc_32k", "osc_24m", ... | v clocks = <&osc_32k>, <&osc_24m>, ... }; _______________________| ... | / { v osc_24m: clock-osc-24m { compatible = "fixed-clock"; ... }; Signed-off-by: Marek Vasut <marex@denx.de> Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com> Tested-by: Fabio Estevam <festevam@gmail.com> Tested-by: Adam Ford <aford173@gmail.com> # imx8mp-beacon
2025-04-23usb: gadget: introduce 'enabled' flag in struct usb_epStephan Gerhold
f_acm calls usb_ep_disable(f_acm->ep_notify) unconditionally in acm_start_ctrl(), even if the USB endpoint was never enabled before. This causes crashes for some UDC drivers (e.g. ci_udc), because they dereference data structures that are assigned only after having called usb_ep_enable(). The f_acm driver in U-Boot is similar to the Linux driver, where this issue does not occur because usb_ep_disable() and usb_ep_enable() internally track the enabled state. In Linux this change was made in commit b0bac2581c19 ("usb: gadget: introduce 'enabled' flag in struct usb_ep") by Robert Baldyga. Fix the crashes for f_acm by making the same change in U-Boot. This makes the API less bug-prone and avoids introducing crashes when adapting new gadget drivers from Linux. Signed-off-by: Stephan Gerhold <stephan.gerhold@linaro.org> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Link: https://lore.kernel.org/r/20250407-acm-fixes-v1-3-e3dcb592d6d6@linaro.org Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2025-04-22arm: socfpga: soc64: Update reset manager registers for F2S bridgeAlif Zakuan Yuslaimi
Add reset manager registers in preparation for F2S bridge reset support as well as the mask support to enable/disable the bridges. Mask value: BIT0: soc2fpga BIT1: lwhps2fpga BIT2: fpga2soc These bridges are available only in Stratix10: BIT3: f2sdram0 BIT4: f2sdram1 BIT5: f2sdram2 Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com> Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-04-16spi: drop unneeded spi.h header include from spinand.hChristian Marangi
Drop unneeded spi.h header include from spinand.h, nothing included by spi.h is actually used in this header and .c should correctly included spi.h if actually needed. Replace spi.h with linux/bitops.h as this is what is actually required for spinand.h Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-04-14firmware: ti_sci: Scan all device instances when releasing exclusive devicesNishanth Menon
When FIT image with multiple dtbs are involved for R5 boot process, R5 SPL starts off with the first instance of dtb to probe the eeprom, then once we have identified the type of board, invocation of setup_multi_dtb_fit will replace the gd->fdt_blob with the proper board dtb match. However, when we do this, two things happen: a) Prior to the invocation of setup_multi_dtb_fit, as part of the eeprom discovery process, i2c controller device is already probed and marked as exclusive with the match of the very first tisci match (from the original boot dtb). This list is stored in the info->dev_list of the first probe. b) When the second dtb is loaded, tisci is probed again (since this is a new node) and the new info->dev_list is empty. At this stage, the exclusive devices such as i2c instances used to probe the board information is left in the old info->dev_list that is no longer used actively by the system using the replaced dtb. As a result of this, the cleanup we intend to do with ti_sci_cmd_release_exclusive_devices is no longer complete and leaves the instances such as i2c for eeprom marked used as we scan just the new info->dev_list. This creates a problem when Device Manager(DM) firmware starts up later on in the boot process and identifies that this instance of i2c is already marked active, so it assumes this can no longer be controlled by software and is marked internally as reserved and HLOS can no longer control these instances. This defeated the purpose of ti_sci_cmd_release_exclusive_devices. NOTE: This scheme works just fine if the FIT has just a single dtb as the info->dev_list is upto date. To fix this, let us make ti_sci_cmd_release_exclusive_devices scan the all registrations of tisci instances and cleanup all exclusive devices that have ever been registered. As part of this, change the prototype of release_exclusive_devices to drop the handle since that has no further meaning now. Though this issue was identified on AM64-sk, this can be present in other builds which use multi-fit-dtb for R5 SPL startup. Fixes: 9566b777ae0a ("firmware: ti_sci: Add a command for releasing all exclusive devices") Signed-off-by: Nishanth Menon <nm@ti.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2025-04-02Merge patch series "fs: exfat: Add exfat port based on exfat-fuse"Tom Rini
Marek Vasut <marex@denx.de> says: Import exfat-fuse libexfat, add U-Boot filesystem layer porting glue code and wire exfat support into generic filesystem support code. This adds exfat support to U-Boot. Fill in generic filesystem interface for mkdir and rm commands. Make filesystem tests test the generic interface as well as exfat, to make sure this code does not fall apart. Link: https://github.com/relan/exfat/commits/0b41c6d3560d ("CI: bump FreeBSD to 13.1.") Link: https://lore.kernel.org/r/20250317031418.223019-1-marex@denx.de
2025-04-02linux: Add generic struct stat {}Marek Vasut
Add generic implementation of struct stat {} imported from Linux 6.13.y commit 27560b371ab8 ("fs: pack struct kstat better"). This can be used by filesystem code imported from elsewhere. Now struct stat {} becomes available on all supported architectures. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: clk-fixed-factor: Use struct udevice instead of struct deviceMarek Vasut
Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-fixed-factor registration. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: clk-divider: Use struct udevice instead of struct deviceMarek Vasut
Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-divider clock registration. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: clk-composite: Use struct udevice instead of struct deviceMarek Vasut
Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-composite registration. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: clk-gate: Use struct udevice instead of struct deviceMarek Vasut
Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-gate registration. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-24clk: clk-mux: Use struct udevice instead of struct deviceMarek Vasut
Use U-Boot specific struct udevice instead of Linux compatibility struct device in clk-mux registration. Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-15drivers: mtd: nand: base: Add support for Hardware ECC for check bad blockDinesh Maniyam
Leverage linux code to support hardware ECC interface to verify nand bad block. Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>