All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-14  7:17 ` Masahiro Yamada
  0 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-14  7:17 UTC (permalink / raw)
  To: linux-mtd
  Cc: Oleksij Rempel, Dinh Nguyen, Masahiro Yamada, Cyrille Pitchen,
	devicetree, linux-kernel, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, Rob Herring,
	Mark Rutland

This example allocates too much for register regions.  Especially,
there are only two registers in the "nand_data" interface of this
hardware (ADDR: 0x00, DATA: 0x10).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt b/Documentation/devicetree/bindings/mtd/denali-nand.txt
index 504291d..0ee8edb 100644
--- a/Documentation/devicetree/bindings/mtd/denali-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt
@@ -29,7 +29,7 @@ nand: nand@ff900000 {
 	#address-cells = <1>;
 	#size-cells = <1>;
 	compatible = "altr,socfpga-denali-nand";
-	reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
+	reg = <0xff900000 0x20>, <0xffb80000 0x1000>;
 	reg-names = "nand_data", "denali_reg";
 	interrupts = <0 144 4>;
 };
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-14  7:17 ` Masahiro Yamada
  0 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-14  7:17 UTC (permalink / raw)
  To: linux-mtd
  Cc: Mark Rutland, devicetree, Richard Weinberger, Oleksij Rempel,
	Boris Brezillon, Dinh Nguyen, linux-kernel, Masahiro Yamada,
	Rob Herring, Cyrille Pitchen, Brian Norris, David Woodhouse,
	Marek Vasut

This example allocates too much for register regions.  Especially,
there are only two registers in the "nand_data" interface of this
hardware (ADDR: 0x00, DATA: 0x10).

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt b/Documentation/devicetree/bindings/mtd/denali-nand.txt
index 504291d..0ee8edb 100644
--- a/Documentation/devicetree/bindings/mtd/denali-nand.txt
+++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt
@@ -29,7 +29,7 @@ nand: nand@ff900000 {
 	#address-cells = <1>;
 	#size-cells = <1>;
 	compatible = "altr,socfpga-denali-nand";
-	reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
+	reg = <0xff900000 0x20>, <0xffb80000 0x1000>;
 	reg-names = "nand_data", "denali_reg";
 	interrupts = <0 144 4>;
 };
-- 
2.7.4


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

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
  2017-09-14  7:17 ` Masahiro Yamada
  (?)
@ 2017-09-14  8:04 ` Oleksij Rempel
  2017-09-14  8:16     ` Masahiro Yamada
  -1 siblings, 1 reply; 13+ messages in thread
From: Oleksij Rempel @ 2017-09-14  8:04 UTC (permalink / raw)
  To: Masahiro Yamada, linux-mtd
  Cc: Oleksij Rempel, Dinh Nguyen, Cyrille Pitchen, devicetree,
	linux-kernel, Boris Brezillon, Marek Vasut, Brian Norris,
	Richard Weinberger, David Woodhouse, Rob Herring, Mark Rutland

Hi,

i assume arch/arm/boot/dts/socfpga.dtsi should be update as well. Right?

On 14.09.2017 09:17, Masahiro Yamada wrote:
> This example allocates too much for register regions.  Especially,
> there are only two registers in the "nand_data" interface of this
> hardware (ADDR: 0x00, DATA: 0x10).
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>   Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt b/Documentation/devicetree/bindings/mtd/denali-nand.txt
> index 504291d..0ee8edb 100644
> --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt
> +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt
> @@ -29,7 +29,7 @@ nand: nand@ff900000 {
>   	#address-cells = <1>;
>   	#size-cells = <1>;
>   	compatible = "altr,socfpga-denali-nand";
> -	reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
> +	reg = <0xff900000 0x20>, <0xffb80000 0x1000>;
>   	reg-names = "nand_data", "denali_reg";
>   	interrupts = <0 144 4>;
>   };
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-14  8:16     ` Masahiro Yamada
  0 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-14  8:16 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: linux-mtd, Oleksij Rempel, Dinh Nguyen, Cyrille Pitchen,
	devicetree, Linux Kernel Mailing List, Boris Brezillon,
	Marek Vasut, Brian Norris, Richard Weinberger, David Woodhouse,
	Rob Herring, Mark Rutland

