From 7f09d4a00cc85ca43b2a7f491f9b3f8498413f1b Mon Sep 17 00:00:00 2001 From: Jun Tian Date: Mon, 28 Apr 2014 20:47:22 +0100 Subject: [PATCH] goldfish: 64-bit nand driver for goldfish platform Enable the 64-bit nand data support in the goldfish nand driver. Signed-off-by: Jun Tian Signed-off-by: Octavian Purdila Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- drivers/staging/goldfish/goldfish_nand.c | 5 ++++- drivers/staging/goldfish/goldfish_nand_reg.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/staging/goldfish/goldfish_nand.c b/drivers/staging/goldfish/goldfish_nand.c index 2a292df71e7c..b8e3dd28096d 100644 --- a/drivers/staging/goldfish/goldfish_nand.c +++ b/drivers/staging/goldfish/goldfish_nand.c @@ -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); } diff --git a/drivers/staging/goldfish/goldfish_nand_reg.h b/drivers/staging/goldfish/goldfish_nand_reg.h index ddfda71ab27a..60ab91f74be7 100644 --- a/drivers/staging/goldfish/goldfish_nand_reg.h +++ b/drivers/staging/goldfish/goldfish_nand_reg.h @@ -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 -- 2.30.2