devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: William Zhang <william.zhang@broadcom.com>
Cc: Florian Fainelli <florian.fainelli@broadcom.com>,
	David Regan <dregan@broadcom.com>,
	dregan@mail.com, richard@nod.at, vigneshr@ti.com,
	robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, computersforpeace@gmail.com,
	kdasu.kdev@gmail.com, linux-mtd@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	joel.peshkin@broadcom.com, tomer.yacoby@broadcom.com,
	dan.beygelman@broadcom.com, anand.gore@broadcom.com,
	kursad.oney@broadcom.com, rafal@milecki.pl,
	bcm-kernel-feedback-list@broadcom.com, andre.przywara@arm.com,
	baruch@tkos.co.il, linux-arm-kernel@lists.infradead.org,
	dan.carpenter@linaro.org
Subject: Re: [PATCH v3 02/10] ARM: dts: broadcom: bcmbca: Add NAND controller node
Date: Thu, 25 Jan 2024 10:20:58 +0100	[thread overview]
Message-ID: <20240125102058.5ae46d8a@xps-13> (raw)
In-Reply-To: <722d6bdf-9a43-436d-a9e2-4c21e1deb8c3@broadcom.com>

Hi William,

> >>>> +        nand_controller: nand-controller@1800 {
> >>>> +            #address-cells = <1>;
> >>>> +            #size-cells = <0>;
> >>>> +            compatible = "brcm,nand-bcm63138", >>>> "brcm,brcmnand-v7.1", "brcm,brcmnand";
> >>>> +            reg = <0x1800 0x600>, <0x2000 0x10>;
> >>>> +            reg-names = "nand", "nand-int-base";
> >>>> +            brcm,nand-use-wp = <0>;
> >>>> +            status = "disabled";
> >>>> +
> >>>> +            nandcs: nand@0 {
> >>>> +                compatible = "brcm,nandcs";
> >>>> +                reg = <0>;
> >>>> +                nand-on-flash-bbt;
> >>>> +                brcm,nand-ecc-use-strap;  
> >>>
> >>> Describing the NAND chip in a SoC DTSI does not look relevant to me.
> >>> Even more if you add something like this nand-ecc-use-strap setting
> >>> which is very board dependent.
> >>>  
> >> I am not sure if I understand you comments correctly but are you >> suggesting to put this whole nand controller node into each board dts? >> We have other ip block nodes like SPI, uart in this same soc dtsi file >> too.  For all the bcmbca soc dtsi I am updating here(and its board >> design), we always use the strap to for ecc setting.  So I thought it >> should be okay to put brcm,nand-ecc-use-strap in the default dtsi >> file. For any board that uses the raw nand nand-ecc property, the >> board dts can do so and override the brcm,nand-ecc-use-strap setting.  
> > 
> > I read Miquel's comment as meaning that the nandcs aka the NAND > chip/flash part description should be in the board .dts file, while the > controller itself can remain in the .dtsi file with its status = > "disabled" property.
> > 
> > Are there customer boards, that is non reference boards that might chose > a different chip select number and/or not use the strap settings?  
> In BCMBCA SoC, there is only one cs and customer design also have to use strap for the bootrom to boot up properly.  They can override it with dts in linux but I don't think any customer would do that.
> 
> Maybe the nand-on-flash-bbt could be possible item that customer may have to set it differently if they don't follow our reference software design.
> 
> I will move the nand-on-flash-bbt to the board dts but I would like to keep the other default nandcs settings in SoC.dsti if that is not too out of the conventional rule and Miquel is okay with it.

I think there is a global misunderstanding regarding the use of the
nand-ecc-* properties. These are not the default. The default is the OS
choice and depends on the NAND capabilities. The OS will always try to
match the closest ECC settings offered by the engine, based on the NAND
chip requirements which are discoverable. If you want to maximize your
strength, it is also possible to tell the OS with a dedicated (generic)
property. And only if you want something different, you may use these
properties, but they should be the exception rather than the rule.

Overriding this with a strap is a bad hardware design on commercial
products IMO. I am totally fine with the idea of a strap to choose
the ECC configuration for development boards/evaluation kits, but once
you've decided which setting you want you cannot change it for the
lifetime of your project (or with a lot of difficulties) so I don't see
the point of such a strap. So really, I don't like the idea of defining
by default a variable which asks for an override of the defaults, even
though many of your customers might want to use that.

So, anything that is design dependent (the chip CS, ECC
configuration, etc) should go into the board DTS, and what is SoC
related hardware (like the definition of the NAND controller) should
stay in the DTSI, as properly clarified by Florian.

Thanks,
Miquèl

  reply	other threads:[~2024-01-25  9:21 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24  3:04 [PATCH v3 00/10] mtd: rawnand: brcmnand: driver and doc updates David Regan
2024-01-24  3:04 ` [PATCH v3 01/10] dt-bindings: mtd: brcmnand: Updates for bcmbca SoCs David Regan
2024-01-24 17:24   ` Conor Dooley
2024-01-25  3:01     ` William Zhang
2024-01-25 19:51       ` Conor Dooley
2024-01-26  1:55         ` William Zhang
2024-01-26 16:46           ` Conor Dooley
2024-01-26 18:09             ` William Zhang
2024-01-24 17:24   ` Conor Dooley
2024-01-24 17:34   ` Miquel Raynal
2024-01-25  3:14     ` William Zhang
2024-01-24  3:04 ` [PATCH v3 02/10] ARM: dts: broadcom: bcmbca: Add NAND controller node David Regan
2024-01-24 17:30   ` Miquel Raynal
2024-01-25  3:09     ` William Zhang
2024-01-25  3:34       ` Florian Fainelli
2024-01-25  5:53         ` William Zhang
2024-01-25  9:20           ` Miquel Raynal [this message]
2024-01-25 18:14             ` William Zhang
2024-01-24  3:04 ` [PATCH v3 03/10] arm64: " David Regan
2024-01-24  3:04 ` [PATCH v3 04/10] mtd: rawnand: brcmnand: Rename bcm63138 nand driver David Regan
2024-01-24  3:04 ` [PATCH v3 05/10] mtd: rawnand: brcmnand: Add BCMBCA read data bus interface David Regan
2024-01-24  3:04 ` [PATCH v3 06/10] mtd: rawnand: brcmnand: Add support for getting ecc setting from strap David Regan
2024-01-24 17:32   ` Miquel Raynal
2024-01-25  3:13     ` William Zhang
2024-01-24  3:04 ` [PATCH v3 07/10] mtd: rawnand: brcmnand: Support write protection setting from dts David Regan
2024-01-24  3:04 ` [PATCH v3 08/10] mtd: rawnand: brcmnand: exec_op helper functions return type fixes David Regan
2024-01-24 17:35   ` Miquel Raynal
2024-01-24  3:04 ` [PATCH v3 09/10] mtd: rawnand: brcmnand: update log level messages David Regan
2024-01-24 17:37   ` Miquel Raynal
2024-01-25 18:47     ` David Regan
2024-01-24  3:04 ` [PATCH v3 10/10] mtd: rawnand: brcmnand: allow for on-die ecc David Regan
2024-01-24 17:40   ` Miquel Raynal
2024-01-25 19:47     ` David Regan
2024-01-26  6:19       ` Miquel Raynal
2024-01-26 19:57         ` David Regan
2024-01-29 10:52           ` Miquel Raynal
2024-01-30  8:11             ` William Zhang
2024-01-30 11:01               ` Miquel Raynal
2024-01-30 15:26                 ` David Regan
2024-01-30 18:55                   ` Miquel Raynal
2024-02-01  6:48                     ` William Zhang
2024-02-01  8:25                       ` Miquel Raynal
2024-02-01 18:53                         ` William Zhang
2024-02-02 17:38                         ` David Regan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240125102058.5ae46d8a@xps-13 \
    --to=miquel.raynal@bootlin.com \
    --cc=anand.gore@broadcom.com \
    --cc=andre.przywara@arm.com \
    --cc=baruch@tkos.co.il \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=computersforpeace@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=dan.beygelman@broadcom.com \
    --cc=dan.carpenter@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dregan@broadcom.com \
    --cc=dregan@mail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=joel.peshkin@broadcom.com \
    --cc=kdasu.kdev@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kursad.oney@broadcom.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=rafal@milecki.pl \
    --cc=richard@nod.at \
    --cc=robh+dt@kernel.org \
    --cc=tomer.yacoby@broadcom.com \
    --cc=vigneshr@ti.com \
    --cc=william.zhang@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).