Skip to contentSkip to conversation

dts: socfpga: Add bindings for Altera SoC SDRAM controller

PATCH In review [email protected] 2 participants 8 messages Mar 31, 2014 – Apr 2, 2014 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore
#1 lore raw

PATCH 1/2 dts: socfpga: Add bindings for Altera SoC SDRAM controller

In reply to a message not in the archive

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller bindings and device tree changes to the Altera SoC project.

To: Rob Herring <[email protected]>
To: Pawel Moll <[email protected]>
To: Mark Rutland <[email protected]>
To: Ian Campbell <[email protected]>
To: Kumar Gala <[email protected]>
To: Rob Landley <[email protected]>
To: Russell King <[email protected]>
To: Dinh Nguyen <[email protected]>
Cc: devicetree at vger.kernel.org
Cc: linux-doc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

---
 .../bindings/arm/altera/socfpga-sdram.txt          |   14 ++++++++++++++
 arch/arm/boot/dts/socfpga.dtsi                     |    5 +++++
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +14 -0
new file mode 100644
index 0000000..351ab7b
@@ -0,0 +1,14 @@
+Altera SOCFPGA SDRAM Controller
+
+Required properties:
+- compatible : "altr,sdr-ctl", "syscon";
+                Note that syscon is invoked for this device to support the FPGA
+		bridge driver and possibly other devices in the future.  See
+		also Documentation/devicetree/bindings/mfd/syscon.txt
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+	sdrctl at 0xffc25000 {
+		compatible = "altr,sdr-ctl", "syscon";
+		reg = <0xffc25000 0x1000>;
+	};
arch/arm/boot/dts/socfpga.dtsi +5 -0
index 9e78c1d..3634de7 100644
@@ -528,6 +528,11 @@
 			reg-io-width = <4>;
 		};
 
+		sdrctl at 0xffc25000 {
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0xffc25000 0x1000>;
+		};
+
 		rstmgr at ffd05000 {
 			compatible = "altr,rst-mgr";
 			reg = <0xffd05000 0x1000>;
Signature · 1 line
1.7.9.5
#6 lore raw

PATCH 2/2 arm: socfpga: Add support for Altera SoC SDRAM controller

In reply to a message not in the archive

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller registers to the Altera SoC project. These registers are shared by future drivers such as ECC and the FPGA bridge.

To: Rob Herring <[email protected]>
To: Pawel Moll <[email protected]>
To: Mark Rutland <[email protected]>
To: Ian Campbell <[email protected]>
To: Kumar Gala <[email protected]>
To: Rob Landley <[email protected]>
To: Russell King <[email protected]>
To: Dinh Nguyen <[email protected]>
Cc: devicetree at vger.kernel.org
Cc: linux-doc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

---
 arch/arm/mach-socfpga/socfpga.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-socfpga/socfpga.c +10 -0
index 21d6026..d514e8a 100644
@@ -32,6 +32,7 @@
 void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE));
 void __iomem *sys_manager_base_addr;
 void __iomem *rst_manager_base_addr;
+void __iomem *sdr_ctl_base_addr;
 void __iomem *clk_mgr_base_addr;
 unsigned long cpu1start_addr;
 
@@ -150,6 +151,15 @@ void __init socfpga_sysmgr_init(void)
 
 	np = of_find_compatible_node(NULL, NULL, "altr,clk-mgr");
 	clk_mgr_base_addr = of_iomap(np, 0);
+
+	np = of_find_compatible_node(NULL, NULL, "altr,sdr-ctl");
+	if (!np) {
+		pr_err("SOCFPGA: Unable to find sdr-ctl\n");
+		return;
+	}
+
+	sdr_ctl_base_addr = of_iomap(np, 0);
+	WARN_ON(!sdr_ctl_base_addr);
 }
 
 static void __init socfpga_init_irq(void)
Signature · 1 line
1.7.9.5
#2 lore raw
In reply to [email protected]

Hi!

Quoted 30 lines · tthayer at altera.com

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller bindings and device tree changes to the Altera SoC project.

To: Rob Herring <[email protected]>
To: Pawel Moll <[email protected]>
To: Mark Rutland <[email protected]>
To: Ian Campbell <[email protected]>
To: Kumar Gala <[email protected]>
To: Rob Landley <[email protected]>
To: Russell King <[email protected]>
To: Dinh Nguyen <[email protected]>
Cc: devicetree at vger.kernel.org
Cc: linux-doc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

