From patchwork Wed Feb 8 12:16:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bastian Hecht X-Patchwork-Id: 140126 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from merlin.infradead.org (unknown [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 0DB53B6F99 for ; Wed, 8 Feb 2012 23:18:48 +1100 (EST) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Rv6T3-0001wL-1V; Wed, 08 Feb 2012 12:17:45 +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 1Rv6Sm-0001tv-Gr for linux-mtd@lists.infradead.org; Wed, 08 Feb 2012 12:17:30 +0000 Received: by eeke50 with SMTP id e50so165348eek.36 for ; Wed, 08 Feb 2012 04:17:26 -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=ni1yIO2DDeHUltJwJaB4mUv+7yyr9nKqpripHXzSdWo=; b=I7colZCXqqygmaqXvYqfwfHjq/fK/aFcrFwOP6BXFH/xa83f480p/wd4PnjWaAUvyV sTtZcWzGgg93iNZUTHUs0K0D+gFg+f/SbAKrHF/o9eVEze7I58f4wcbByZi/gKeoja/7 3R5HqHhuf5Un0YyXjvC1eCGbZDzI0cGRlbv8Y= Received: by 10.213.8.19 with SMTP id f19mr2856959ebf.62.1328703446429; Wed, 08 Feb 2012 04:17:26 -0800 (PST) Received: from localhost.localdomain (i59F746F2.versanet.de. [89.247.70.242]) by mx.google.com with ESMTPS id x4sm4642273eeb.4.2012.02.08.04.17.25 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Feb 2012 04:17:25 -0800 (PST) From: Bastian Hecht To: linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org Subject: [PATCH 5/7] mtd: sh_flctl: Add FLHOLDCR register Date: Wed, 8 Feb 2012 13:16:49 +0100 Message-Id: <1328703411-3452-5-git-send-email-hechtb@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1328703411-3452-1-git-send-email-hechtb@gmail.com> References: <1328703411-3452-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: Bastian Hecht , magnus.damm@gmail.com, laurent.pinchart@ideasonboard.com 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 --- 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 5c3e71f..70ca40d 100644 --- a/drivers/mtd/nand/sh_flctl.c +++ b/drivers/mtd/nand/sh_flctl.c @@ -751,6 +751,8 @@ static int flctl_verify_buf(struct mtd_info *mtd, const u_char *buf, int len) static void flctl_register_init(struct sh_flctl *flctl, unsigned long val) { writel(val, FLCMNCR(flctl)); + if (flctl->holden) + writel(HOLDEN, FLHOLDCR(flctl)); } static int flctl_chip_init_tail(struct mtd_info *mtd) @@ -852,6 +854,7 @@ static int __devinit flctl_probe(struct platform_device *pdev) flctl_mtd->priv = nand; flctl->pdev = pdev; flctl->hwecc = pdata->has_hwecc; + flctl->holden = pdata->use_holden; flctl_register_init(flctl, pdata->flcmncr_val); diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h index ecbf3e6..fc77017 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 */ @@ -137,6 +147,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 { @@ -145,6 +156,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)