From patchwork Thu Mar 1 09:48:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Hecht X-Patchwork-Id: 143978 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 4F2CE1007D3 for ; Thu, 1 Mar 2012 20:51:10 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1S32e8-0003mR-D6; Thu, 01 Mar 2012 09:50:00 +0000 Received: from mail-ee0-f49.google.com ([74.125.83.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1S32db-0003Vt-Ps for linux-mtd@lists.infradead.org; Thu, 01 Mar 2012 09:49:29 +0000 Received: by mail-ee0-f49.google.com with SMTP id b45so151087eek.36 for ; Thu, 01 Mar 2012 01:49:27 -0800 (PST) Received-SPF: pass (google.com: domain of hechtb@googlemail.com designates 10.14.136.209 as permitted sender) client-ip=10.14.136.209; Authentication-Results: mr.google.com; spf=pass (google.com: domain of hechtb@googlemail.com designates 10.14.136.209 as permitted sender) smtp.mail=hechtb@googlemail.com; dkim=pass header.i=hechtb@googlemail.com Received: from mr.google.com ([10.14.136.209]) by 10.14.136.209 with SMTP id w57mr2622246eei.19.1330595367531 (num_hops = 1); Thu, 01 Mar 2012 01:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=DxHH14Snz6Ryh4PJIZTRjty6fBSd2ng3o+MQ/SFEKO4=; b=H1htr6iNxV+fK/OSMgKNQx7LZGcZsRvwN6kiCFQITtG/Dvoq7xDlcg+w+lt/QxiNQN hoHLX1sXps+2jWL9jrGyN7CCAy6cEEfGysuquCFkxxy1+lWRETVzNyfZFeZfqzExXmAq djL2yb/bZdAii2nbxJnJ0sNUByYy3Yl7H53jE= Received: by 10.14.136.209 with SMTP id w57mr2020748eei.19.1330595367426; Thu, 01 Mar 2012 01:49:27 -0800 (PST) Received: from localhost.localdomain ([89.204.153.40]) by mx.google.com with ESMTPS id n17sm5432919eei.3.2012.03.01.01.49.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Mar 2012 01:49:26 -0800 (PST) From: Bastian Hecht To: linux-sh@vger.kernel.org, linux-mtd@lists.infradead.org Subject: [PATCH v3 6/7] mtd: sh_flctl: Add FLHOLDCR register Date: Thu, 1 Mar 2012 10:48:40 +0100 Message-Id: <1330595321-2728-6-git-send-email-hechtb@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1330595321-2728-1-git-send-email-hechtb@gmail.com> References: <1330595321-2728-1-git-send-email-hechtb@gmail.com> X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.83.49 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hechtb[at]googlemail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Magnus Damm , Laurent Pichart 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 Add a register used in new FLCTL hardware and a feature flag for it. Signed-off-by: Bastian Hecht --- changelog: stays the same, only the patch meta info changed. drivers/mtd/nand/sh_flctl.c | 3 +++ include/linux/mtd/sh_flctl.h | 12 ++++++++++++ 2 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c index 73398f7..956e18d 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c @@ -690,6 +690,8 @@ static void flctl_select_chip(struct mtd_info *mtd, int chipnr) case 0: flctl->flcmncr_base |= CE0_ENABLE; writel(flctl->flcmncr_base, FLCMNCR(flctl)); + if (flctl->holden) + writel(HOLDEN, FLHOLDCR(flctl)); break; default: BUG(); @@ -846,6 +848,7 @@ static int __devinit flctl_probe(struct platform_device *pdev) flctl->pdev = pdev; flctl->flcmncr_base = pdata->flcmncr_val; flctl->hwecc = pdata->has_hwecc; + flctl->holden = pdata->use_holden; nand->options = NAND_NO_AUTOINCR; diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h index c708282..8bcf299 100644 --- a/include/linux/mtd/sh_flctl.h +++ b/include/linux/mtd/sh_flctl.h @@ -38,6 +38,7 @@ #define FLDTFIFO(f) (f->reg + 0x24) #define FLECFIFO(f) (f->reg + 0x28) #define FLTRCR(f) (f->reg + 0x2C) +#define FLHOLDCR(f) (f->reg + 0x38) #define FL4ECCRESULT0(f) (f->reg + 0x80) #define FL4ECCRESULT1(f) (f->reg + 0x84) #define FL4ECCRESULT2(f) (f->reg + 0x88) @@ -109,6 +110,15 @@ #define TRSTRT (0x1 << 0) /* translation start */ #define TREND (0x1 << 1) /* translation end */ +/* + * FLHOLDCR control bits + * + * HOLDEN: Bus Occupancy Enable (inverted) + * Enable this bit when the external bus might be used in between transfers. + * If not set and the bus gets used by other modules, a deadlock occurs. + */ +#define HOLDEN (0x1 << 0) + /* FL4ECCCR control bits */ #define _4ECCFA (0x1 << 2) /* 4 symbols correct fault */ #define _4ECCEND (0x1 << 1) /* 4 symbols end */ @@ -138,6 +148,7 @@ struct sh_flctl { unsigned page_size:1; /* NAND page size (0 = 512, 1 = 2048) */ unsigned hwecc:1; /* Hardware ECC (0 = disabled, 1 = enabled) */ + unsigned holden:1; /* Hardware has FLHOLDCR and HOLDEN is set */ }; struct sh_flctl_platform_data { @@ -146,6 +157,7 @@ struct sh_flctl_platform_data { unsigned long flcmncr_val; unsigned has_hwecc:1; + unsigned use_holden:1; }; static inline struct sh_flctl *mtd_to_flctl(struct mtd_info *mtdinfo)