From patchwork Mon Apr 30 17:30:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Crispin X-Patchwork-Id: 155935 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E72F5B6FA5 for ; Tue, 1 May 2012 03:52:48 +1000 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SOujd-0005gf-5v; Mon, 30 Apr 2012 17:50:05 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SOujb-0005gR-Q6 for linux-mtd@merlin.infradead.org; Mon, 30 Apr 2012 17:50:04 +0000 Received: from [2a01:4f8:131:30e2::2] (helo=nbd.name) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SOujZ-0004kL-2T for linux-mtd@lists.infradead.org; Mon, 30 Apr 2012 17:50:02 +0000 From: John Crispin To: David Woodhouse Subject: [PATCH 3/4] MTD: add read_byte support to plat_nand Date: Mon, 30 Apr 2012 19:30:47 +0200 Message-Id: <1335807048-24032-3-git-send-email-blogic@openwrt.org> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1335807048-24032-1-git-send-email-blogic@openwrt.org> References: <1335807048-24032-1-git-send-email-blogic@openwrt.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120430_135001_321831_3714B934 X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -1.1 (-) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-1.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.8 RDNS_NONE Delivered to internal network by a host with no rDNS Cc: linux-mtd@lists.infradead.org, John Crispin X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 Cc: linux-mtd@lists.infradead.org --- drivers/mtd/nand/plat_nand.c | 1 + include/linux/mtd/nand.h | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index fd2d2a1..1bcb520 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -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; diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 1482340..b14ff21 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h @@ -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; };