From patchwork Sat Nov 26 18:06:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 699532 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tR1db2v34z9t1F for ; Sun, 27 Nov 2016 05:27:47 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=nifty.com header.i=@nifty.com header.b="sFL3MJJV"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAhgI-000453-Fn; Sat, 26 Nov 2016 18:26:34 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAhfW-0001GX-03 for linux-mtd@bombadil.infradead.org; Sat, 26 Nov 2016 18:25:46 +0000 Received: from conuserg-11.nifty.com ([210.131.2.78]) by casper.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cAhOC-00025g-43 for linux-mtd@lists.infradead.org; Sat, 26 Nov 2016 18:07:54 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-11.nifty.com with ESMTP id uAQI6Uf2018512; Sun, 27 Nov 2016 03:06:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com uAQI6Uf2018512 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1480183617; bh=5fV5sMnFKzMhXdx4RoKFlGH0MJlgLaWWydx9Qbzxguc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sFL3MJJVhaJ/lvH9gCtXmrZzy8jKrxsIGTCz5A91L4+ZDVIM5ZP82waXjMSsxrFXh oQrMjmobKpDhIP+u8HAo1BdX8IVAvu80O7AImU4LSzilzMi2kzU36zIXGdXv4UTQQD Tnmzro9n18qNDe6yA5sDB718XDcaqTrLgChTkv7759Uqw8eKczALDNKWpdcyvT83FL epc+p0uV62XLgXbCr/zdSzNDo0DeFjepKeC/Jauds9TREZATVR53cJVVEXcvA6Yk54 /aUz79hbWRuyZAdBaokaxh5knDBjPSz0nS65JpuAZLHZs6Pcni8CW6GpM2E/0e+gN1 bHlzD3VL55PoQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH 30/39] mtd: nand: denali: set DEVICES_CONNECTED 1 if not set Date: Sun, 27 Nov 2016 03:06:16 +0900 Message-Id: <1480183585-592-31-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> References: <1480183585-592-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161126_180752_909263_CBF8E19F X-CRM114-Status: GOOD ( 14.21 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on casper.infradead.org summary: Content analysis details: (-1.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_L4 RBL: Bad reputation (-4) [210.131.2.78 listed in bl.mailspike.net] 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 0.0 RCVD_IN_MSPIKE_BL Mailspike blacklisted X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Marek Vasut , Richard Weinberger , linux-kernel@vger.kernel.org, Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Currently, the driver expects DEVICE_CONNECTED is automatically set by the hardware, but this feature is disabled in some cases. In such cases, it is the software's responsibility to set up the DEVICES_CONNECTED register. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 71bdf2a..4b2bbcb 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1485,6 +1485,13 @@ static void denali_multidev_fixup(struct denali_nand_info *denali) */ denali->devnum = ioread32(denali->flash_reg + DEVICES_CONNECTED); + /* + * On some SoCs, DEVICES_CONNECTED is not auto-detected. For those SoCs + * DEVICES_CONNECT is left to 0. Set 1 if it is the case. + */ + if (denali->devnum == 0) + denali->devnum = 1; + devnum_shift = fls(denali->devnum) - 1; if (denali->devnum != BIT(devnum_shift)) { @@ -1492,9 +1499,10 @@ static void denali_multidev_fixup(struct denali_nand_info *denali) "DEVICE_CONNECTED=%d is not power of 2. Some devices will not be used.\n", denali->devnum); denali->devnum = BIT(devnum_shift); - iowrite32(denali->devnum, denali->flash_reg + DEVICES_CONNECTED); } + iowrite32(denali->devnum, denali->flash_reg + DEVICES_CONNECTED); + mtd->size <<= devnum_shift; mtd->erasesize <<= devnum_shift; mtd->writesize <<= devnum_shift;