Hi.


2017-09-14 17:04 GMT+09:00 Oleksij Rempel <ore@pengutronix.de>:
> Hi,
>
> i assume arch/arm/boot/dts/socfpga.dtsi should be update as well. Right?

I think so.
(also arch/arm/boot/dts/socfpga_arria10.dtsi in the same way)

The wrong property "dma-mask" was removed by
commit 60d920d32ca40660e382cf9ccbc236599a49e607.



> On 14.09.2017 09:17, Masahiro Yamada wrote:
>>
>> This example allocates too much for register regions.  Especially,
>> there are only two registers in the "nand_data" interface of this
>> hardware (ADDR: 0x00, DATA: 0x10).
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>> ---
>>
>>   Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> b/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> index 504291d..0ee8edb 100644
>> --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> @@ -29,7 +29,7 @@ nand: nand@ff900000 {
>>         #address-cells = <1>;
>>         #size-cells = <1>;
>>         compatible = "altr,socfpga-denali-nand";
>> -       reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
>> +       reg = <0xff900000 0x20>, <0xffb80000 0x1000>;
>>         reg-names = "nand_data", "denali_reg";
>>         interrupts = <0 144 4>;
>>   };
>>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-14  8:16     ` Masahiro Yamada
  0 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-14  8:16 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Oleksij Rempel,
	Dinh Nguyen, Cyrille Pitchen, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux Kernel Mailing List, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, Rob Herring,
	Mark Rutland

Hi.


2017-09-14 17:04 GMT+09:00 Oleksij Rempel <ore-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
> Hi,
>
> i assume arch/arm/boot/dts/socfpga.dtsi should be update as well. Right?

I think so.
(also arch/arm/boot/dts/socfpga_arria10.dtsi in the same way)

The wrong property "dma-mask" was removed by
commit 60d920d32ca40660e382cf9ccbc236599a49e607.



> On 14.09.2017 09:17, Masahiro Yamada wrote:
>>
>> This example allocates too much for register regions.  Especially,
>> there are only two registers in the "nand_data" interface of this
>> hardware (ADDR: 0x00, DATA: 0x10).
>>
>> Signed-off-by: Masahiro Yamada <yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
>> ---
>>
>>   Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> b/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> index 504291d..0ee8edb 100644
>> --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt
>> @@ -29,7 +29,7 @@ nand: nand@ff900000 {
>>         #address-cells = <1>;
>>         #size-cells = <1>;
>>         compatible = "altr,socfpga-denali-nand";
>> -       reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
>> +       reg = <0xff900000 0x20>, <0xffb80000 0x1000>;
>>         reg-names = "nand_data", "denali_reg";
>>         interrupts = <0 144 4>;
>>   };
>>
> --
> 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



-- 
Best Regards
Masahiro Yamada
--
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] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
  2017-09-14  8:16     ` Masahiro Yamada
  (?)
@ 2017-09-14  9:06     ` Oleksij Rempel
  2017-09-21  5:26         ` Masahiro Yamada
  -1 siblings, 1 reply; 13+ messages in thread
From: Oleksij Rempel @ 2017-09-14  9:06 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Oleksij Rempel, Dinh Nguyen, Cyrille Pitchen,
	devicetree, Linux Kernel Mailing List, Boris Brezillon,
	Marek Vasut, Brian Norris, Richard Weinberger, David Woodhouse,
	Rob Herring, Mark Rutland

On 14.09.2017 10:16, Masahiro Yamada wrote:
> Hi.
> 
> 
> 2017-09-14 17:04 GMT+09:00 Oleksij Rempel <ore@pengutronix.de>:
>> Hi,
>>
>> i assume arch/arm/boot/dts/socfpga.dtsi should be update as well. Right?
> 
> I think so.
> (also arch/arm/boot/dts/socfpga_arria10.dtsi in the same way)

Hm.. according to
https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cyclone5_handbook.pdf
Table 13-18: NAND Controller Module Data Space Address Range

Module Instance       Start Address        End Address
NAND_DATA             0xFF900000           0xFF9FFFFF

So <0xff900000 0x100000> seems to be a proper value.