---
 .../bindings/arm/altera/socfpga-sdram.txt          |   14 ++++++++++++++
 arch/arm/boot/dts/socfpga.dtsi                     |    5 +++++
 2 files changed, 19 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +0 -0
new file mode 100644
index 0000000..351ab7b

Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt line 7

Quoted 7 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +7 -0
@@ -0,0 +1,14 @@
+Altera SOCFPGA SDRAM Controller
+
+Required properties:
+- compatible : "altr,sdr-ctl", "syscon";
+                Note that syscon is invoked for this device to support the FPGA
+		bridge driver and possibly other devices in the future.  See
+		also Documentation/devicetree/bindings/mfd/syscon.txt

This note is really linux specific (and specific to some vendor kernel driver for that matter). I think you should remove that.

Quoted 13 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +7 -0
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+	sdrctl at 0xffc25000 {
+		compatible = "altr,sdr-ctl", "syscon";
+		reg = <0xffc25000 0x1000>;
+	};
arch/arm/boot/dts/socfpga.dtsi +0 -0
index 9e78c1d..3634de7 100644
@@ -528,6 +528,11 @@
 			reg-io-width = <4>;

arch/arm/boot/dts/socfpga.dtsi line 538

Quoted 10 lines
arch/arm/boot/dts/socfpga.dtsi +5 -0
 		};
 
+		sdrctl at 0xffc25000 {
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0xffc25000 0x1000>;
+		};
+
 		rstmgr at ffd05000 {
 			compatible = "altr,rst-mgr";
 			reg = <0xffd05000 0x1000>;

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#7 lore raw

Re: [PATCH 2/2] arm: socfpga: Add support for Altera SoC SDRAM controller

In reply to [email protected]
Quoted 28 lines · tthayer at altera.com

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller registers to the Altera SoC project. These registers are shared by future drivers such as ECC and the FPGA bridge.

To: Rob Herring <[email protected]>
To: Pawel Moll <[email protected]>
To: Mark Rutland <[email protected]>
To: Ian Campbell <[email protected]>
To: Kumar Gala <[email protected]>
To: Rob Landley <[email protected]>
To: Russell King <[email protected]>
To: Dinh Nguyen <[email protected]>
Cc: devicetree at vger.kernel.org
Cc: linux-doc at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org

---
 arch/arm/mach-socfpga/socfpga.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/mach-socfpga/socfpga.c +0 -0
index 21d6026..d514e8a 100644

arch/arm/mach-socfpga/socfpga.c line 38

Quoted 7 lines
arch/arm/mach-socfpga/socfpga.c +1 -0
@@ -32,6 +32,7 @@
 void __iomem *socfpga_scu_base_addr = ((void __iomem *)(SOCFPGA_SCU_VIRT_BASE));
 void __iomem *sys_manager_base_addr;
 void __iomem *rst_manager_base_addr;
+void __iomem *sdr_ctl_base_addr;
 void __iomem *clk_mgr_base_addr;
 unsigned long cpu1start_addr;
 

Can't we get rid of all these global pointers instead of adding to them?

Quoted 19 lines
arch/arm/mach-socfpga/socfpga.c +9 -0
@@ -150,6 +151,15 @@ void __init socfpga_sysmgr_init(void)
 
 	np = of_find_compatible_node(NULL, NULL, "altr,clk-mgr");
 	clk_mgr_base_addr = of_iomap(np, 0);
+
+	np = of_find_compatible_node(NULL, NULL, "altr,sdr-ctl");
+	if (!np) {
+		pr_err("SOCFPGA: Unable to find sdr-ctl\n");
+		return;
+	}
+
+	sdr_ctl_base_addr = of_iomap(np, 0);
+	WARN_ON(!sdr_ctl_base_addr);
 }
 
 static void __init socfpga_init_irq(void)
Signature · 1 line
1.7.9.5
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#8 lore raw

Re: [PATCH 2/2] arm: socfpga: Add support for Altera SoC SDRAM controller

Quoted 3 lines · Steffen Trumtrar
Quoted 2 lines · On Mon, Mar 31, 2014 at 05:07:07PM -0500, [email protected] wrote:

From: Thor Thayer <[email protected]>

<snip>

Quoted 3 lines
Quoted 1 line

