Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1353877imm; Tue, 5 Jun 2018 13:11:48 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKfQC9iNqpovSc8YDsC+rowfIv1dgB42KN9ojRCRiSLAzyFy7XEsbuBmouPUyvCuYqovZuK X-Received: by 2002:a63:778b:: with SMTP id s133-v6mr66553pgc.400.1528229508349; Tue, 05 Jun 2018 13:11:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528229508; cv=none; d=google.com; s=arc-20160816; b=IB5Fe4IzTjfOEzTnJqpgsCekzEfyafQQXpMQ/2c3Mr9yaHg/JCDE+bFBSo1Bvelq1K 4pKZCeoHhtm51tMf3Dgj3NWKS+J8Bv7IPApIy29VYgPaln/oFSMWqrxTOLB+XdXbuMU0 ffjCjHvkxvb71h3OZdqN5QS7xSIYXDUqlRl3Oy2AzC2pxIbpRf/xX5STylf28/diCSNQ 97D50ulC1Ubv1m3yiQKnUO/z3MVQZMEFOumZM59INq77gf1I+/m9lCkPtLvuRltQVMBo U6RGpUHM/uu9numGrVDyNcg3Fm/tMqbXgPC0sHHZl+7QpRycFcsUZ88IBHj9povxKnOX 2DkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=AirFfo+Gt88Y+dFVEFsipvx9rV4j8svltYy2hn8m93w=; b=aLlU5V72ny/vtjt5SITd+W62fvO6gsal3dl5dUZzLrxAg60HTeo08JepZslrtNnpwZ R9ZsZx/uEkPx89Vz+Isk57KqbhyVNQFOD+7bEtTeZBgEkZzLaAj33daXfX1Tg5xF/m5y aBJeUJ9xEp/zSMb4rj+YsML8e99/r7kZJJk3sxBwp4lUp1a1m+5DnCkDvKEZh75k9RjP 3c0lkcWdHIaFUFft12wf7Q6LExEbJ+5PZ/BRL5PlSsOc2+juOUfgHGL4V4eyMlrId9Z+ Fj8Pj12hh4LozlAYd+390CFP8cg8gkSiUDLEHev3FStT2aPW/4LQgkihdzXaMlg0nP5+ IAfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e187-v6si40073347pgc.127.2018.06.05.13.11.33; Tue, 05 Jun 2018 13:11:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752396AbeFEULH (ORCPT + 99 others); Tue, 5 Jun 2018 16:11:07 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:37458 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752125AbeFEULF (ORCPT ); Tue, 5 Jun 2018 16:11:05 -0400 Received: by mail-pg0-f67.google.com with SMTP id r21-v6so1423022pgv.4; Tue, 05 Jun 2018 13:11:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=AirFfo+Gt88Y+dFVEFsipvx9rV4j8svltYy2hn8m93w=; b=XDSC9KD3gMw26XIUkBiTjMgdWTvfwcxyvf9gHZ3+3n1oQqyPB2H3+sSK/tEvOwro88 Zx0NzujqFk0lnVQ9L/WrO0dT3uswNpB9/UD+BEbS4tOepGMcmUEu4Y5h357uEmHyq8S0 bGNFaDeQ+rGRYso5NLgO5OCxdy5SN+4XPpteQNGF101+Ez3HqU1aCCRi2PzWQWmwK/jd RPCRuOl4dEMASNYRB7LPQ8eDaA59ZfABM9DFQuWWafMz40zhRTZijqTCFvoVkIl0izh5 QHpWzHzqA0l6IY5qO/1hd5B2WBmp7Xyfy1urf+o5GTxewtv5sOZPBsj0QyPUYNgMHjxe xYuA== X-Gm-Message-State: APt69E0iv72qy2hNOz5h2bwSzfJ9r/nUv5fBpfaC2ophJinqde9Y4to5 3TepnP5yJzr7El0ajoITFQ== X-Received: by 2002:a65:4783:: with SMTP id e3-v6mr53053pgs.235.1528229464659; Tue, 05 Jun 2018 13:11:04 -0700 (PDT) Received: from localhost (24-223-123-72.static.usa-companies.net. [24.223.123.72]) by smtp.gmail.com with ESMTPSA id u9-v6sm95721104pfi.60.2018.06.05.13.11.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jun 2018 13:11:03 -0700 (PDT) Date: Tue, 5 Jun 2018 14:11:02 -0600 From: Rob Herring To: Stefan Agner Cc: boris.brezillon@bootlin.com, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, mark.rutland@arm.com, thierry.reding@gmail.com, dev@lynxeye.de, miquel.raynal@bootlin.com, richard@nod.at, marcel@ziswiler.com, krzk@kernel.org, digetx@gmail.com, benjamin.lindqvist@endian.se, jonathanh@nvidia.com, pdeschrijver@nvidia.com, pgaikwad@nvidia.com, mirza.krak@gmail.com, linux-mtd@lists.infradead.org, linux-tegra@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/6] mtd: rawnand: add an option to specify NAND chip as a boot device Message-ID: <20180605201102.GA22487@rob-hp-laptop> References: <20180531221637.6017-1-stefan@agner.ch> <20180531221637.6017-3-stefan@agner.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180531221637.6017-3-stefan@agner.ch> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 01, 2018 at 12:16:33AM +0200, Stefan Agner wrote: > Allow to define a NAND chip as a boot device. This can be helpful > for the selection of the ECC algorithm and strength in case the boot > ROM supports only a subset of controller provided options. > > Signed-off-by: Stefan Agner > --- > Documentation/devicetree/bindings/mtd/nand.txt | 4 ++++ > drivers/mtd/nand/raw/nand_base.c | 3 +++ > include/linux/mtd/rawnand.h | 6 ++++++ > 3 files changed, 13 insertions(+) > > diff --git a/Documentation/devicetree/bindings/mtd/nand.txt b/Documentation/devicetree/bindings/mtd/nand.txt > index 8bb11d809429..8daf81b9748c 100644 > --- a/Documentation/devicetree/bindings/mtd/nand.txt > +++ b/Documentation/devicetree/bindings/mtd/nand.txt > @@ -43,6 +43,10 @@ Optional NAND chip properties: > This is particularly useful when only the in-band area is > used by the upper layers, and you want to make your NAND > as reliable as possible. > +- nand-is-boot-medium: Whether the NAND chip is a boot medium. Drivers might use > + this information to select ECC algorithms supported by > + the boot ROM or similar restrictions. > + Shouldn't this be a partition level option? You could conceivably do one ECC type for boot area and something else for the rest of the NAND. > - nand-rb: shall contain the native Ready/Busy ids. > > The ECC strength and ECC step size properties define the correction capability > diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c > index 9eb5678dd6d0..c8fb7c9855e2 100644 > --- a/drivers/mtd/nand/raw/nand_base.c > +++ b/drivers/mtd/nand/raw/nand_base.c > @@ -5826,6 +5826,9 @@ static int nand_dt_init(struct nand_chip *chip) > if (of_get_nand_bus_width(dn) == 16) > chip->options |= NAND_BUSWIDTH_16; > > + if (of_property_read_bool(dn, "nand-is-boot-medium")) > + chip->options |= NAND_IS_BOOT_MEDIUM; > + > if (of_get_nand_on_flash_bbt(dn)) > chip->bbt_options |= NAND_BBT_USE_FLASH; > > diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h > index 6a82da8c44ce..8e54fcf2fa94 100644 > --- a/include/linux/mtd/rawnand.h > +++ b/include/linux/mtd/rawnand.h > @@ -212,6 +212,12 @@ enum nand_ecc_algo { > */ > #define NAND_WAIT_TCCS 0x00200000 > > +/* > + * Whether the NAND chip is a boot medium. Drivers might use this information > + * to select ECC algorithms supported by the boot ROM or similar restrictions. > + */ > +#define NAND_IS_BOOT_MEDIUM 0x00400000 > + > /* Options set by nand scan */ > /* Nand scan has allocated controller struct */ > #define NAND_CONTROLLER_ALLOC 0x80000000 > -- > 2.17.0 >