Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 153825
b: refs/heads/master
c: bfee1a4
h: refs/heads/master
i:
  153823: 12bf38e
v: v3
  • Loading branch information
Nicolas Pitre authored and David Woodhouse committed Jun 8, 2009
1 parent d48c98f commit 97bf446
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9dbc090274668abe3fc9f3a5de490d7d412cd74a
refs/heads/master: bfee1a4311702c9fdecd8264ffd1126fd0ce92fb
23 changes: 23 additions & 0 deletions trunk/drivers/mtd/nand/orion_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ static void orion_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl
writeb(cmd, nc->IO_ADDR_W + offs);
}

static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
{
struct nand_chip *chip = mtd->priv;
void __iomem *io_base = chip->IO_ADDR_R;
uint64_t *buf64;
int i = 0;

while (len && (unsigned long)buf & 7) {
*buf++ = readb(io_base);
len--;
}
buf64 = (uint64_t *)buf;
while (i < len/8) {
uint64_t x;
asm ("ldrd\t%0, [%1]" : "=r" (x) : "r" (io_base));
buf64[i++] = x;
}
i *= 8;
while (i < len)
buf[i++] = readb(io_base);
}

static int __init orion_nand_probe(struct platform_device *pdev)
{
struct mtd_info *mtd;
Expand Down Expand Up @@ -83,6 +105,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
nc->priv = board;
nc->IO_ADDR_R = nc->IO_ADDR_W = io_base;
nc->cmd_ctrl = orion_nand_cmd_ctrl;
nc->read_buf = orion_nand_read_buf;
nc->ecc.mode = NAND_ECC_SOFT;

if (board->chip_delay)
Expand Down

0 comments on commit 97bf446

Please sign in to comment.