Can't we get rid of all these global pointers instead of adding to them?

Yes. I will remove this file from the patch. Thanks.

Quoted 21 lines
Quoted 20 lines
arch/arm/mach-socfpga/socfpga.c +9 -0
@@ -150,6 +151,15 @@ void __init socfpga_sysmgr_init(void)
 
 	np = of_find_compatible_node(NULL, NULL, "altr,clk-mgr");
 	clk_mgr_base_addr = of_iomap(np, 0);
+
+	np = of_find_compatible_node(NULL, NULL, "altr,sdr-ctl");
+	if (!np) {
+		pr_err("SOCFPGA: Unable to find sdr-ctl\n");
+		return;
+	}
+
+	sdr_ctl_base_addr = of_iomap(np, 0);
+	WARN_ON(!sdr_ctl_base_addr);
 }
 
 static void __init socfpga_init_irq(void)
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Steffen Trumtrar
Quoted 8 lines · Steffen Trumtrar

Hi!

Quoted 5 lines · On Mon, Mar 31, 2014 at 05:07:06PM -0500, [email protected] wrote:

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller bindings and device tree changes to the Altera SoC project.

<snip>

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +2 -0
new file mode 100644
index 0000000..351ab7b
@@ -0,0 +1,14 @@
+Altera SOCFPGA SDRAM Controller
+
Quoted 8 lines

Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt line 7

Quoted 5 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +5 -0
+Required properties:
+- compatible : "altr,sdr-ctl", "syscon";
+                Note that syscon is invoked for this device to support the FPGA
+		bridge driver and possibly other devices in the future.  See
+		also Documentation/devicetree/bindings/mfd/syscon.txt

This note is really linux specific (and specific to some vendor kernel driver for that matter). I think you should remove that.

Hi Steffen. Are you asking for the path to syscon.txt to be removed or the entire note?
The note is explaining why the "syscon" tag is used for this Altera IP block (registers shared between multiple drivers).
Thanks for the clarification.

Quoted 28 lines
Quoted 14 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +7 -0
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+	sdrctl@0xffc25000 {
+		compatible = "altr,sdr-ctl", "syscon";
+		reg = <0xffc25000 0x1000>;
+	};
arch/arm/boot/dts/socfpga.dtsi +0 -0
index 9e78c1d..3634de7 100644
@@ -528,6 +528,11 @@
 			reg-io-width = <4>;

arch/arm/boot/dts/socfpga.dtsi line 538

Quoted 10 lines
arch/arm/boot/dts/socfpga.dtsi +5 -0
 		};
 
+		sdrctl@0xffc25000 {
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0xffc25000 0x1000>;
+		};
+
 		rstmgr@ffd05000 {
 			compatible = "altr,rst-mgr";
 			reg = <0xffd05000 0x1000>;

Regards,
Steffen

#4 lore raw

Hi!

Quoted 29 lines · Thor Thayer - Sendmail
Quoted 8 lines · Steffen Trumtrar

Hi!

Quoted 5 lines · tthayer at altera.com

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller bindings and device tree changes to the Altera SoC project.

<snip>

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +2 -0
new file mode 100644
index 0000000..351ab7b
@@ -0,0 +1,14 @@
+Altera SOCFPGA SDRAM Controller
+
Quoted 8 lines

Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt line 7

Quoted 5 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +5 -0
+Required properties:
+- compatible : "altr,sdr-ctl", "syscon";
+                Note that syscon is invoked for this device to support the FPGA
+		bridge driver and possibly other devices in the future.  See
+		also Documentation/devicetree/bindings/mfd/syscon.txt

This note is really linux specific (and specific to some vendor kernel driver for that matter). I think you should remove that.

Quoted 6 lines

Hi Steffen. Are you asking for the path to syscon.txt to be removed or the entire note?
The note is explaining why the "syscon" tag is used for this Altera IP block (registers shared between multiple drivers).
Thanks for the clarification.

I was referring to the note. I don't know what the current guideline is for this type of "devices", but I think referring to the syscon documentation is okay.
The first part however describes a DT binding with things that might or might not happen in the future. What I want to say is, I would rather have this reworded, to have it just describe the SDRAM controller node as simple as it may be.

Quoted 16 lines
Quoted 16 lines
Quoted 16 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +7 -0
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+	sdrctl at 0xffc25000 {
+		compatible = "altr,sdr-ctl", "syscon";
+		reg = <0xffc25000 0x1000>;
+	};
arch/arm/boot/dts/socfpga.dtsi +0 -0
index 9e78c1d..3634de7 100644
@@ -528,6 +528,11 @@
 			reg-io-width = <4>;
 		};
 