> The wrong property "dma-mask" was removed by
> commit 60d920d32ca40660e382cf9ccbc236599a49e607.
> 
> 
> 
>> On 14.09.2017 09:17, Masahiro Yamada wrote:
>>>
>>> This example allocates too much for register regions.  Especially,
>>> there are only two registers in the "nand_data" interface of this
>>> hardware (ADDR: 0x00, DATA: 0x10).
>>>
>>> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
>>> ---
>>>
>>>    Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/mtd/denali-nand.txt
>>> b/Documentation/devicetree/bindings/mtd/denali-nand.txt
>>> index 504291d..0ee8edb 100644
>>> --- a/Documentation/devicetree/bindings/mtd/denali-nand.txt
>>> +++ b/Documentation/devicetree/bindings/mtd/denali-nand.txt
>>> @@ -29,7 +29,7 @@ nand: nand@ff900000 {
>>>          #address-cells = <1>;
>>>          #size-cells = <1>;
>>>          compatible = "altr,socfpga-denali-nand";
>>> -       reg = <0xff900000 0x100000>, <0xffb80000 0x10000>;
>>> +       reg = <0xff900000 0x20>, <0xffb80000 0x1000>;
>>>          reg-names = "nand_data", "denali_reg";
>>>          interrupts = <0 144 4>;
>>>    };
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-21  5:26         ` Masahiro Yamada
  0 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-21  5:26 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: linux-mtd, Oleksij Rempel, Dinh Nguyen, Cyrille Pitchen,
	devicetree, Linux Kernel Mailing List, Boris Brezillon,
	Marek Vasut, Brian Norris, Richard Weinberger, David Woodhouse,
	Rob Herring, Mark Rutland

Hi.


2017-09-14 18:06 GMT+09:00 Oleksij Rempel <ore@pengutronix.de>:
> On 14.09.2017 10:16, Masahiro Yamada wrote:
>>
>> Hi.
>>
>>
>> 2017-09-14 17:04 GMT+09:00 Oleksij Rempel <ore@pengutronix.de>:
>>>
>>> Hi,
>>>
>>> i assume arch/arm/boot/dts/socfpga.dtsi should be update as well. Right?
>>
>>
>> I think so.
>> (also arch/arm/boot/dts/socfpga_arria10.dtsi in the same way)
>
>
> Hm.. according to
> https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cyclone5_handbook.pdf
> Table 13-18: NAND Controller Module Data Space Address Range
>
> Module Instance       Start Address        End Address
> NAND_DATA             0xFF900000           0xFF9FFFFF
>
> So <0xff900000 0x100000> seems to be a proper value.
>

The Alrera's SOCFPGA document describes so.
It is up to each SoC vendor how to describe the register space.

I am focusing on the Denali IP
because this IP is used among several SoCs.



You can see the peripheral region map
starting at page 1-18 of the document you referred to:

Slave ID      Description                  Base Addr      Size
---------------------------------------------------------------
L3REGS        L3 interconnect GPV          0xFF800000      1 MB
NANDDATA      NAND flash controller data   0xFF900000     64 KB
QSPIDATA      Quad SPI flash data          0xFFA00000      1 MB

(In the doc, the base is described as 0xFFB900000, but this is
apparently a typo.)


The rationale of the "End Address 0xFF9FFFFF" of NAND_DATA
is the fact that the base address of the next peripheral (QSPIDATA) is
0xFFA00000.




One more, if you look at the next page,

Slave ID      Description                      Base Addr     Size
---------------------------------------------------------------
NANDREGS      NAND flash controller registers   0xFFB80000   64 KB
FPGAMGRDATA   FPGA manager configuration data   0xFFB90000    4 KB


The size of NAND register space is described as 64KB,
but the rationale is just the start of the next peripheral is 0xFFB90000.

(0xFFB90000 - 0xFFB80000 = 0x10000 = 64KB)



Altera apparently reserved address space just for the purpose
of matching the end address to the base address of the next peripheral.


That means, this document specifies address region
much bigger than the IP actually provides.


If you look at page 13-6, there are only two registers
in NANDDATA space.

Table 13-4: Register Map for Indexed Addressing
Control   0x0
Data      0x10



For NANDREGS, in page 13-106, the following is the last register
in the NANDREGS space.

lun_status_cmd
Offset 0x7A0

Obviously, 0x1000 (4KB) is enough for NANDREGS.





To conclude this, this binding document was written
based on the Altera's SOCFPGA specification.

Altera specifies the region size
so that end address matches to the base of the next peripheral.
This is just a matter of SOCFPGA address mapping.

In my opinion, the binding document should not be oriented
to a particular SoC, which is not true for other SoCs.




-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-21  5:26         ` Masahiro Yamada
  0 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-21  5:26 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Oleksij Rempel,
	Dinh Nguyen, Cyrille Pitchen, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux Kernel Mailing List, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, Rob Herring,
	Mark Rutland

Hi.


2017-09-14 18:06 GMT+09:00 Oleksij Rempel <ore-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
> On 14.09.2017 10:16, Masahiro Yamada wrote:
>>
>> Hi.
>>
>>
>> 2017-09-14 17:04 GMT+09:00 Oleksij Rempel <ore-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>:
>>>
>>> Hi,
>>>
>>> i assume arch/arm/boot/dts/socfpga.dtsi should be update as well. Right?
>>
>>
>> I think so.
>> (also arch/arm/boot/dts/socfpga_arria10.dtsi in the same way)
>
>
> Hm.. according to
> https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cyclone5_handbook.pdf
> Table 13-18: NAND Controller Module Data Space Address Range
>
> Module Instance       Start Address        End Address
> NAND_DATA             0xFF900000           0xFF9FFFFF
>
> So <0xff900000 0x100000> seems to be a proper value.
>

The Alrera's SOCFPGA document describes so.
It is up to each SoC vendor how to describe the register space.

I am focusing on the Denali IP
because this IP is used among several SoCs.



You can see the peripheral region map
starting at page 1-18 of the document you referred to:

Slave ID      Description                  Base Addr      Size
---------------------------------------------------------------
L3REGS        L3 interconnect GPV          0xFF800000      1 MB
NANDDATA      NAND flash controller data   0xFF900000     64 KB
QSPIDATA      Quad SPI flash data          0xFFA00000      1 MB

(In the doc, the base is described as 0xFFB900000, but this is
apparently a typo.)


The rationale of the "End Address 0xFF9FFFFF" of NAND_DATA
is the fact that the base address of the next peripheral (QSPIDATA) is
0xFFA00000.




One more, if you look at the next page,

Slave ID      Description                      Base Addr     Size
---------------------------------------------------------------
NANDREGS      NAND flash controller registers   0xFFB80000   64 KB
FPGAMGRDATA   FPGA manager configuration data   0xFFB90000    4 KB


The size of NAND register space is described as 64KB,
but the rationale is just the start of the next peripheral is 0xFFB90000.

(0xFFB90000 - 0xFFB80000 = 0x10000 = 64KB)



Altera apparently reserved address space just for the purpose
of matching the end address to the base address of the next peripheral.


That means, this document specifies address region
much bigger than the IP actually provides.


If you look at page 13-6, there are only two registers
in NANDDATA space.

Table 13-4: Register Map for Indexed Addressing
Control   0x0
Data      0x10



For NANDREGS, in page 13-106, the following is the last register
in the NANDREGS space.

lun_status_cmd
Offset 0x7A0

Obviously, 0x1000 (4KB) is enough for NANDREGS.





To conclude this, this binding document was written
based on the Altera's SOCFPGA specification.

Altera specifies the region size
so that end address matches to the base of the next peripheral.
This is just a matter of SOCFPGA address mapping.

In my opinion, the binding document should not be oriented
to a particular SoC, which is not true for other SoCs.




