Commit 250d45eb authored by Hauke Mehrtens's avatar Hauke Mehrtens Committed by Boris Brezillon

mtd: nand: xway: add missing write_buf and read_buf to nand driver

This driver needs a special write_buf and read_buf function, because we
have to read from a specific address to tell the controller this is a
read from the nand controller.
Signed-off-by: default avatarHauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent ddbed9c2
...@@ -129,6 +129,22 @@ static unsigned char xway_read_byte(struct mtd_info *mtd) ...@@ -129,6 +129,22 @@ static unsigned char xway_read_byte(struct mtd_info *mtd)
return xway_readb(mtd, NAND_READ_DATA); return xway_readb(mtd, NAND_READ_DATA);
} }
static void xway_read_buf(struct mtd_info *mtd, u_char *buf, int len)
{
int i;
for (i = 0; i < len; i++)
buf[i] = xway_readb(mtd, NAND_WRITE_DATA);
}
static void xway_write_buf(struct mtd_info *mtd, const u_char *buf, int len)
{
int i;
for (i = 0; i < len; i++)
xway_writeb(mtd, NAND_WRITE_DATA, buf[i]);
}
/* /*
* Probe for the NAND device. * Probe for the NAND device.
*/ */
...@@ -162,6 +178,8 @@ static int xway_nand_probe(struct platform_device *pdev) ...@@ -162,6 +178,8 @@ static int xway_nand_probe(struct platform_device *pdev)
data->chip.cmd_ctrl = xway_cmd_ctrl; data->chip.cmd_ctrl = xway_cmd_ctrl;
data->chip.dev_ready = xway_dev_ready; data->chip.dev_ready = xway_dev_ready;
data->chip.select_chip = xway_select_chip; data->chip.select_chip = xway_select_chip;
data->chip.write_buf = xway_write_buf;
data->chip.read_buf = xway_read_buf;
data->chip.read_byte = xway_read_byte; data->chip.read_byte = xway_read_byte;
data->chip.chip_delay = 30; data->chip.chip_delay = 30;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment