All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>, Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Richard Weinberger <richard@nod.at>,
	Kumar Gala <galak@codeaurora.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	Marek Vasut <marek.vasut@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	MTD Maling List <linux-mtd@lists.infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH v8 2/4] dt-bindings: Add bindings for SPI NAND devices
Date: Fri, 1 Jun 2018 14:18:35 -0500	[thread overview]
Message-ID: <CAL_JsqKBn9g95irT71fgwWneLCM0jLAKuSPUkNxA_+73Rm8pVA@mail.gmail.com> (raw)
In-Reply-To: <20180601190902.17cf5f6f@bbrezillon>

On Fri, Jun 1, 2018 at 12:09 PM, Boris Brezillon
<boris.brezillon@bootlin.com> wrote:
> Hi Geert,
>
> On Fri, 1 Jun 2018 16:42:26 +0200
> Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
>> Hi Boris,
>>
>> I became interested after reading the cover letter...
>>
>> On Fri, Jun 1, 2018 at 3:13 PM, Boris Brezillon
>> <boris.brezillon@bootlin.com> wrote:
>> > Add bindings for SPI NAND chips.
>> >
>> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
>>
>> Thanks for your patch!
>
> And thanks for reviewing it ;-).
>
>>
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
>> > @@ -0,0 +1,27 @@
>> > +SPI NAND flash
>> > +
>> > +Required properties:
>> > +- compatible: should be "spi-nand"

Seems awfully generic if you expect this alone. No chips with quirks
yet? Is there a standard for detection like jedec?

>> > +- reg: should encode the chip-select line used to access the NAND chip

"see spi.txt" should be enough.

>> > +
>> > +Optional properties
>> > +- spi-max-frequency: maximum frequency of the SPI bus the chip can operate at.
>> > +                    This should encode board limitations (i.e. max freq can't
>> > +                    be achieved due to crosstalk on IO lines).
>> > +                    When unspecified, the driver assumes the chip can run at
>> > +                    the max frequency defined in the spec (information
>> > +                    extracted chip detection time).
>>
>> This is a standard property according to
>> Documentation/devicetree/bindings/spi/spi-bus.txt. Can't you just refer
>> to that file, or just omit it, as it applies to all SPI slaves anyway?
>
> The thing is, the maximum frequency supported by a SPI NAND is directly
> encoded in the NAND device ID and can be auto-detected. Why should we
> define spi-max-frequency in the DT when we can automatically detect
> this information? The only reason one might want to override
> spi-max-frequency is when the board design impose such restrictions,
> hence the precision I give here.

This should always be the case. The operating frequency should be
min(host max, device max) unless the board has restrictions and needs
to set spi-max-frequency (and we really should have used
'bus-frequency' here). No doubt though, that is not what has been
done.

>> > +- spi-tx-bus-width: The bus width (number of data wires) that is used for MOSI.
>> > +                   Only encodes the board constraints (i.e. when not all IO
>> > +                   signals are routed on the board). Device constraints are
>> > +                   extracted when detecting the chip, and controller
>> > +                   constraints are exposed by the SPI mem controller. If this
>> > +                   property is missing that means no constraint at the board
>> > +                   level.
>> > +- spi-rx-bus-width: The bus width (number of data wires) that is used for MISO.
>> > +                   Only encodes the board constraints (i.e. when not all IO
>> > +                   signals are routed on the board). Device constraints are
>> > +                   extracted when detecting the chip, and controller
>> > +                   constraints are exposed by the SPI mem controller. If this
>> > +                   property is missing that means no constraint at the board
>> > +                   level.
>>
>> This does not match Documentation/devicetree/bindings/spi/spi-bus.txt,
>> which says the default is 1.
>
> Yes, I know.

Like frequency, this should have been similar. I imagine for the
common case, the number of host and device lines are 1 so it doesn't
really apply as this was added later on. Perhaps we can reword the
common definition to work for both?

Rob

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh+dt@kernel.org>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>,
	Richard Weinberger <richard@nod.at>,
	MTD Maling List <linux-mtd@lists.infradead.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Mark Brown <broonie@kernel.org>,
	linux-spi <linux-spi@vger.kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH v8 2/4] dt-bindings: Add bindings for SPI NAND devices
Date: Fri, 1 Jun 2018 14:18:35 -0500	[thread overview]
Message-ID: <CAL_JsqKBn9g95irT71fgwWneLCM0jLAKuSPUkNxA_+73Rm8pVA@mail.gmail.com> (raw)
In-Reply-To: <20180601190902.17cf5f6f@bbrezillon>

On Fri, Jun 1, 2018 at 12:09 PM, Boris Brezillon
<boris.brezillon@bootlin.com> wrote:
> Hi Geert,
>
> On Fri, 1 Jun 2018 16:42:26 +0200
> Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
>> Hi Boris,
>>
>> I became interested after reading the cover letter...
>>
>> On Fri, Jun 1, 2018 at 3:13 PM, Boris Brezillon
>> <boris.brezillon@bootlin.com> wrote:
>> > Add bindings for SPI NAND chips.
>> >
>> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
>>
>> Thanks for your patch!
>
> And thanks for reviewing it ;-).
>
>>
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
>> > @@ -0,0 +1,27 @@
>> > +SPI NAND flash
>> > +
>> > +Required properties:
>> > +- compatible: should be "spi-nand"

