goldfish: 64-bit nand driver for goldfish platform
authorJun Tian <jun.j.tian@intel.com>
Mon, 28 Apr 2014 19:47:22 +0000 (20:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 May 2014 23:47:18 +0000 (19:47 -0400)
Enable the 64-bit nand data support in the goldfish nand driver.

Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/goldfish/goldfish_nand.c
drivers/staging/goldfish/goldfish_nand_reg.h

index 2a292df..b8e3dd2 100644 (file)
@@ -67,7 +67,7 @@ static u32 goldfish_nand_cmd_with_params(struct mtd_info *mtd,
        cps->addr_high = (u32)(addr >> 32);
        cps->addr_low = (u32)addr;
        cps->transfer_size = len;
-       cps->data = (u32)ptr;
+       cps->data = (unsigned long)ptr;
        writel(cmdp, base + NAND_COMMAND);
        *rv = cps->result;
        return 0;
@@ -87,6 +87,9 @@ static u32 goldfish_nand_cmd(struct mtd_info *mtd, enum nand_cmd cmd,
                writel((u32)addr, base + NAND_ADDR_LOW);
                writel(len, base + NAND_TRANSFER_SIZE);
                writel((u32)ptr, base + NAND_DATA);
+#ifdef CONFIG_64BIT
+               writel((u32)((u64)ptr >> 32), base + NAND_DATA_HIGH);
+#endif
                writel(cmd, base + NAND_COMMAND);
                rv = readl(base + NAND_RESULT);
        }
index ddfda71..60ab91f 100644 (file)
@@ -57,6 +57,9 @@ enum nand_reg {
        NAND_RESULT         = 0x040,
        NAND_COMMAND        = 0x044,
        NAND_DATA           = 0x048,
+#ifdef CONFIG_64BIT
+       NAND_DATA_HIGH      = 0x100,
+#endif
        NAND_TRANSFER_SIZE  = 0x04c,
        NAND_ADDR_LOW       = 0x050,
        NAND_ADDR_HIGH      = 0x054,
@@ -69,7 +72,7 @@ struct cmd_params {
        uint32_t addr_low;
        uint32_t addr_high;
        uint32_t transfer_size;
-       uint32_t data;
+       unsigned long data;
        uint32_t result;
 };
 #endif