summaryrefslogtreecommitdiff
path: root/target/linux/layerscape/patches-4.4/4047-drivers-memory-Fix-build-error-for-arm64.patch
blob: da7f18f1f9cdef4bcedaffc275128241ce7b7b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From 0ce5d6bd62a9f1dbaa2d39c3535a8bdb31cf7951 Mon Sep 17 00:00:00 2001
From: Raghav Dogra <raghav.dogra@nxp.com>
Date: Wed, 24 Feb 2016 23:12:58 +0530
Subject: [PATCH 47/70] drivers/memory: Fix build error for arm64

Replace spin_event_timeout() with arch independent macro

Signed-off-by: Raghav Dogra <raghav.dogra@nxp.com>
Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
---
 drivers/memory/fsl_ifc.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

--- a/drivers/memory/fsl_ifc.c
+++ b/drivers/memory/fsl_ifc.c
@@ -39,7 +39,7 @@
 struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
 EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
 #define FSL_IFC_V1_3_0	0x01030000
-#define IFC_TIMEOUT_MSECS	100000 /* 100ms */
+#define IFC_TIMEOUT_MSECS	1000 /* 1000ms */
 
 /*
  * convert_ifc_address - convert the base address
@@ -365,7 +365,7 @@ static int fsl_ifc_resume(struct device
 	struct fsl_ifc_runtime __iomem *runtime = ctrl->rregs;
 	struct fsl_ifc_fcm *savd_gregs = ctrl->saved_gregs;
 	struct fsl_ifc_runtime *savd_rregs = ctrl->saved_rregs;
-	uint32_t ver = 0, ncfgr, status, ifc_bank, i;
+	uint32_t ver = 0, ncfgr, timeout, ifc_bank, i;
 
 /*
  * IFC interrupts disabled
@@ -469,12 +469,14 @@ static int fsl_ifc_resume(struct device
 		ifc_out32(ncfgr | IFC_NAND_SRAM_INIT_EN,
 					&runtime->ifc_nand.ncfgr);
 		/* wait for  SRAM_INIT bit to be clear or timeout */
-		status = spin_event_timeout(
-					!(ifc_in32(&runtime->ifc_nand.ncfgr)
-					& IFC_NAND_SRAM_INIT_EN),
-					IFC_TIMEOUT_MSECS, 0);
+		timeout = 10;
+		while ((ifc_in32(&runtime->ifc_nand.ncfgr) &
+			IFC_NAND_SRAM_INIT_EN) && timeout) {
+			mdelay(IFC_TIMEOUT_MSECS);
+			timeout--;
+		}
 
-		if (!status)
+		if (!timeout)
 			dev_err(ctrl->dev, "Timeout waiting for IFC SRAM INIT");
 	}