From patchwork Tue Sep 12 02:37:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112240 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4595380qgf; Mon, 11 Sep 2017 19:40:15 -0700 (PDT) X-Google-Smtp-Source: ADKCNb4Tw5arqnrclMnbAkgipDghFLCbF3uR/sD68KZgHTuamf60tMyI5yI1ybGQITfXwfspBcpz X-Received: by 10.98.110.70 with SMTP id j67mr13422473pfc.63.1505184015598; Mon, 11 Sep 2017 19:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505184015; cv=none; d=google.com; s=arc-20160816; b=Pa1Fm5XiGEcXHGpyPR8JUYLNblSgS3nBaelOVMjAB2QbX1dhKlg7Ds9H6ixHpv5CDw F+vnglXxivACftrFyQG1WWvYCaKtp/Pk58Rlz/VKpKXLRDHydGDkgI7gaH9c7n1eViNw 1spA6iODArTH0bhMLdAoiTlgQfoiROKZpN+FVabs+TegAMOK3qbPgUhWKcG2Q3BxZ252 I51mWyJt9h2dQb4qWP/6uM+Wdxz0vl1w5bBU+nafo9llznIGcmYE37s8ynaBI3PdRJ9W hJT7ryroVA5vaxj4eOxQhw+EMUqgbFU4KoT9VsWQYFBbBblm6uvNKHvVTP1X16KRBBFQ kvow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature :arc-authentication-results; bh=K+XgmQHPvCQ3a02mqvXWKoX+1OD7Tpwo+3mbdTSLNoc=; b=rjFuK+1hq691dNOf1a6AZbtuGKLldJTwxQZ8hInwCKeatXWRaPqJf+Kk8asRSOdGdF 1wzOkTPjj4HRsKSf60csg4Gd917u7d1f4GcGKx/qqAq7qIXH8b0MpOaDI61CykkkMb16 rt/OMzYxD89LwMoehbLrxYO5Nrz+oNfiksj3IXtDNC8NpGXT5bXxKg0kQiAoTj/Hh/a2 jCDE1TsltllXfg7J1gbKD4jYDrWyxrsdWT7QD8FQ7hrlH6CznbvCezI629Hp81aC9FKD iWfIc3TbWMbafLOn3ROA2KBuh8VoCpAaWj7nqP4/1FurYVLa2b4ybzSSzZadkWxFFYp0 UNtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=oEryZ+EC; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=Fd/rpjfo; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id p2si8538081plk.37.2017.09.11.19.40.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 19:40:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=oEryZ+EC; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=Fd/rpjfo; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=K+XgmQHPvCQ3a02mqvXWKoX+1OD7Tpwo+3mbdTSLNoc=; b=oEryZ+ECE+iwJS+KlaNfR6gzAi P36cJYzW+WUpDYN/6xrxGo9wovwVyVDGCNWPgWfpN7mV38DEp+Uvhm7T7X9DcN1j7pblbG4o8ujrE JnPVIXA7KDIiZgnwRryrY8ts4D6PbNDI0I7HwRHEi4INr86elgqgNdEmHmCeSTSZjUZXXv4F/NC9o /rEVgJXXQPXVWZSnUkBs91ARMEqpLxRH4vFDKlg43ZGmxBmNXDetXuyBtyncNDvLGCYcXhddvEmjw LuW+/EIHEcDYuFvwRiArD+x6PoSRlyA/ShGSAiaAtnKO/Y0hOmf8xBYIGWBwzB/nggccufctpRVT9 oq9V/PMA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1drb7K-0005ie-KD; Tue, 12 Sep 2017 02:40:02 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1drb62-00050V-9n; Tue, 12 Sep 2017 02:38:45 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v8C2buJX001020; Tue, 12 Sep 2017 11:37:57 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8C2buJX001020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505183878; bh=a3qmuMfAOfcs2K+SHxQFrqWW8o+UnWrInoxcBA8yusw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fd/rpjfoX8pqEWuZp7I3q5365r0QO6aMBDwPwbRIP4Lzra/1+nsM1oPtkZgo1smRV cbKNQlQM//tyED+icJnwKDfcW7JdIZZBVKnOnxPjpsOuNAtt91UjKbMK/S/qqMW7yc m3ZcK+YhCjlKf6l8ghzJ76sdMkD44rpYk6aRtxSuxNEHUXhfdtpX3t3exSfmml/6QC dbZCmOBrUg8qo/SX1mgfi/K4D06+S5jzdcQmxSPJkxZ0h5nQIWA+hV0J856104RUO3 ANSlWNgeUYDe5JM9SyqRHTHFeytHK5Z4UyhSmLhjlwBGmqCDT0wi1RGlgYYCNXUd2Z 6SBrFSVLhH5HA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH 1/2] mtd: nand: introduce NAND_ROW_ADDR_3 flag Date: Tue, 12 Sep 2017 11:37:30 +0900 Message-Id: <1505183851-29355-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505183851-29355-1-git-send-email-yamada.masahiro@socionext.com> References: <1505183851-29355-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170911_193842_757415_6B33789D X-CRM114-Status: GOOD ( 13.62 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Richard Weinberger , Wan ZongShun , Marek Vasut , Josh Wu , linux-kernel@vger.kernel.org, Wenyou Yang , Masahiro Yamada , Cyrille Pitchen , Brian Norris , David Woodhouse , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Several drivers check ->chipsize to see if the third row address cycle is needed. Instead of embedding magic sizes such as 32MB, 128MB in drivers, introduce a new flag NAND_ROW_ADDR_3 for clean-up. Since nand_scan_ident() knows well about the device, it can handle this properly. The flag is set if the row address bit width is greater than 16. Delete comments such as "One more address cycle for ..." because intention is now clear enough from the code. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/atmel/nand-controller.c | 3 +-- drivers/mtd/nand/au1550nd.c | 3 +-- drivers/mtd/nand/diskonchip.c | 3 +-- drivers/mtd/nand/hisi504_nand.c | 3 +-- drivers/mtd/nand/mxc_nand.c | 3 +-- drivers/mtd/nand/nand_base.c | 9 +++++---- drivers/mtd/nand/nuc900_nand.c | 2 +- include/linux/mtd/rawnand.h | 3 +++ 8 files changed, 14 insertions(+), 15 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/atmel/nand-controller.c b/drivers/mtd/nand/atmel/nand-controller.c index f25eca7..7bc8d20 100644 --- a/drivers/mtd/nand/atmel/nand-controller.c +++ b/drivers/mtd/nand/atmel/nand-controller.c @@ -718,8 +718,7 @@ static void atmel_nfc_set_op_addr(struct nand_chip *chip, int page, int column) nc->op.addrs[nc->op.naddrs++] = page; nc->op.addrs[nc->op.naddrs++] = page >> 8; - if ((mtd->writesize > 512 && chip->chipsize > SZ_128M) || - (mtd->writesize <= 512 && chip->chipsize > SZ_32M)) + if (chip->options & NAND_ROW_ADDR_3) nc->op.addrs[nc->op.naddrs++] = page >> 16; } } diff --git a/drivers/mtd/nand/au1550nd.c b/drivers/mtd/nand/au1550nd.c index 9d4a28f..8ab827e 100644 --- a/drivers/mtd/nand/au1550nd.c +++ b/drivers/mtd/nand/au1550nd.c @@ -331,8 +331,7 @@ static void au1550_command(struct mtd_info *mtd, unsigned command, int column, i ctx->write_byte(mtd, (u8)(page_addr >> 8)); - /* One more address cycle for devices > 32MiB */ - if (this->chipsize > (32 << 20)) + if (this->options & NAND_ROW_ADDR_3) ctx->write_byte(mtd, ((page_addr >> 16) & 0x0f)); } diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c index c3aa53c..72671dc 100644 --- a/drivers/mtd/nand/diskonchip.c +++ b/drivers/mtd/nand/diskonchip.c @@ -705,8 +705,7 @@ static void doc2001plus_command(struct mtd_info *mtd, unsigned command, int colu if (page_addr != -1) { WriteDOC((unsigned char)(page_addr & 0xff), docptr, Mplus_FlashAddress); WriteDOC((unsigned char)((page_addr >> 8) & 0xff), docptr, Mplus_FlashAddress); - /* One more address cycle for higher density devices */ - if (this->chipsize & 0x0c000000) { + if (this->options & NAND_ROW_ADDR_3) { WriteDOC((unsigned char)((page_addr >> 16) & 0x0f), docptr, Mplus_FlashAddress); printk("high density\n"); } diff --git a/drivers/mtd/nand/hisi504_nand.c b/drivers/mtd/nand/hisi504_nand.c index d9ee1a7..0ded7f4 100644 --- a/drivers/mtd/nand/hisi504_nand.c +++ b/drivers/mtd/nand/hisi504_nand.c @@ -432,8 +432,7 @@ static void set_addr(struct mtd_info *mtd, int column, int page_addr) host->addr_value[0] |= (page_addr & 0xffff) << (host->addr_cycle * 8); host->addr_cycle += 2; - /* One more address cycle for devices > 128MiB */ - if (chip->chipsize > (128 << 20)) { + if (chip->->options & NAND_ROW_ADDR_3) { host->addr_cycle += 1; if (host->command == NAND_CMD_ERASE1) host->addr_value[0] |= ((page_addr >> 16) & 0xff) << 16; diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c index 53e5e03..bacdd04 100644 --- a/drivers/mtd/nand/mxc_nand.c +++ b/drivers/mtd/nand/mxc_nand.c @@ -859,8 +859,7 @@ static void mxc_do_addr_cycle(struct mtd_info *mtd, int column, int page_addr) host->devtype_data->send_addr(host, (page_addr >> 8) & 0xff, true); } else { - /* One more address cycle for higher density devices */ - if (mtd->size >= 0x4000000) { + if (nand_chip->options & NAND_ROW_ADDR_3) { /* paddr_8 - paddr_15 */ host->devtype_data->send_addr(host, (page_addr >> 8) & 0xff, diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index bcc8cef1..3bc4404 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -727,8 +727,7 @@ static void nand_command(struct mtd_info *mtd, unsigned int command, chip->cmd_ctrl(mtd, page_addr, ctrl); ctrl &= ~NAND_CTRL_CHANGE; chip->cmd_ctrl(mtd, page_addr >> 8, ctrl); - /* One more address cycle for devices > 32MiB */ - if (chip->chipsize > (32 << 20)) + if (chip->options & NAND_ROW_ADDR_3) chip->cmd_ctrl(mtd, page_addr >> 16, ctrl); } chip->cmd_ctrl(mtd, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); @@ -854,8 +853,7 @@ static void nand_command_lp(struct mtd_info *mtd, unsigned int command, chip->cmd_ctrl(mtd, page_addr, ctrl); chip->cmd_ctrl(mtd, page_addr >> 8, NAND_NCE | NAND_ALE); - /* One more address cycle for devices > 128MiB */ - if (chip->chipsize > (128 << 20)) + if (chip->options & NAND_ROW_ADDR_3) chip->cmd_ctrl(mtd, page_addr >> 16, NAND_NCE | NAND_ALE); } @@ -4000,6 +3998,9 @@ static int nand_detect(struct nand_chip *chip, struct nand_flash_dev *type) chip->chip_shift += 32 - 1; } + if (chip->chip_shift - chip->page_shift > 16) + chip->options |= NAND_ROW_ADDR_3; + chip->badblockbits = 8; chip->erase = single_erase; diff --git a/drivers/mtd/nand/nuc900_nand.c b/drivers/mtd/nand/nuc900_nand.c index 7bb4d2e..af5b32c9 100644 --- a/drivers/mtd/nand/nuc900_nand.c +++ b/drivers/mtd/nand/nuc900_nand.c @@ -154,7 +154,7 @@ static void nuc900_nand_command_lp(struct mtd_info *mtd, unsigned int command, if (page_addr != -1) { write_addr_reg(nand, page_addr); - if (chip->chipsize > (128 << 20)) { + if (chip->options & NAND_ROW_ADDR_3) { write_addr_reg(nand, page_addr >> 8); write_addr_reg(nand, page_addr >> 16 | ENDADDR); } else { diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h index 2b05f42..749bb08 100644 --- a/include/linux/mtd/rawnand.h +++ b/include/linux/mtd/rawnand.h @@ -177,6 +177,9 @@ enum nand_ecc_algo { */ #define NAND_NEED_SCRAMBLING 0x00002000 +/* Device needs 3rd row address cycle */ +#define NAND_ROW_ADDR_3 0x00004000 + /* Options valid for Samsung large page devices */ #define NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG From patchwork Tue Sep 12 02:37:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 112239 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp4594607qgf; Mon, 11 Sep 2017 19:39:13 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7PghqvUklkujw84hWlv5yRfQ/F0c5sBULnB7BTvCFDoQ4jDFvWTFOtkm2WVsdEGLrGKWWC X-Received: by 10.98.196.73 with SMTP id y70mr13478729pff.334.1505183953896; Mon, 11 Sep 2017 19:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505183953; cv=none; d=google.com; s=arc-20160816; b=CIBqoddsP8JSxsYqzqcFXpFaTZdDfN4VQbjmzpLAhuOkusjrum5r+r0qLYJzVdd+2T AJcadyG7zOxeR4j5G/ZF3Oukai95N7LJpFHrYnZiN97D2246cOHJGG6JKahxtoO26zFa b5zg+rC8BMRO6L5JMysLdPNi5+1YSfYapf0rxtDZpoAHBZPOXLWLj77LRN1pzBjnDDvw jH/NPPWtZ3irPO4rr8utCn8WXdsMrW2ahKkSerlKAUXbXJWfelU6lT8txI1fHg3qpq4B GQVuTLNac79Z2GolSOS6846K/vFYG87ICtbhm+9KoLFN2THvt5kgcVoqqU7eZURRgpvv LEPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:dkim-filter:dkim-signature :arc-authentication-results; bh=4/djSP+dvJpde51UHhBM/YUsiZRst0Mh4wOzk5YQCgw=; b=nB6TkUzrGLBtViOyv+i6So9whJndyZgDLLKtWL/4adTnS2X9AoFayf/8QEHScEcDbG vc74FpCMCqeOpCK5HLar2kABb/gGZ9PV55Ubpl0i9xL4RcWvT0/qcmiEukfzaveATOXX eLmAe23pPHtTTpgTRuLKfIyFnJKBUCoj25deI3f8tu2o9cZx6ITFtdFsNZwwR+Nnww2z j0LyeACpB1MB03g0FtnloeU5iZjZSM46Etb01C/zioYJREAo3Dj+Vx5aPffe2s8gzkx1 uXJxY9OaQe1oL314djA2qSdBN+UlylhSVwszvAjaoVi0m92IwC/MExwbJqy/9SYZrXIZ JWqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=rJfN+BQM; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=oUqF4EfT; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id b6si2942510pll.661.2017.09.11.19.39.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Sep 2017 19:39:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=rJfN+BQM; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=oUqF4EfT; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4/djSP+dvJpde51UHhBM/YUsiZRst0Mh4wOzk5YQCgw=; b=rJfN+BQMjplxZofFvsoO95jElL zLjcANHlaxv1PDW9pSm6CppEGJC4K+Z5ghEhywz6RCEOlHsLvbwNpAc22qwdbr8XDbzW+2BYSZ/dS +xNHTS09EkoUHk2DF5LA5Wwo2Y4JpyoRkdnpi76JV2lW5ot+LTb9B1PNGHX9i5sBSZe6ZgbERISsu MYxzXT+QY/Ib7R/gOxME11YROOxrai+uYvBkkjBetivZUw8lHVd7oMnTuuYvdj5tITEU96mNnw8Xp Q2qzVI2HNvB7Jgx7kx6bbH0liMOP3xn526Pnu/td3KpHStfOaCXaW8E5nv4IpivcmwwBqOn1Gpnov nNysDr3g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1drb66-00058G-9T; Tue, 12 Sep 2017 02:38:46 +0000 Received: from conuserg-12.nifty.com ([210.131.2.79]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1drb62-00050W-9S for linux-mtd@lists.infradead.org; Tue, 12 Sep 2017 02:38:44 +0000 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-12.nifty.com with ESMTP id v8C2buJY001020; Tue, 12 Sep 2017 11:37:58 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-12.nifty.com v8C2buJY001020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1505183879; bh=FjwRPyBhqZgrJZX0u4hXA2G4/LNObTY+yJ6KeNredB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oUqF4EfTnePycJeSQ+bh/OaYaGd1fMGoaPEUoVUUk8djs9K1eddYhKrxOjE+Tv9ki q0jKFyEfqi3IbAAI1+MahPvhk8NSpMfppdUG/tHVn6cQulViBgwtgEhcajfJYtpynJ P16LfUsGPt9RkdVPH6qvfFcII5DY9FsGGptV3jAQ3ICxKdwezIGnoVvuTs0OGRhILX H4fVWjwgrW7PTKHr+79Z19eXwFTtVGJ/eymjoP4+fhZo7RYyKLM5a0Vs0Vbq07jJQP eSC73ihxeH2XdJzep6+bSiJIn4zmPDVRLItZsRoRTNYJo0OKgFRvKSR/PS3Zn//+hF srccA3Ct1ceCQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH 2/2] mtd: nand: denali: support two row address cycle devices Date: Tue, 12 Sep 2017 11:37:31 +0900 Message-Id: <1505183851-29355-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1505183851-29355-1-git-send-email-yamada.masahiro@socionext.com> References: <1505183851-29355-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170911_193842_736923_F33C7BBA X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 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 X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 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+patch=linaro.org@lists.infradead.org The register TWO_ROW_ADDR_CYCLES specifies the number of row address cycles of the device, but it is fixed to 0 in the driver init code (i.e. always 3 row address cycles). Reflect the result of nand_scan_ident() to the register setting in order to support 2 row address cycle devices. Signed-off-by: Masahiro Yamada --- drivers/mtd/nand/denali.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 3087b0b..aefdc83 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1137,8 +1137,6 @@ static void denali_hw_init(struct denali_nand_info *denali) iowrite32(0xffff, denali->reg + SPARE_AREA_MARKER); - /* Should set value for these registers when init */ - iowrite32(0, denali->reg + TWO_ROW_ADDR_CYCLES); iowrite32(1, denali->reg + ECC_ENABLE); } @@ -1379,6 +1377,8 @@ int denali_init(struct denali_nand_info *denali) denali->reg + PAGES_PER_BLOCK); iowrite32(chip->options & NAND_BUSWIDTH_16 ? 1 : 0, denali->reg + DEVICE_WIDTH); + iowrite32(chip->options & NAND_ROW_ADDR_3 ? 0 : TWO_ROW_ADDR_CYCLES__FLAG, + denali->reg + TWO_ROW_ADDR_CYCLES); iowrite32(mtd->writesize, denali->reg + DEVICE_MAIN_AREA_SIZE); iowrite32(mtd->oobsize, denali->reg + DEVICE_SPARE_AREA_SIZE);