-- 
Best Regards
Masahiro Yamada
--
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] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-21  6:09           ` Oleksij Rempel
  0 siblings, 0 replies; 13+ messages in thread
From: Oleksij Rempel @ 2017-09-21  6:09 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Oleksij Rempel, Dinh Nguyen, Cyrille Pitchen,
	devicetree, Linux Kernel Mailing List, Boris Brezillon,
	Marek Vasut, Brian Norris, Richard Weinberger, David Woodhouse,
	Rob Herring, Mark Rutland

Hi,

On 21.09.2017 07:26, Masahiro Yamada wrote:
> Hi.

......
>> Hm.. according to
>> https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cyclone5_handbook.pdf
>> Table 13-18: NAND Controller Module Data Space Address Range
>>
>> Module Instance       Start Address        End Address
>> NAND_DATA             0xFF900000           0xFF9FFFFF
>>
>> So <0xff900000 0x100000> seems to be a proper value.
>>
> 
> The Alrera's SOCFPGA document describes so.
> It is up to each SoC vendor how to describe the register space.
> 
> I am focusing on the Denali IP
> because this IP is used among several SoCs.
> 
> 
> 
> You can see the peripheral region map
> starting at page 1-18 of the document you referred to:
> 
> Slave ID      Description                  Base Addr      Size
> ---------------------------------------------------------------
> L3REGS        L3 interconnect GPV          0xFF800000      1 MB
> NANDDATA      NAND flash controller data   0xFF900000     64 KB
> QSPIDATA      Quad SPI flash data          0xFFA00000      1 MB
> 
> (In the doc, the base is described as 0xFFB900000, but this is
> apparently a typo.)
> 
> 
> The rationale of the "End Address 0xFF9FFFFF" of NAND_DATA
> is the fact that the base address of the next peripheral (QSPIDATA) is
> 0xFFA00000.
> 
> 
> 
> 
> One more, if you look at the next page,
> 
> Slave ID      Description                      Base Addr     Size
> ---------------------------------------------------------------
> NANDREGS      NAND flash controller registers   0xFFB80000   64 KB
> FPGAMGRDATA   FPGA manager configuration data   0xFFB90000    4 KB
> 
> 
> The size of NAND register space is described as 64KB,
> but the rationale is just the start of the next peripheral is 0xFFB90000.
> 
> (0xFFB90000 - 0xFFB80000 = 0x10000 = 64KB)
> 
> 
> 
> Altera apparently reserved address space just for the purpose
> of matching the end address to the base address of the next peripheral.
> 
> 
> That means, this document specifies address region
> much bigger than the IP actually provides.
> 
> 
> If you look at page 13-6, there are only two registers
> in NANDDATA space.
> 
> Table 13-4: Register Map for Indexed Addressing
> Control   0x0
> Data      0x10
> 
> 
> 
> For NANDREGS, in page 13-106, the following is the last register
> in the NANDREGS space.
> 
> lun_status_cmd
> Offset 0x7A0
> 
> Obviously, 0x1000 (4KB) is enough for NANDREGS.
> 
> To conclude this, this binding document was written
> based on the Altera's SOCFPGA specification.
> 
> Altera specifies the region size
> so that end address matches to the base of the next peripheral.
> This is just a matter of SOCFPGA address mapping.
> 
> In my opinion, the binding document should not be oriented
> to a particular SoC, which is not true for other SoCs.
ok. Thank you for detailed response.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-21  6:09           ` Oleksij Rempel
  0 siblings, 0 replies; 13+ messages in thread
From: Oleksij Rempel @ 2017-09-21  6:09 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Oleksij Rempel,
	Dinh Nguyen, Cyrille Pitchen, devicetree-u79uwXL29TY76Z2rM5mHXA,
	Linux Kernel Mailing List, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, Rob Herring,
	Mark Rutland

Hi,

On 21.09.2017 07:26, Masahiro Yamada wrote:
> Hi.

