From patchwork Fri Dec 20 11:31:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 182236 Delivered-To: patch@linaro.org Received: by 2002:a92:1f98:0:0:0:0:0 with SMTP id f24csp402056ilf; Fri, 20 Dec 2019 03:33:24 -0800 (PST) X-Google-Smtp-Source: APXvYqwgeTsAk3/ghcZRSXOSoOsozPSOcno+bkKma3T9d/ofFmCNqqzHhF2FNeh9/a4LGoSJUDT9 X-Received: by 2002:a62:1d90:: with SMTP id d138mr15319929pfd.93.1576841604880; Fri, 20 Dec 2019 03:33:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576841604; cv=none; d=google.com; s=arc-20160816; b=RgiukmgMjJD8qE9+9hDkT5kZoIcrqCyYtQkHObctwmGiXMigyGWqLe0EmhxTZmzVQt 9gCuRpUa/Zq6ki5CsyIa1DC1lA6RkFueER25xmgKMBjPDzIhFKn30IQhxy3cH1PXJhrI ELH96MTLweTXeBcktYZAI07CfG1mE0dQ0oRO1MAwZYWKpt9WENQ+cXzbZ+3cMYijiIsG rZmhma47Gr7g/8QN3X5h6sS1+7zwfqx5TRNY705701ySVtxmCDFSXaPV4343E3gjsOq9 RG6N+oiUHz+uKAb3lthIh8aXBNY6jy8/PrO/eRJzNOOX1s1VZRoGUd5ZctKLrqsMU/mY Nytg== 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; bh=ymkfW0/kT4DLfjgzY62/eUV4aeAkjPEDeT7JpJPNNPI=; b=O42aJowD514sYdu7OEb3fA7B6VP0JdkRbGtSBm4cEeHD+xD1/txAcJ7C2j/03T5rDk 2w2h20Q/V8C57P/R7fnWxPhCi5YEVJyWt+CoNPrMbDLhTc4VU8iIZgaN7BkvBtB1Al5y E8oxQOLL/wV1CEsOsrMvx3Z+3fUrCGAVg8BjEeRy8DxxoQ2FGYGbAkJUa5HbY/TMheYj OZQz0cGEZQzVVa5EB6SPZUrkG5JcPQERQiWY3BmLLaJ2yrIkurKVPAf6XDE17EyhfoTi ny2QonI86bi01079ql7NktaSRNFMYASltxTerU1QkSrYnORR4oV1Cm/yVA8A8u/FdzL2 gXUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=gJke6ZQ4; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=vJ9ZNkKc; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::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. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id e4si8602551pge.31.2019.12.20.03.33.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Dec 2019 03:33:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org header.s=bombadil.20170209 header.b=gJke6ZQ4; dkim=neutral (body hash did not verify) header.i=@nifty.com header.s=dec2015msa header.b=vJ9ZNkKc; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 2607:7c80:54:e::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=ymkfW0/kT4DLfjgzY62/eUV4aeAkjPEDeT7JpJPNNPI=; b=gJke6ZQ4yRyrSsHEI0p8/PXHHI SfI+4gia0SjNrsFQbhEMOahcFWB8ipabyT+kF/IXjwfyE644D2wKn8+HrUsa3dXE3aY45tVhrMaDm bzCKhStN7gr6e2I7P/LRWbvn/hOzDpcxqEPkIibEHJUHVTCfoeoyVzl35iL40rHr/MB7Uak3lxW8U x1L1ygcUmtsbRgCXx+1C7prRQacZDq56Ju0nbXqMo5RAGOC/FLAqTQfJyBI79MTiB+EfqrGnoJu/r y+VXwRYR07wAeeF1UlCg4Z3bNgltHetVaNlDGvD9CNTy5ebwMU5NkhcX9XPofmj74eqWHBHhb04uL jieKKSBA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiGWx-0000n4-W3; Fri, 20 Dec 2019 11:33:16 +0000 Received: from conuserg-08.nifty.com ([210.131.2.75]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iiGWH-000082-DC for linux-mtd@lists.infradead.org; Fri, 20 Dec 2019 11:32:36 +0000 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id xBKBW2X0010984; Fri, 20 Dec 2019 20:32:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com xBKBW2X0010984 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1576841529; bh=FaE1Dy6PORZJLZr2fPoSaDCJ2/3nG0fTHRJYBhAtI20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJ9ZNkKccYowU4XwyMyk1kgJ+wlThcFKimxyMyfxqOs5uY6exrWz0FoCHerjFbbLW 39Dm0r+sC3zkRT2yGDJLLnwnN6qRFzDNm7NvgGGEv5LoDj3q5WbqsXQdUhQZs2piXI HViI9D9pFxujyGfh70LFHdYUvPpKeG9UmtuaxdN9I/HUQsjbKXUYOwds2ig+ef/Ltk tW9CzTGmWIJj+8GIsTswmHvcYoSdiYjNiV93VpDUvqljwt7guxUynFuDFzzIdyoeYh HONq89bXg5O55aqmuGvaVOVJpuW9z4t35HgkeZBSLOXvcH3r8Z617ZuQUgEr12tZiN olIjV5eQNagRw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [PATCH v3 5/5] mtd: rawnand: denali: remove hard-coded DENALI_DEFAULT_OOB_SKIP_BYTES Date: Fri, 20 Dec 2019 20:31:55 +0900 Message-Id: <20191220113155.28177-6-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191220113155.28177-1-yamada.masahiro@socionext.com> References: <20191220113155.28177-1-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191220_033233_779159_2C86F378 X-CRM114-Status: GOOD ( 12.65 ) X-Spam-Score: 1.0 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [210.131.2.75 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -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.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , Vignesh Raghavendra , Masahiro Yamada , Richard Weinberger , linux-kernel@vger.kernel.org, Ley Foon Tan , Dinh Nguyen , Miquel Raynal MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org As commit 0d55c668b218 (mtd: rawnand: denali: set SPARE_AREA_SKIP_BYTES register to 8 if unset") says, there were three solutions discussed: [1] Add a DT property to specify the skipped bytes in OOB [2] Associate the preferred value with compatible [3] Hard-code the default value in the driver At that time, [3] was chosen because I did not have enough information about the other platforms than UniPhier. That commit also says "The preferred value may vary by platform. If so, please trade up to a different solution." My intention was to replace [3] with [2], not keep both [2] and [3]. Now that we have switched to [2] for SOCFPGA's SPARE_AREA_SKIP_BYTES=2, [3] should be removed. This should be OK because denali_pci.c just gets back to the original behavior. Signed-off-by: Masahiro Yamada --- Changes in v3: - New patch Changes in v2: None drivers/mtd/nand/raw/denali.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) -- 2.17.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/raw/denali.c b/drivers/mtd/nand/raw/denali.c index b6c463d02167..fafd0a0aa8e2 100644 --- a/drivers/mtd/nand/raw/denali.c +++ b/drivers/mtd/nand/raw/denali.c @@ -21,7 +21,6 @@ #include "denali.h" #define DENALI_NAND_NAME "denali-nand" -#define DENALI_DEFAULT_OOB_SKIP_BYTES 8 /* for Indexed Addressing */ #define DENALI_INDEXED_CTRL 0x00 @@ -1302,22 +1301,16 @@ int denali_init(struct denali_controller *denali) /* * Set how many bytes should be skipped before writing data in OOB. - * If a non-zero value has already been configured, update it in HW. - * If a non-zero value has already been set (by firmware or something), - * just use it. Otherwise, set the driver's default. + * If a platform requests a non-zero value, set it to the register. + * Otherwise, read the value out, expecting it has already been set up + * by firmware. */ - if (denali->oob_skip_bytes) { + if (denali->oob_skip_bytes) iowrite32(denali->oob_skip_bytes, denali->reg + SPARE_AREA_SKIP_BYTES); - } else { - denali->oob_skip_bytes = - ioread32(denali->reg + SPARE_AREA_SKIP_BYTES); - if (!denali->oob_skip_bytes) { - denali->oob_skip_bytes = DENALI_DEFAULT_OOB_SKIP_BYTES; - iowrite32(denali->oob_skip_bytes, - denali->reg + SPARE_AREA_SKIP_BYTES); - } - } + else + denali->oob_skip_bytes = ioread32(denali->reg + + SPARE_AREA_SKIP_BYTES); iowrite32(0, denali->reg + TRANSFER_SPARE_REG); iowrite32(GENMASK(denali->nbanks - 1, 0), denali->reg + RB_PIN_ENABLED);