layerscape: add 64b/32b target for ls1043ardb device
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 4047-drivers-memory-Fix-build-error-for-arm64.patch
1 From 0ce5d6bd62a9f1dbaa2d39c3535a8bdb31cf7951 Mon Sep 17 00:00:00 2001
2 From: Raghav Dogra <raghav.dogra@nxp.com>
3 Date: Wed, 24 Feb 2016 23:12:58 +0530
4 Subject: [PATCH 47/70] drivers/memory: Fix build error for arm64
5
6 Replace spin_event_timeout() with arch independent macro
7
8 Signed-off-by: Raghav Dogra <raghav.dogra@nxp.com>
9 Signed-off-by: Prabhakar Kushwaha <prabhakar.kushwaha@nxp.com>
10 ---
11 drivers/memory/fsl_ifc.c | 16 +++++++++-------
12 1 file changed, 9 insertions(+), 7 deletions(-)
13
14 --- a/drivers/memory/fsl_ifc.c
15 +++ b/drivers/memory/fsl_ifc.c
16 @@ -39,7 +39,7 @@
17 struct fsl_ifc_ctrl *fsl_ifc_ctrl_dev;
18 EXPORT_SYMBOL(fsl_ifc_ctrl_dev);
19 #define FSL_IFC_V1_3_0 0x01030000
20 -#define IFC_TIMEOUT_MSECS 100000 /* 100ms */
21 +#define IFC_TIMEOUT_MSECS 1000 /* 1000ms */
22
23 /*
24 * convert_ifc_address - convert the base address
25 @@ -365,7 +365,7 @@ static int fsl_ifc_resume(struct device
26 struct fsl_ifc_runtime __iomem *runtime = ctrl->rregs;
27 struct fsl_ifc_fcm *savd_gregs = ctrl->saved_gregs;
28 struct fsl_ifc_runtime *savd_rregs = ctrl->saved_rregs;
29 - uint32_t ver = 0, ncfgr, status, ifc_bank, i;
30 + uint32_t ver = 0, ncfgr, timeout, ifc_bank, i;
31
32 /*
33 * IFC interrupts disabled
34 @@ -469,12 +469,14 @@ static int fsl_ifc_resume(struct device
35 ifc_out32(ncfgr | IFC_NAND_SRAM_INIT_EN,
36 &runtime->ifc_nand.ncfgr);
37 /* wait for SRAM_INIT bit to be clear or timeout */
38 - status = spin_event_timeout(
39 - !(ifc_in32(&runtime->ifc_nand.ncfgr)
40 - & IFC_NAND_SRAM_INIT_EN),
41 - IFC_TIMEOUT_MSECS, 0);
42 + timeout = 10;
43 + while ((ifc_in32(&runtime->ifc_nand.ncfgr) &
44 + IFC_NAND_SRAM_INIT_EN) && timeout) {
45 + mdelay(IFC_TIMEOUT_MSECS);
46 + timeout--;
47 + }
48
49 - if (!status)
50 + if (!timeout)
51 dev_err(ctrl->dev, "Timeout waiting for IFC SRAM INIT");
52 }
53