......
>> Hm.. according to
>> https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cyclone5_handbook.pdf
>> Table 13-18: NAND Controller Module Data Space Address Range
>>
>> Module Instance       Start Address        End Address
>> NAND_DATA             0xFF900000           0xFF9FFFFF
>>
>> So <0xff900000 0x100000> seems to be a proper value.
>>
> 
> The Alrera's SOCFPGA document describes so.
> It is up to each SoC vendor how to describe the register space.
> 
> I am focusing on the Denali IP
> because this IP is used among several SoCs.
> 
> 
> 
> You can see the peripheral region map
> starting at page 1-18 of the document you referred to:
> 
> Slave ID      Description                  Base Addr      Size
> ---------------------------------------------------------------
> L3REGS        L3 interconnect GPV          0xFF800000      1 MB
> NANDDATA      NAND flash controller data   0xFF900000     64 KB
> QSPIDATA      Quad SPI flash data          0xFFA00000      1 MB
> 
> (In the doc, the base is described as 0xFFB900000, but this is
> apparently a typo.)
> 
> 
> The rationale of the "End Address 0xFF9FFFFF" of NAND_DATA
> is the fact that the base address of the next peripheral (QSPIDATA) is
> 0xFFA00000.
> 
> 
> 
> 
> One more, if you look at the next page,
> 
> Slave ID      Description                      Base Addr     Size
> ---------------------------------------------------------------
> NANDREGS      NAND flash controller registers   0xFFB80000   64 KB
> FPGAMGRDATA   FPGA manager configuration data   0xFFB90000    4 KB
> 
> 
> The size of NAND register space is described as 64KB,
> but the rationale is just the start of the next peripheral is 0xFFB90000.
> 
> (0xFFB90000 - 0xFFB80000 = 0x10000 = 64KB)
> 
> 
> 
> Altera apparently reserved address space just for the purpose
> of matching the end address to the base address of the next peripheral.
> 
> 
> That means, this document specifies address region
> much bigger than the IP actually provides.
> 
> 
> If you look at page 13-6, there are only two registers
> in NANDDATA space.
> 
> Table 13-4: Register Map for Indexed Addressing
> Control   0x0
> Data      0x10
> 
> 
> 
> For NANDREGS, in page 13-106, the following is the last register
> in the NANDREGS space.
> 
> lun_status_cmd
> Offset 0x7A0
> 
> Obviously, 0x1000 (4KB) is enough for NANDREGS.
> 
> To conclude this, this binding document was written
> based on the Altera's SOCFPGA specification.
> 
> Altera specifies the region size
> so that end address matches to the base of the next peripheral.
> This is just a matter of SOCFPGA address mapping.
> 
> In my opinion, the binding document should not be oriented
> to a particular SoC, which is not true for other SoCs.
ok. Thank you for detailed response.
--
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] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
  2017-09-21  6:09           ` Oleksij Rempel
  (?)
@ 2017-09-21 11:10           ` Masahiro Yamada
  -1 siblings, 0 replies; 13+ messages in thread
From: Masahiro Yamada @ 2017-09-21 11:10 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: Mark Rutland, devicetree, Richard Weinberger, Dinh Nguyen,
	Boris Brezillon, Linux Kernel Mailing List, Oleksij Rempel,
	Rob Herring, linux-mtd, Cyrille Pitchen, Brian Norris,
	David Woodhouse, Marek Vasut

