From 97979e894ba14d67e926322f4f770e3591a3e53c Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Thu, 12 Mar 2026 20:26:05 +0100 Subject: pci: imx: Properly support upstream Linux reset-gpios property The driver requests explicitly "reset-gpio" property, not the one with "gpios" suffix but upstream Linux kernel deprecated it in 2021. Existing upstream Linux kernel DTS is being changed to "reset-gpios" property, thus update the driver to read that one too. Note that driver is probably broken already, because it parsed GPIO in standard way respecting the flags and on top of that applied the "reset-gpio-active-high" flag, thus "reset-gpio ACTIVE_LOW" with the "reset-gpio-active-high" property would be double inverted. Signed-off-by: Krzysztof Kozlowski --- drivers/pci/pcie_imx.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/pci/pcie_imx.c b/drivers/pci/pcie_imx.c index 11c4ccbfc55..8d853ecf2c2 100644 --- a/drivers/pci/pcie_imx.c +++ b/drivers/pci/pcie_imx.c @@ -728,15 +728,31 @@ static int imx_pcie_dm_write_config(struct udevice *dev, pci_dev_t bdf, static int imx_pcie_dm_probe(struct udevice *dev) { struct imx_pcie_priv *priv = dev_get_priv(dev); + int ret; #if CONFIG_IS_ENABLED(DM_REGULATOR) device_get_supply_regulator(dev, "vpcie-supply", &priv->vpcie); #endif /* if PERST# valid from dt then assert it */ - gpio_request_by_name(dev, "reset-gpio", 0, &priv->reset_gpio, - GPIOD_IS_OUT); - priv->reset_active_high = dev_read_bool(dev, "reset-gpio-active-high"); + ret = gpio_request_by_name(dev, "reset-gpio", 0, &priv->reset_gpio, + GPIOD_IS_OUT); + if (!ret) { + /* + * Legacy property, invert assert logic based on + * reset-gpio-active-high. This won't work if flags are not + * matching the reset-gpio-active-high. + */ + priv->reset_active_high = dev_read_bool(dev, "reset-gpio-active-high"); + } else { + /* + * Linux kernel upstream property, assert active level based on + * GPIO flags, thus leave priv->reset_active_high=0. + */ + gpio_request_by_name(dev, "reset-gpios", 0, &priv->reset_gpio, + GPIOD_IS_OUT); + } + if (dm_gpio_is_valid(&priv->reset_gpio)) { dm_gpio_set_value(&priv->reset_gpio, priv->reset_active_high ? 0 : 1); -- cgit v1.3.1 From c42db5019df01db7ba6e0b9ed659b6d57ef5c22a Mon Sep 17 00:00:00 2001 From: Heiko Schocher Date: Tue, 24 Mar 2026 17:30:36 +0100 Subject: crypto: fsl: Select ARCH_MISC_INIT for CAAM driver The CAAM JR driver is initialized from arch_misc_init(). If ARCH_MISC_INIT is not enabled, the driver is never initialized, which can lead to crashes or hangs (e.g. during hash operations). Select ARCH_MISC_INIT when enabling FSL_CAAM to ensure proper initialization. Signed-off-by: Heiko Schocher Suggested-by: Fabio Estevam Reviewed-by: Peng Fan --- drivers/crypto/fsl/Kconfig | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/crypto/fsl/Kconfig b/drivers/crypto/fsl/Kconfig index fe694f6022c..eb01c6cf700 100644 --- a/drivers/crypto/fsl/Kconfig +++ b/drivers/crypto/fsl/Kconfig @@ -3,6 +3,7 @@ if ARM || PPC config FSL_CAAM bool "Freescale Crypto Driver Support" select SHA_HW_ACCEL + select ARCH_MISC_INIT # hw_sha1() under drivers/crypto, and needed with SHA_HW_ACCEL select MISC if DM imply SPL_CRYPTO if (ARM && SPL) -- cgit v1.3.1 From 7917c2e356042505c7dea469c358f07b6e424fa2 Mon Sep 17 00:00:00 2001 From: Tomas Alvarez Vanoli Date: Tue, 24 Mar 2026 18:02:12 +0100 Subject: spi: fsl_espi: fix din offset In the case of SPI_XFER_BEGIN | SPI_XFER_END, the function creates a buffer of double the size of the transaction, so that it can write the data in into the second half. It sets the rx_offset to len, and in the while loop we are setting an internal "din" to buffer + rx_offset. However, at the end of each loop, the driver copies "buffer + 2 * cmd_len" back to the data_in pointer. This commit changes the source of the data to buffer + rx_offset. Signed-off-by: Tomas Alvarez Vanoli --- drivers/spi/fsl_espi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index 7ed35aa3e66..117e36376b7 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -275,7 +275,7 @@ int espi_xfer(struct fsl_spi_slave *fsl, uint cs, unsigned int bitlen, } } if (data_in) { - memcpy(data_in, buffer + 2 * cmd_len, tran_len); + memcpy(data_in, buffer + rx_offset, tran_len); if (*buffer == 0x0b) { data_in += tran_len; data_len -= tran_len; -- cgit v1.3.1