Quoted 1 line
Quoted 1 line

arch/arm/boot/dts/socfpga.dtsi line 531

Quoted 1 line
arch/arm/boot/dts/socfpga.dtsi +1 -0
+		sdrctl at 0xffc25000 {
                       ^^

Oh, and Dinh just mentioned in my patch, that the 0x shall be removed here. But I'm not so sure about that. Just FYI.

Quoted 7 lines
Quoted 7 lines

arch/arm/boot/dts/socfpga.dtsi line 538

Quoted 7 lines
arch/arm/boot/dts/socfpga.dtsi +4 -0
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0xffc25000 0x1000>;
+		};
+
 		rstmgr at ffd05000 {
 			compatible = "altr,rst-mgr";
 			reg = <0xffd05000 0x1000>;

Regards,
Steffen

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#5 lore raw
Quoted 39 lines · Steffen Trumtrar

Hi!

Quoted 29 lines · Thor Thayer - Sendmail
Quoted 8 lines · Steffen Trumtrar

Hi!

Quoted 5 lines · On Mon, Mar 31, 2014 at 05:07:06PM -0500, [email protected] wrote:

From: Thor Thayer <[email protected]>

Addition of the Altera SDRAM controller bindings and device tree changes to the Altera SoC project.

<snip>

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +2 -0
new file mode 100644
index 0000000..351ab7b
@@ -0,0 +1,14 @@
+Altera SOCFPGA SDRAM Controller
+
Quoted 8 lines

Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt line 7

Quoted 5 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +5 -0
+Required properties:
+- compatible : "altr,sdr-ctl", "syscon";
+                Note that syscon is invoked for this device to support the FPGA
+		bridge driver and possibly other devices in the future.  See
+		also Documentation/devicetree/bindings/mfd/syscon.txt

This note is really linux specific (and specific to some vendor kernel driver for that matter). I think you should remove that.

Quoted 6 lines

Hi Steffen. Are you asking for the path to syscon.txt to be removed or the entire note?
The note is explaining why the "syscon" tag is used for this Altera IP block (registers shared between multiple drivers).
Thanks for the clarification.

Quoted 7 lines

I was referring to the note. I don't know what the current guideline is for this type of "devices", but I think referring to the syscon documentation is okay.
The first part however describes a DT binding with things that might or might not happen in the future. What I want to say is, I would rather have this reworded, to have it just describe the SDRAM controller node as simple as it may be.

I see the confusion. It was not written well. I'll abandon this patch.

I have another patch series ready that uses the "syscon" parameter of the SDRAM controller so I'll include this patch in that series. The need for the "syscon" will be more apparent. Thanks!

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/arm/altera/socfpga-sdram.txt new file +7 -0
+- reg : Should contain 1 register ranges(address and length)
+
+Example:
+	sdrctl@0xffc25000 {
+		compatible = "altr,sdr-ctl", "syscon";
+		reg = <0xffc25000 0x1000>;
+	};
arch/arm/boot/dts/socfpga.dtsi +0 -0
index 9e78c1d..3634de7 100644
@@ -528,6 +528,11 @@
 			reg-io-width = <4>;
 		};
 
Quoted 5 lines
Quoted 1 line
Quoted 1 line

arch/arm/boot/dts/socfpga.dtsi line 531

Quoted 1 line
arch/arm/boot/dts/socfpga.dtsi +1 -0
+		sdrctl@0xffc25000 {
                       ^^

Oh, and Dinh just mentioned in my patch, that the 0x shall be removed here. But I'm not so sure about that. Just FYI.

Thanks.

Quoted 11 lines
Quoted 7 lines
Quoted 7 lines

arch/arm/boot/dts/socfpga.dtsi line 538

Quoted 7 lines
arch/arm/boot/dts/socfpga.dtsi +4 -0
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0xffc25000 0x1000>;
+		};
+
 		rstmgr@ffd05000 {
 			compatible = "altr,rst-mgr";
 			reg = <0xffd05000 0x1000>;

Regards,
Steffen