2017-09-21 15:09 GMT+09:00 Oleksij Rempel <ore@pengutronix.de>:
> Hi,
>
> On 21.09.2017 07:26, Masahiro Yamada wrote:
>>
>> Hi.
>
>
> ......
>
>>> Hm.. according to
>>>
>>> https://www.altera.com/en_US/pdfs/literature/hb/cyclone-v/cyclone5_handbook.pdf
>>> Table 13-18: NAND Controller Module Data Space Address Range
>>>
>>> Module Instance       Start Address        End Address
>>> NAND_DATA             0xFF900000           0xFF9FFFFF
>>>
>>> So <0xff900000 0x100000> seems to be a proper value.
>>>
>>
>> The Alrera's SOCFPGA document describes so.
>> It is up to each SoC vendor how to describe the register space.
>>
>> I am focusing on the Denali IP
>> because this IP is used among several SoCs.
>>
>>
>>
>> You can see the peripheral region map
>> starting at page 1-18 of the document you referred to:
>>
>> Slave ID      Description                  Base Addr      Size
>> ---------------------------------------------------------------
>> L3REGS        L3 interconnect GPV          0xFF800000      1 MB
>> NANDDATA      NAND flash controller data   0xFF900000     64 KB
>> QSPIDATA      Quad SPI flash data          0xFFA00000      1 MB
>>
>> (In the doc, the base is described as 0xFFB900000, but this is
>> apparently a typo.)
>>
>>
>> The rationale of the "End Address 0xFF9FFFFF" of NAND_DATA
>> is the fact that the base address of the next peripheral (QSPIDATA) is
>> 0xFFA00000.
>>
>>
>>
>>
>> One more, if you look at the next page,
>>
>> Slave ID      Description                      Base Addr     Size
>> ---------------------------------------------------------------
>> NANDREGS      NAND flash controller registers   0xFFB80000   64 KB
>> FPGAMGRDATA   FPGA manager configuration data   0xFFB90000    4 KB
>>
>>
>> The size of NAND register space is described as 64KB,
>> but the rationale is just the start of the next peripheral is 0xFFB90000.
>>
>> (0xFFB90000 - 0xFFB80000 = 0x10000 = 64KB)
>>
>>
>>
>> Altera apparently reserved address space just for the purpose
>> of matching the end address to the base address of the next peripheral.
>>
>>
>> That means, this document specifies address region
>> much bigger than the IP actually provides.
>>
>>
>> If you look at page 13-6, there are only two registers
>> in NANDDATA space.
>>
>> Table 13-4: Register Map for Indexed Addressing
>> Control   0x0
>> Data      0x10
>>
>>
>>
>> For NANDREGS, in page 13-106, the following is the last register
>> in the NANDREGS space.
>>
>> lun_status_cmd
>> Offset 0x7A0
>>
>> Obviously, 0x1000 (4KB) is enough for NANDREGS.
>>
>> To conclude this, this binding document was written
>> based on the Altera's SOCFPGA specification.
>>
>> Altera specifies the region size
>> so that end address matches to the base of the next peripheral.
>> This is just a matter of SOCFPGA address mapping.
>>
>> In my opinion, the binding document should not be oriented
>> to a particular SoC, which is not true for other SoCs.
>
> ok. Thank you for detailed response.



BTW, I am not forcing you to change the SOCFPGA DTS.
It is up to you and Dihn whether change it or not.

I do not have any SOCFPGA board.



-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-21 22:55   ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2017-09-21 22:55 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd, Oleksij Rempel, Dinh Nguyen, Cyrille Pitchen,
	devicetree, linux-kernel, Boris Brezillon, Marek Vasut,
	Brian Norris, Richard Weinberger, David Woodhouse, Mark Rutland

On Thu, Sep 14, 2017 at 04:17:36PM +0900, Masahiro Yamada wrote:
> This example allocates too much for register regions.  Especially,
> there are only two registers in the "nand_data" interface of this
> hardware (ADDR: 0x00, DATA: 0x10).
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> 
>  Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] dt-bindings: nand: denali: reduce the register space in the example
@ 2017-09-21 22:55   ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2017-09-21 22:55 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Oleksij Rempel,
	Dinh Nguyen, Cyrille Pitchen, devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, Boris Brezillon,
	Marek Vasut, Brian Norris, Richard Weinberger, David Woodhouse,
	Mark Rutland

On Thu, Sep 14, 2017 at 04:17:36PM +0900, Masahiro Yamada wrote:
> This example allocates too much for register regions.  Especially,
> there are only two registers in the "nand_data" interface of this
> hardware (ADDR: 0x00, DATA: 0x10).
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro-uWyLwvC0a2jby3iVrkZq2A@public.gmane.org>
> ---
> 
>  Documentation/devicetree/bindings/mtd/denali-nand.txt | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
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] 13+ messages in thread

end of thread, other threads:[~2017-09-21 22:55 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-14  7:17 [PATCH] dt-bindings: nand: denali: reduce the register space in the example Masahiro Yamada
2017-09-14  7:17 ` Masahiro Yamada
2017-09-14  8:04 ` Oleksij Rempel
2017-09-14  8:16   ` Masahiro Yamada
2017-09-14  8:16     ` Masahiro Yamada
2017-09-14  9:06     ` Oleksij Rempel
2017-09-21  5:26       ` Masahiro Yamada
2017-09-21  5:26         ` Masahiro Yamada
2017-09-21  6:09         ` Oleksij Rempel
2017-09-21  6:09           ` Oleksij Rempel
2017-09-21 11:10           ` Masahiro Yamada
2017-09-21 22:55 ` Rob Herring
2017-09-21 22:55   ` Rob Herring

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.