Skip to contentSkip to conversation

spi: sirf: reset SPI controller in init stage

PATCH Applied Barry Song 2 participants 2 messages Nov 20, 2014 – Nov 21, 2014 1 message not in the archive SPI

lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/1 spi: sirf: reset SPI controller in init stage

From: Qipan Li <[email protected]>

in SPI boot mode, romcode uses SPI controller to fetch data from NOR flash. Here we need to reset the hardware IP to restore its state.

---
 drivers/spi/spi-sirf.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/spi/spi-sirf.c +7 -0
index 90dc05b..73a88b3 100644
@@ -23,6 +23,7 @@
 #include <linux/dmaengine.h>
 #include <linux/dma-direction.h>
 #include <linux/dma-mapping.h>
+#include <linux/reset.h>
 
 #define DRIVER_NAME "sirfsoc_spi"
 
@@ -647,6 +648,12 @@ static int spi_sirfsoc_probe(struct platform_device *pdev)
 	int irq;
 	int i, ret;
 
+	ret = device_reset(&pdev->dev);
+	if (ret) {
+		dev_err(&pdev->dev, "SPI reset failed!\n");
+		return ret;
+	}
+
 	master = spi_alloc_master(&pdev->dev, sizeof(*sspi));
 	if (!master) {
 		dev_err(&pdev->dev, "Unable to allocate SPI master\n");
Signature · 6 lines
2.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1416493987-6024-1-git-send-email-21cnbao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

Applied
#2 lore raw
Quoted 4 lines · Barry Song

From: Qipan Li <[email protected]>

in SPI boot mode, romcode uses SPI controller to fetch data from NOR flash. Here we need to reset the hardware IP to restore its state.

Applied, thanks.