* [PATCH 3/3] mtd: spi-nand: add devicetree binding
@ 2015-01-08 0:52 Peter Pan 潘栋 (peterpandong)
2015-01-08 3:15 ` Ezequiel Garcia
[not found] ` <87F60714EC601C4C83DFF1D2E3D390A04AB425-xjs9rfTec9KBtk7LW/CC8tTcztV8WXajQQ4Iyu8u01E@public.gmane.org>
0 siblings, 2 replies; 7+ messages in thread
From: Peter Pan 潘栋 (peterpandong) @ 2015-01-08 0:52 UTC (permalink / raw)
To: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
dwmw2@infradead.org, Brian Norris, Ezequiel Garcia
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Qi Wang 王起 (qiwang),
Frank Liu 刘群 (frankliu),
Melanie Zhang 张燕 (melaniezhang),
Peter Pan 潘栋 (peterpandong)
This commit adds the devicetree binding document that specifies the
spi nand devices support.
Signed-off-by: Peter Pan <peterpandong@micron.com>
---
Documentation/devicetree/bindings/mtd/spi-nand.txt | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt
diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt
new file mode 100644
index 0000000..9dd3efd
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
@@ -0,0 +1,22 @@
+* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
+
+Required properties:
+- #address-cells, #size-cells : Must be present if the device has sub-nodes
+ representing partitions.
+- compatible : Should be the manufacturer and the name of the chip. Bear in mind
+ the DT binding is not Linux-only, but in case of Linux, see the
+ "spi_nand_id_table" array in drivers/mtd/spi-nand/spi-nand-device.c
+ for the list of supported chips.
+- reg : Chip-Select number
+- spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at
+
+Example:
+
+ flash: flash@0 {
+ #address-cells = <1>;
+ #size-cells = <1>;
+ compatible = "micron,mt29f";
+ reg = <0>;
+ spi-max-frequency = <50000000>;
+ };
+
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] mtd: spi-nand: add devicetree binding
2015-01-08 0:52 [PATCH 3/3] mtd: spi-nand: add devicetree binding Peter Pan 潘栋 (peterpandong)
@ 2015-01-08 3:15 ` Ezequiel Garcia
2015-01-08 5:04 ` Peter Pan 潘栋 (peterpandong)
[not found] ` <87F60714EC601C4C83DFF1D2E3D390A04AB425-xjs9rfTec9KBtk7LW/CC8tTcztV8WXajQQ4Iyu8u01E@public.gmane.org>
1 sibling, 1 reply; 7+ messages in thread
From: Ezequiel Garcia @ 2015-01-08 3:15 UTC (permalink / raw)
To: "Peter Pan 潘栋 (peterpandong)",
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
dwmw2@infradead.org, Brian Norris
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Qi Wang 王起 (qiwang)",
"Frank Liu 刘群 (frankliu)",
"Melanie Zhang 张燕 (melaniezhang)"
On 01/07/2015 09:52 PM, Peter Pan 潘栋 (peterpandong) wrote:
> This commit adds the devicetree binding document that specifies the
> spi nand devices support.
>
> Signed-off-by: Peter Pan <peterpandong@micron.com>
> ---
> Documentation/devicetree/bindings/mtd/spi-nand.txt | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt
>
> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> new file mode 100644
> index 0000000..9dd3efd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> @@ -0,0 +1,22 @@
> +* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
> +
> +Required properties:
> +- #address-cells, #size-cells : Must be present if the device has sub-nodes
> + representing partitions.
> +- compatible : Should be the manufacturer and the name of the chip. Bear in mind
>
Unless I'm mistaken, we don't need the chip ID here, as SPI NAND allows
to autodetect the device. Any reason why we can't just use a generic
compatible "spi-nand" here?
--
Ezequiel
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 3/3] mtd: spi-nand: add devicetree binding
2015-01-08 3:15 ` Ezequiel Garcia
@ 2015-01-08 5:04 ` Peter Pan 潘栋 (peterpandong)
2015-01-08 15:12 ` Ezequiel Garcia
0 siblings, 1 reply; 7+ messages in thread
From: Peter Pan 潘栋 (peterpandong) @ 2015-01-08 5:04 UTC (permalink / raw)
To: Ezequiel Garcia, robh+dt@kernel.org, pawel.moll@arm.com,
mark.rutland@arm.com, ijc+devicetree@hellion.org.uk,
galak@codeaurora.org, dwmw2@infradead.org, Brian Norris
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Qi Wang 王起 (qiwang),
Frank Liu 刘群 (frankliu),
Melanie Zhang 张燕 (melaniezhang)
> > This commit adds the devicetree binding document that specifies the
> > spi nand devices support.
> >
> > Signed-off-by: Peter Pan <peterpandong@micron.com>
> > ---
> > Documentation/devicetree/bindings/mtd/spi-nand.txt | 22
> ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/mtd/spi-
> nand.txt
> >
> > diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt
> b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> > new file mode 100644
> > index 0000000..9dd3efd
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> > @@ -0,0 +1,22 @@
> > +* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
> > +
> > +Required properties:
> > +- #address-cells, #size-cells : Must be present if the device has
> sub-nodes
> > + representing partitions.
> > +- compatible : Should be the manufacturer and the name of the chip.
> Bear in mind
> >
>
> Unless I'm mistaken, we don't need the chip ID here, as SPI NAND allows
> to autodetect the device. Any reason why we can't just use a generic
> compatible "spi-nand" here?
> --
> Ezequiel
In fact, I don't know how to autodetect the SPI NAND device. Micron device and
Gigadevice device have different read ID functions. The Chip ID here is used to
determine which function to use.
Peter Pan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] mtd: spi-nand: add devicetree binding
[not found] ` <87F60714EC601C4C83DFF1D2E3D390A04AB425-xjs9rfTec9KBtk7LW/CC8tTcztV8WXajQQ4Iyu8u01E@public.gmane.org>
@ 2015-01-08 14:35 ` Mark Rutland
0 siblings, 0 replies; 7+ messages in thread
From: Mark Rutland @ 2015-01-08 14:35 UTC (permalink / raw)
To: Peter Pan 潘栋 (peterpandong)
Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, Pawel Moll,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, Brian Norris,
Ezequiel Garcia,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Qi Wang 王起 (qiwang),
Frank Liu 刘群 (frankliu),
Melanie Zhang 张燕 (melaniezhang)
On Thu, Jan 08, 2015 at 12:52:26AM +0000, Peter Pan 潘栋 (peterpandong) wrote:
> This commit adds the devicetree binding document that specifies the
> spi nand devices support.
>
> Signed-off-by: Peter Pan <peterpandong-AL4WhLSQfzjQT0dZR+AlfA@public.gmane.org>
> ---
> Documentation/devicetree/bindings/mtd/spi-nand.txt | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/mtd/spi-nand.txt
>
> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> new file mode 100644
> index 0000000..9dd3efd
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> @@ -0,0 +1,22 @@
> +* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
> +
> +Required properties:
> +- #address-cells, #size-cells : Must be present if the device has sub-nodes
> + representing partitions.
Can we refer to the binding document for that?
> +- compatible : Should be the manufacturer and the name of the chip. Bear in mind
> + the DT binding is not Linux-only, but in case of Linux, see the
> + "spi_nand_id_table" array in drivers/mtd/spi-nand/spi-nand-device.c
> + for the list of supported chips.
NAK for referring to Linux internals from a binding document.
The list of compatible string should be defined in this binding
document.
> +- reg : Chip-Select number
> +- spi-max-frequency : Maximum frequency of the SPI bus the chip can operate at
> +
> +Example:
> +
> + flash: flash@0 {
> + #address-cells = <1>;
> + #size-cells = <1>;
These aren't necessary as no partitions are defined here.
Otherwise, this looks ok.
Thanks,
Mark.
> + compatible = "micron,mt29f";
> + reg = <0>;
> + spi-max-frequency = <50000000>;
> + };
> +
> --
> 1.9.1
> N嫥叉靣笡y氊b瞂千v豝?藓{.n?壏漽鴾z谵z)韰骅w*\x1fjg?秹殠娸/侁鋤罐枈?娹櫒璀??摺玜囤\x7f\x1e瓽珴閔?鎗:+v墾妛鑶佶
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] mtd: spi-nand: add devicetree binding
2015-01-08 5:04 ` Peter Pan 潘栋 (peterpandong)
@ 2015-01-08 15:12 ` Ezequiel Garcia
[not found] ` <54AE9E54.2010506-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Ezequiel Garcia @ 2015-01-08 15:12 UTC (permalink / raw)
To: "Peter Pan 潘栋 (peterpandong)",
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
dwmw2@infradead.org, Brian Norris
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Qi Wang 王起 (qiwang)",
"Frank Liu 刘群 (frankliu)",
"Melanie Zhang 张燕 (melaniezhang)"
On 01/08/2015 02:04 AM, Peter Pan 潘栋 (peterpandong) wrote:
>>> This commit adds the devicetree binding document that specifies the
>>> spi nand devices support.
>>>
>>> Signed-off-by: Peter Pan <peterpandong@micron.com>
>>> ---
>>> Documentation/devicetree/bindings/mtd/spi-nand.txt | 22
>> ++++++++++++++++++++++
>>> 1 file changed, 22 insertions(+)
>>> create mode 100644 Documentation/devicetree/bindings/mtd/spi-
>> nand.txt
>>>
>>> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt
>> b/Documentation/devicetree/bindings/mtd/spi-nand.txt
>>> new file mode 100644
>>> index 0000000..9dd3efd
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
>>> @@ -0,0 +1,22 @@
>>> +* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
>>> +
>>> +Required properties:
>>> +- #address-cells, #size-cells : Must be present if the device has
>> sub-nodes
>>> + representing partitions.
>>> +- compatible : Should be the manufacturer and the name of the chip.
>> Bear in mind
>>>
>>
>> Unless I'm mistaken, we don't need the chip ID here, as SPI NAND allows
>> to autodetect the device. Any reason why we can't just use a generic
>> compatible "spi-nand" here?
>> --
>> Ezequiel
>
> In fact, I don't know how to autodetect the SPI NAND device. Micron device and
> Gigadevice device have different read ID functions. The Chip ID here is used to
> determine which function to use.
>
Isn't the difference between the Read ID very minor? One of the vendor
needs a 2-byte ID read, and the other one needs a 3-byte ID read.
So you can just try with 2-byte, and if that fails (no vendor ID is
found on the first byte), you can try with the 3-byte command.
It's not the most elegant solution, but it's not super awful either.
--
Ezequiel
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 3/3] mtd: spi-nand: add devicetree binding
[not found] ` <54AE9E54.2010506-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
@ 2015-01-12 1:57 ` Peter Pan 潘栋 (peterpandong)
2015-01-20 10:59 ` Ezequiel Garcia
0 siblings, 1 reply; 7+ messages in thread
From: Peter Pan 潘栋 (peterpandong) @ 2015-01-12 1:57 UTC (permalink / raw)
To: Ezequiel Garcia, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
pawel.moll-5wv7dgnIgG8@public.gmane.org,
mark.rutland-5wv7dgnIgG8@public.gmane.org,
ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
dwmw2-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, Brian Norris
Cc: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Qi Wang 王起 (qiwang),
Frank Liu 刘群 (frankliu),
Melanie Zhang 张燕 (melaniezhang)
> On 01/08/2015 02:04 AM, Peter Pan 潘栋 (peterpandong) wrote:
> >>> This commit adds the devicetree binding document that specifies the
> >>> spi nand devices support.
> >>>
> >>> Signed-off-by: Peter Pan <peterpandong@micron.com>
> >>> ---
> >>> Documentation/devicetree/bindings/mtd/spi-nand.txt | 22
> >> ++++++++++++++++++++++
> >>> 1 file changed, 22 insertions(+)
> >>> create mode 100644 Documentation/devicetree/bindings/mtd/spi-
> >> nand.txt
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt
> >> b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> >>> new file mode 100644
> >>> index 0000000..9dd3efd
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
> >>> @@ -0,0 +1,22 @@
> >>> +* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
> >>> +
> >>> +Required properties:
> >>> +- #address-cells, #size-cells : Must be present if the device has
> >> sub-nodes
> >>> + representing partitions.
> >>> +- compatible : Should be the manufacturer and the name of the chip.
> >> Bear in mind
> >>>
> >>
> >> Unless I'm mistaken, we don't need the chip ID here, as SPI NAND
> allows
> >> to autodetect the device. Any reason why we can't just use a generic
> >> compatible "spi-nand" here?
> >> --
> >> Ezequiel
> >
> > In fact, I don't know how to autodetect the SPI NAND device. Micron
> device and
> > Gigadevice device have different read ID functions. The Chip ID here
> is used to
> > determine which function to use.
> >
>
> Isn't the difference between the Read ID very minor? One of the vendor
> needs a 2-byte ID read, and the other one needs a 3-byte ID read.
>
> So you can just try with 2-byte, and if that fails (no vendor ID is
> found on the first byte), you can try with the 3-byte command.
>
> It's not the most elegant solution, but it's not super awful either.
> --
> Ezequiel
I agree with your idea about try different ways to read ID. It is a better way
to detect the chip if it can work properly.
The difference between the Read ID is that some chips need to send a dummy byte
or address after opcode then read 2 byte, some chips needn't send any data after
opcode but read 3 byte.
I'm concerned maybe chip will get into unknown or vendor specified state if we
send the wrong sequence.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] mtd: spi-nand: add devicetree binding
2015-01-12 1:57 ` Peter Pan 潘栋 (peterpandong)
@ 2015-01-20 10:59 ` Ezequiel Garcia
0 siblings, 0 replies; 7+ messages in thread
From: Ezequiel Garcia @ 2015-01-20 10:59 UTC (permalink / raw)
To: "Peter Pan 潘栋 (peterpandong)",
robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
dwmw2@infradead.org, Brian Norris
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Qi Wang 王起 (qiwang)",
"Frank Liu 刘群 (frankliu)",
"Melanie Zhang 张燕 (melaniezhang)"
On 01/11/2015 10:57 PM, Peter Pan 潘栋 (peterpandong) wrote:
>> On 01/08/2015 02:04 AM, Peter Pan 潘栋 (peterpandong) wrote:
>>>>> This commit adds the devicetree binding document that specifies the
>>>>> spi nand devices support.
>>>>>
>>>>> Signed-off-by: Peter Pan <peterpandong@micron.com>
>>>>> ---
>>>>> Documentation/devicetree/bindings/mtd/spi-nand.txt | 22
>>>> ++++++++++++++++++++++
>>>>> 1 file changed, 22 insertions(+)
>>>>> create mode 100644 Documentation/devicetree/bindings/mtd/spi-
>>>> nand.txt
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/mtd/spi-nand.txt
>>>> b/Documentation/devicetree/bindings/mtd/spi-nand.txt
>>>>> new file mode 100644
>>>>> index 0000000..9dd3efd
>>>>> --- /dev/null
>>>>> +++ b/Documentation/devicetree/bindings/mtd/spi-nand.txt
>>>>> @@ -0,0 +1,22 @@
>>>>> +* NAND driver for MT29F, GD5F and similar SPI NAND flash chips
>>>>> +
>>>>> +Required properties:
>>>>> +- #address-cells, #size-cells : Must be present if the device has
>>>> sub-nodes
>>>>> + representing partitions.
>>>>> +- compatible : Should be the manufacturer and the name of the chip.
>>>> Bear in mind
>>>>>
>>>>
>>>> Unless I'm mistaken, we don't need the chip ID here, as SPI NAND
>> allows
>>>> to autodetect the device. Any reason why we can't just use a generic
>>>> compatible "spi-nand" here?
>>>> --
>>>> Ezequiel
>>>
>>> In fact, I don't know how to autodetect the SPI NAND device. Micron
>> device and
>>> Gigadevice device have different read ID functions. The Chip ID here
>> is used to
>>> determine which function to use.
>>>
>>
>> Isn't the difference between the Read ID very minor? One of the vendor
>> needs a 2-byte ID read, and the other one needs a 3-byte ID read.
>>
>> So you can just try with 2-byte, and if that fails (no vendor ID is
>> found on the first byte), you can try with the 3-byte command.
>>
>> It's not the most elegant solution, but it's not super awful either.
>> --
>> Ezequiel
>
> I agree with your idea about try different ways to read ID. It is a better way
> to detect the chip if it can work properly.
>
> The difference between the Read ID is that some chips need to send a dummy byte
> or address after opcode then read 2 byte, some chips needn't send any data after
> opcode but read 3 byte.
>
> I'm concerned maybe chip will get into unknown or vendor specified state if we
> send the wrong sequence.
>
Have you seen this happpening? Or this a potential/future problem?
For the latter, we can always fix it when the issue appears.
--
Ezequiel
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-01-20 10:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08 0:52 [PATCH 3/3] mtd: spi-nand: add devicetree binding Peter Pan 潘栋 (peterpandong)
2015-01-08 3:15 ` Ezequiel Garcia
2015-01-08 5:04 ` Peter Pan 潘栋 (peterpandong)
2015-01-08 15:12 ` Ezequiel Garcia
[not found] ` <54AE9E54.2010506-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-01-12 1:57 ` Peter Pan 潘栋 (peterpandong)
2015-01-20 10:59 ` Ezequiel Garcia
[not found] ` <87F60714EC601C4C83DFF1D2E3D390A04AB425-xjs9rfTec9KBtk7LW/CC8tTcztV8WXajQQ4Iyu8u01E@public.gmane.org>
2015-01-08 14:35 ` Mark Rutland
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).