Seems awfully generic if you expect this alone. No chips with quirks
yet? Is there a standard for detection like jedec?

>> > +- reg: should encode the chip-select line used to access the NAND chip

"see spi.txt" should be enough.

>> > +
>> > +Optional properties
>> > +- spi-max-frequency: maximum frequency of the SPI bus the chip can operate at.
>> > +                    This should encode board limitations (i.e. max freq can't
>> > +                    be achieved due to crosstalk on IO lines).
>> > +                    When unspecified, the driver assumes the chip can run at
>> > +                    the max frequency defined in the spec (information
>> > +                    extracted chip detection time).
>>
>> This is a standard property according to
>> Documentation/devicetree/bindings/spi/spi-bus.txt. Can't you just refer
>> to that file, or just omit it, as it applies to all SPI slaves anyway?
>
> The thing is, the maximum frequency supported by a SPI NAND is directly
> encoded in the NAND device ID and can be auto-detected. Why should we
> define spi-max-frequency in the DT when we can automatically detect
> this information? The only reason one might want to override
> spi-max-frequency is when the board design impose such restrictions,
> hence the precision I give here.

This should always be the case. The operating frequency should be
min(host max, device max) unless the board has restrictions and needs
to set spi-max-frequency (and we really should have used
'bus-frequency' here). No doubt though, that is not what has been
done.

>> > +- spi-tx-bus-width: The bus width (number of data wires) that is used for MOSI.
>> > +                   Only encodes the board constraints (i.e. when not all IO
>> > +                   signals are routed on the board). Device constraints are
>> > +                   extracted when detecting the chip, and controller
>> > +                   constraints are exposed by the SPI mem controller. If this
>> > +                   property is missing that means no constraint at the board
>> > +                   level.
>> > +- spi-rx-bus-width: The bus width (number of data wires) that is used for MISO.
>> > +                   Only encodes the board constraints (i.e. when not all IO
>> > +                   signals are routed on the board). Device constraints are
>> > +                   extracted when detecting the chip, and controller
>> > +                   constraints are exposed by the SPI mem controller. If this
>> > +                   property is missing that means no constraint at the board
>> > +                   level.
>>
>> This does not match Documentation/devicetree/bindings/spi/spi-bus.txt,
>> which says the default is 1.
>
> Yes, I know.

Like frequency, this should have been similar. I imagine for the
common case, the number of host and device lines are 1 so it doesn't
really apply as this was added later on. Perhaps we can reword the
common definition to work for both?

Rob

  parent reply	other threads:[~2018-06-01 19:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01 13:13 [PATCH v8 0/4] mtd: Add a SPI NAND driver Boris Brezillon
2018-06-01 13:13 ` Boris Brezillon
2018-06-01 13:13 ` [PATCH v8 1/4] mtd: nand: Add core infrastructure to support SPI NANDs Boris Brezillon
2018-06-01 13:13   ` Boris Brezillon
2018-06-01 13:13 ` [PATCH v8 2/4] dt-bindings: Add bindings for SPI NAND devices Boris Brezillon
2018-06-01 13:13   ` Boris Brezillon
2018-06-01 14:42   ` Geert Uytterhoeven
2018-06-01 14:42     ` Geert Uytterhoeven
2018-06-01 17:09     ` Boris Brezillon
2018-06-01 17:09       ` Boris Brezillon
2018-06-01 17:40       ` Geert Uytterhoeven
2018-06-01 17:40         ` Geert Uytterhoeven
2018-06-01 21:07         ` Boris Brezillon
2018-06-01 21:07           ` Boris Brezillon
2018-06-04 10:04         ` Boris Brezillon
2018-06-04 10:04           ` Boris Brezillon
2018-06-01 19:18       ` Rob Herring [this message]
2018-06-01 19:18         ` Rob Herring
2018-06-01 20:32         ` Boris Brezillon
2018-06-01 20:32           ` Boris Brezillon
2018-06-01 13:13 ` [PATCH v8 3/4] mtd: spinand: Add initial support for Micron MT29F2G01ABAGD Boris Brezillon
2018-06-01 13:13   ` Boris Brezillon
2018-06-01 13:14 ` [PATCH v8 4/4] mtd: spinand: Add initial support for Winbond W25M02GV Boris Brezillon
2018-06-01 13:14   ` Boris Brezillon

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=CAL_JsqKBn9g95irT71fgwWneLCM0jLAKuSPUkNxA_+73Rm8pVA@mail.gmail.com \
    --to=robh+dt@kernel.org \
    --cc=boris.brezillon@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=galak@codeaurora.org \
    --cc=geert@linux-m68k.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.rutland@arm.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=pawel.moll@arm.com \
    --cc=richard@nod.at \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.