summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadmarao Begari <[email protected]>2026-02-15 20:46:26 +0530
committerMichal Simek <[email protected]>2026-03-23 14:58:46 +0100
commit834d589b8f1cca0779566824074cdb7b930bc904 (patch)
tree25fd707d05297f134fce3a18d89fb0b2f99c1987
parent1dcaeffc9ca3c74b059711b82d01f03f37b46d6e (diff)
spi: cadence_qspi: pulse controller reset at probe
The driver previously only deasserted the optional bulk reset, leaving the controller in whatever state earlier stages left it and risking failed probes or bad transfers. Assert the reset first, wait 10 µs, and then deassert so the OSPI block starts from a known state. Signed-off-by: Padmarao Begari <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/[email protected]
-rw-r--r--drivers/spi/cadence_qspi.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index d1404e13810..2a4a49c5f1c 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -13,6 +13,7 @@
#include <spi.h>
#include <spi-mem.h>
#include <dm/device_compat.h>
+#include <linux/delay.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/io.h>
@@ -254,8 +255,23 @@ static int cadence_spi_probe(struct udevice *bus)
}
priv->resets = devm_reset_bulk_get_optional(bus);
- if (priv->resets)
- reset_deassert_bulk(priv->resets);
+ if (priv->resets) {
+ /* Assert all OSPI reset lines */
+ ret = reset_assert_bulk(priv->resets);
+ if (ret) {
+ dev_err(bus, "Failed to assert OSPI reset: %d\n", ret);
+ return ret;
+ }
+
+ udelay(10);
+
+ /* Deassert all OSPI reset lines */
+ ret = reset_deassert_bulk(priv->resets);
+ if (ret) {
+ dev_err(bus, "Failed to deassert OSPI reset: %d\n", ret);
+ return ret;
+ }
+ }
if (!priv->qspi_is_init) {
cadence_qspi_apb_controller_init(priv);