[RFC PATCH 5/5] sysreset: call .on_reset for UCLASS_SPI_FLASH before reset request

Robert Marko robert.marko at sartura.hr
Tue May 7 12:03:53 CEST 2024


Call .on_reset method for UCLASS_SPI_FLASH devices before requesting
reset.

This fixes the issue with 4-byte adressing mode being left enabled on
board reset.
That is an issue on Qualcomm IPQ4019 boards since the CPU expects flash
to be in 3-byte adressing mode and will just hang otherwise.

Note that this does not fix a case where you remove the power while U-Boot
is still running and in that case it will still be stuck in 4-byte mode.

Signed-off-by: Robert Marko <robert.marko at sartura.hr>
---
 drivers/sysreset/sysreset-uclass.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c
index 6151b5fe03..8321cc4230 100644
--- a/drivers/sysreset/sysreset-uclass.c
+++ b/drivers/sysreset/sysreset-uclass.c
@@ -30,6 +30,13 @@ int sysreset_request(struct udevice *dev, enum sysreset_t type)
 	if (!ops->request)
 		return -ENOSYS;
 
+	/*
+	 * Call the .on_reset op for SPI flash devices.
+	 * This is required for most devices in order to exit the
+	 * 4-byte adressing mode.
+	 */
+	uclass_id_on_reset(UCLASS_SPI_FLASH);
+
 	return ops->request(dev, type);
 }
 
-- 
2.45.0



More information about the U-Boot mailing list