mtd: add read_byte support to plat_nand
authorJohn Crispin <blogic@openwrt.org>
Mon, 30 Apr 2012 17:30:47 +0000 (19:30 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 14 May 2012 04:16:53 +0000 (23:16 -0500)
Lantiq SoCs have a External Bus Unit (EBU) that is used to attach MTD media.
As we need to co-exist with PCI on the same bus, certain swapping settings must
be applied. Similar to the NOR map driver we need to apply a fix to make NAND
work. The easiest way is to use byte reads.

Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/plat_nand.c
include/linux/mtd/nand.h

index fd2d2a1b78ba2d4781ae4c9323781922b4832fe0..1bcb520404228ba2d8fe9cec1d29d9a6c535eac7 100644 (file)
@@ -79,6 +79,7 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
        data->chip.select_chip = pdata->ctrl.select_chip;
        data->chip.write_buf = pdata->ctrl.write_buf;
        data->chip.read_buf = pdata->ctrl.read_buf;
+       data->chip.read_byte = pdata->ctrl.read_byte;
        data->chip.chip_delay = pdata->chip.chip_delay;
        data->chip.options |= pdata->chip.options;
        data->chip.bbt_options |= pdata->chip.bbt_options;
index 627f0c575ac4119e50f2e57022e4c4ac54f19cfd..94a6679bfc2e7e04d2da492ad170dc4ab1f04066 100644 (file)
@@ -654,6 +654,7 @@ struct platform_nand_ctrl {
        void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
        void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
        void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
+       unsigned char (*read_byte)(struct mtd_info *mtd);
        void *priv;
 };