Skip to contentSkip to conversation

dt: device tree bindings and data for EMIF and DDR

RFC PATCH Superseded Aneesh V 2 participants 8 messages Jan 19, 2012 – Jan 21, 2012

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Aneesh V

author
#0 lore raw

v3 cover dt: device tree bindings and data for EMIF and DDR

This is an RFC to add new device tree bindings for DDR memories and EMIF - TI's DDR SDRAM controller.

The first patch adds bindings for LPDDR2 memories.

Second patch provides the bindings for the EMIF controller.

The final patch provides DT data for EMIF controller instances in OMAP4 and LPDDR2 memories attached to them on various boards.

Thanks to Rajendra for answering my numerous queries on device tree.

Changes in RFC v3:
* Removed support for DDR3
* Incorporated review comments from Olof

Aneesh V (3):
dt: device tree bindings for DDR memories
dt: device tree bindings for TI's EMIF sdram controller arm/dts: EMIF and lpddr2 device tree data for OMAP4 boards

 .../devicetree/bindings/lpddr2/lpddr2-timings.txt  |   51 ++++++++++
 .../devicetree/bindings/lpddr2/lpddr2.txt          |  102 ++++++++++++++++++++
 .../bindings/memory-controllers/ti/emif.txt        |   49 ++++++++++
 arch/arm/boot/dts/elpida_ecb240abacn.dtsi          |   65 +++++++++++++
 arch/arm/boot/dts/omap4-panda.dts                  |   13 +++
 arch/arm/boot/dts/omap4-sdp.dts                    |   13 +++
 arch/arm/boot/dts/omap4.dtsi                       |   19 ++++
 7 files changed, 312 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
 create mode 100644 Documentation/devicetree/bindings/lpddr2/lpddr2.txt
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
 create mode 100644 arch/arm/boot/dts/elpida_ecb240abacn.dtsi
author
#1 lore raw

RFC PATCH v3 1/3 dt: device tree bindings for DDR memories

device tree bindings for LPDDR2 SDRAM memories compliant to JESD209-2 standard.

The 'lpddr2' binding in-turn uses another binding 'lpddr2-timings' for specifying the AC timing parameters of the memory device at different speed-bins.

Cc Rajendra Nayak <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Olof Johansson <[email protected]>

Changes in RFC v2:
* Removed the "manufacturer" property and added it in compatible property instead
* Changed the DDR device names in example to indicate the part number

Changes in RFC v3:
* Removed DDR3 support
* Fixed review comments on RFC v2

---
 .../devicetree/bindings/lpddr2/lpddr2-timings.txt  |   51 ++++++++++
 .../devicetree/bindings/lpddr2/lpddr2.txt          |  102 ++++++++++++++++++++
 2 files changed, 153 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt
 create mode 100644 Documentation/devicetree/bindings/lpddr2/lpddr2.txt
Documentation/devicetree/bindings/lpddr2/lpddr2-timings.txt new file +51 -0
new file mode 100644
index 0000000..1483841
@@ -0,0 +1,51 @@
+* AC timing parameters of LPDDR2(JESD209-2) memories for a given speed-bin
+
+Required properties:
+- compatible : Should be "jedec,lpddr2-timings"
+- min-freq : minimum DDR clock frequency for the speed-bin. Type is <u32>
+- max-freq : maximum DDR clock frequency for the speed-bin. Type is <u32>
+
+Optional properties:
+
+The following properties represent AC timing parameters from the memory
+data-sheet of the device for a given speed-bin. All these properties are
+of type <u32> and the default unit is ps (pico seconds). Parameters with
+a different unit have a suffix indicating the unit such as 'tRAS-max-ns'
+- tRCD
+- tWR
+- tRAS-min
+- tRRD
+- tWTR
+- tXP
+- tRTP
+- tDQSCK-max
+- tFAW
+- tZQCS
+- tZQinit
+- tRPab
+- tZQCL
+- tCKESR
+- tRAS-max-ns
+
+Example:
+
+timings_elpida_ECB240ABACN_400mhz: lpddr2-timings at 0 {
+	compatible 	= "jedec,lpddr2-timings";
+	min-freq	= <10000000>;
+	max-freq	= <400000000>;
+	tRPab		= <21000>;
+	tRCD		= <18000>;
+	tWR		= <15000>;
+	tRAS-min	= <42000>;
+	tRRD		= <10000>;
+	tWTR		= <7500>;
+	tXP		= <7500>;
+	tRTP		= <7500>;
+	tCKESR		= <15000>;
+	tDQSCK-max 	= <5500>;
+	tFAW		= <50000>;
+	tZQCS		= <90000>;
+	tZQCL		= <360000>;
+	tZQinit		= <1000000>;
+	tRAS-max-ns	= <70000>;
+};
Documentation/devicetree/bindings/lpddr2/lpddr2.txt new file +102 -0

102 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

RFC PATCH v3 1/3 dt: device tree bindings for DDR memories

Hi,

Sorry for the delay in responding, I know you pinged me about it yesterday.

Quoted 6 lines · Aneesh V

device tree bindings for LPDDR2 SDRAM memories compliant to JESD209-2 standard.

The 'lpddr2' binding in-turn uses another binding 'lpddr2-timings' for specifying the AC timing parameters of the memory device at different speed-bins.

As I just commented on the thread with Mike, I think we would be better off sticking to embedding a standard JEDEC SPD structure in the device tree. It's not large (128-256 bytes depending on memory type), and it's clearly defined and used all over the industry.

It also has the benefit of reusing parsing code if you ever end up with a system that uses DIMMs for memory, thus needing to parse the SPD on said modules.

-Olof

author
#3 lore raw

RFC PATCH v3 1/3 dt: device tree bindings for DDR memories

Hi Olof,

Quoted 12 lines · Olof Johansson

Hi,

Sorry for the delay in responding, I know you pinged me about it yesterday.

Quoted 6 lines · Aneesh V

device tree bindings for LPDDR2 SDRAM memories compliant to JESD209-2 standard.

The 'lpddr2' binding in-turn uses another binding 'lpddr2-timings' for specifying the AC timing parameters of the memory device at different speed-bins.

Quoted 8 lines

As I just commented on the thread with Mike, I think we would be better off sticking to embedding a standard JEDEC SPD structure in the device tree. It's not large (128-256 bytes depending on memory type), and it's clearly defined and used all over the industry.

It also has the benefit of reusing parsing code if you ever end up with a system that uses DIMMs for memory, thus needing to parse the SPD on said modules.

I did mention in the previous thread why SPD doesn't work for us ([1] and [2]). Let me repeat the key points here.

1. I couldn't find an SPD addendum for LPDDR2 from the JEDEC website.
2. This seems to indicate that SPD is not used for LPDDR2 devices.
3. I tried to see if I can fit the DDR3 or DDR2 SPD for our needs. But some of the AC timing parameters needed by our controller are not available in those layouts.

I don't see any option other than defining a new binding for LPDDR2.

br,
Aneesh

[1] http://www.mail-archive.com/linux-omap at vger.kernel.org/msg61250.html
[2] http://www.mail-archive.com/linux-omap at vger.kernel.org/msg60473.html

#4 lore raw

RFC PATCH v3 1/3 dt: device tree bindings for DDR memories

Quoted 25 lines · Aneesh V

Hi Olof,

Quoted 21 lines · Olof Johansson

Hi,

Sorry for the delay in responding, I know you pinged me about it yesterday.

Quoted 7 lines · On Thu, Jan 19, 2012 at 6:31 AM, Aneesh V<[email protected]> ?wrote:

device tree bindings for LPDDR2 SDRAM memories compliant to JESD209-2 standard.

The 'lpddr2' binding in-turn uses another binding 'lpddr2-timings' for specifying the AC timing parameters of the memory device at different speed-bins.

As I just commented on the thread with Mike, I think we would be better off sticking to embedding a standard JEDEC SPD structure in the device tree. It's not large (128-256 bytes depending on memory type), and it's clearly defined and used all over the industry.

Quoted 7 lines
Quoted 3 lines

It also has the benefit of reusing parsing code if you ever end up with a system that uses DIMMs for memory, thus needing to parse the SPD on said modules.

I did mention in the previous thread why SPD doesn't work for us ([1] and [2]). Let me repeat the key points here.

Ah, sorry. Missed it in the chain of replies.

Quoted 2 lines

1. I couldn't find an SPD addendum for LPDDR2 from the JEDEC website.
2. This seems to indicate that SPD is not used for LPDDR2 devices.

Bummer. I'm guessing most applications where LPDDR* is used won't be suitable for modular memory, so there's not the same need for SPD.

Quoted 3 lines

3. I tried to see if I can fit the DDR3 or DDR2 SPD for our needs. But some of the AC timing parameters needed by our controller are not available in those layouts.

Are those properties of the memory, or a combination of memory and board properties? I think it still makes sense for the memories that do have it to use the SPD format and extend with additional properties, at least if it's only a few additional properties needed.

Quoted 1 line

I don't see any option other than defining a new binding for LPDDR2.

Yeah, agreed.

-Olof

author
#5 lore raw

RFC PATCH v3 1/3 dt: device tree bindings for DDR memories

Quoted 42 lines · Olof Johansson
Quoted 25 lines · Aneesh V

Hi Olof,

Quoted 21 lines · Olof Johansson

Hi,

Sorry for the delay in responding, I know you pinged me about it yesterday.

Quoted 7 lines · Aneesh V

device tree bindings for LPDDR2 SDRAM memories compliant to JESD209-2 standard.

The 'lpddr2' binding in-turn uses another binding 'lpddr2-timings' for specifying the AC timing parameters of the memory device at different speed-bins.

As I just commented on the thread with Mike, I think we would be better off sticking to embedding a standard JEDEC SPD structure in the device tree. It's not large (128-256 bytes depending on memory type), and it's clearly defined and used all over the industry.

Quoted 7 lines
Quoted 3 lines

It also has the benefit of reusing parsing code if you ever end up with a system that uses DIMMs for memory, thus needing to parse the SPD on said modules.

I did mention in the previous thread why SPD doesn't work for us ([1] and [2]). Let me repeat the key points here.

Ah, sorry. Missed it in the chain of replies.

Quoted 2 lines

1. I couldn't find an SPD addendum for LPDDR2 from the JEDEC website.
2. This seems to indicate that SPD is not used for LPDDR2 devices.

Bummer. I'm guessing most applications where LPDDR* is used won't be suitable for modular memory, so there's not the same need for SPD.

Quoted 8 lines
Quoted 3 lines

3. I tried to see if I can fit the DDR3 or DDR2 SPD for our needs. But some of the AC timing parameters needed by our controller are not available in those layouts.

Are those properties of the memory, or a combination of memory and board properties? I think it still makes sense for the memories that do have it to use the SPD format and extend with additional properties, at least if it's only a few additional properties needed.

They are AC timing parameters defined by the spec such as tCKESR, tFAW etc, nothing specific to OMAP.

As for other memories, we do not intend to support any at the moment. In my initial version I had bindings for DDR3, because we intended to have DDR3 support in the driver. But we have since decided to drop DDR3 support for the following reasons:

1. According to the DDR3 spec, the operating frequency range for the speed-bins is limited (unlike LPDDR2). Scaling DDR frequency in this small range doesn't make sense for us (this may be the case for other platforms too).

2. Unlike LPDDR2, DDR3 doesn't have a mechanism for polling the temperature from the device and derate timings.

If DVFS and thermal handling are not relevant for DDR3, having a kernel driver doesn't make sense. One-time settings in the bootloader are good enough.

So, I have made my binding only for LPDDR2 and removed DDR3 parts from it.

Quoted 4 lines
Quoted 2 lines

I don't see any option other than defining a new binding for LPDDR2.

Yeah, agreed.

Thanks,
Aneesh

author
#6 lore raw

RFC PATCH v3 2/3 dt: device tree bindings for TI's EMIF sdram controller

In reply to Aneesh V

EMIF - External Memory Interface - is an SDRAM controller used in TI SoCs. EMIF supports, based on the IP revision, one or more of DDR2/DDR3/LPDDR2 protocols. This binding describes a given instance of the EMIF IP and memory parts attached to it.

Cc Rajendra Nayak <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Olof Johansson <[email protected]>

---
Changes in RFC v3:
* Fixed review comments from RFC v2

---
 .../bindings/memory-controllers/ti/emif.txt        |   49 ++++++++++++++++++++
 1 files changed, 49 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/memory-controllers/ti/emif.txt
Documentation/devicetree/bindings/memory-controllers/ti/emif.txt new file +49 -0
new file mode 100644
index 0000000..2925add
@@ -0,0 +1,49 @@
+* EMIF family of TI SDRAM controllers
+
+EMIF - External Memory Interface - is an SDRAM controller used in
+TI SoCs. EMIF supports, based on the IP revision, one or more of
+DDR2/DDR3/LPDDR2 protocols. This binding describes a given instance
+of the EMIF IP and memory parts attached to it.
+
+Required properties:
+- compatible	: Should be of the form "ti,emif-<ip-rev>" where <ip-rev>
+  is the IP revision of the specific EMIF instance.
+
+- phy-type	: <u32> indicating the DDR phy type. Following are the
+  allowed values
+  <1>	: Attila PHY
+  <2>	: Intelli PHY
+
+- device-handle	: phandle to a "lpddr2" node representing the memory part
+  attached to this EMIF instance.
+
+Optional properties:
+- cs1-used		: Have this property if CS1 of this EMIF
+  instance has a memory part attached to it. If there is a memory
+  part attached to CS1, it should be the same type as the one on CS0,
+  so there is no need to give the details of this memory part.
+
+- cal-resistor-per-cs	: Have this property if the board has one
+  calibration resistor per chip-select.
+
+- hw-caps-read-idle-ctrl: Have this property if the controller
+  supports read idle window programming
+
+- hw-caps-ll-interface	: Have this property if the controller
+  has a low latency interface and corresponding interrupt events
+
+- hw-caps-temp-alert	: Have this property if the controller
+  has capability for generating SDRAM temperature alerts
+
+Example:
+
+emif1: emif at 0x4c000000 {
+	compatible	= "ti,emif-4d";
+	ti,hwmods	= "emif2";
+	phy-type	= <1>;
+	device-handle	= <&elpida_ECB240ABACN>;
+	cs1-used;
+	hw-caps-read-idle-ctrl;
+	hw-caps-ll-interface;
+	hw-caps-temp-alert;
+};
Signature · 1 line
1.7.1
author
#7 lore raw

RFC PATCH v3 3/3 arm/dts: EMIF and lpddr2 device tree data for OMAP4 boards

In reply to Aneesh V

Device tree data for the EMIF sdram controllers in OMAP4 and LPDDR memory devices attached to OMAP4 boards.

Cc Rajendra Nayak <[email protected]>
Cc Benoit Cousson <[email protected]>
Cc Olof Johansson <[email protected]>

---
Changes in RFC v3:
* Fixed review comments from RFC v2

---
 arch/arm/boot/dts/elpida_ecb240abacn.dtsi |   65 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/omap4-panda.dts         |   13 ++++++
 arch/arm/boot/dts/omap4-sdp.dts           |   13 ++++++
 arch/arm/boot/dts/omap4.dtsi              |   19 ++++++++
 4 files changed, 110 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/boot/dts/elpida_ecb240abacn.dtsi
arch/arm/boot/dts/elpida_ecb240abacn.dtsi new file +65 -0
new file mode 100644
index 0000000..2384233
@@ -0,0 +1,65 @@
+/*
+ * Common devices used in different OMAP boards
+ */
+
+/ {
+	elpida_ECB240ABACN: lpddr2 {
+		compatible 	= "Elpida,ECB240ABACN","jedec,lpddr2-s4";
+		density		= <2048>;
+		io-width	= <32>;
+
+		tRPab-min-tck	= <3>;
+		tRCD-min-tck	= <3>;
+		tWR-min-tck	= <3>;
+		tRASmin-min-tck	= <3>;
+		tRRD-min-tck	= <2>;
+		tWTR-min-tck	= <2>;
+		tXP-min-tck	= <2>;
+		tRTP-min-tck	= <2>;
+		tCKE-min-tck	= <3>;
+		tCKESR-min-tck	= <3>;
+		tFAW-min-tck	= <8>;
+
+		timings_elpida_ECB240ABACN_400mhz: lpddr2-timings at 0 {
+			compatible 	= "jedec,lpddr2-timings";
+			min-freq	= <10000000>;
+			max-freq	= <400000000>;
+			tRPab		= <21000>;
+			tRCD		= <18000>;
+			tWR		= <15000>;
+			tRAS-min	= <42000>;
+			tRRD		= <10000>;
+			tWTR		= <7500>;
+			tXP		= <7500>;
+			tRTP		= <7500>;
+			tCKESR		= <15000>;
+			tDQSCK-max 	= <5500>;
+			tFAW		= <50000>;
+			tZQCS		= <90000>;
+			tZQCL		= <360000>;
+			tZQinit		= <1000000>;
+			tRAS-max-ns	= <70000>;
+		};
+
+		timings_elpida_ECB240ABACN_200mhz: lpddr2-timings at 1 {
+			compatible 	= "jedec,lpddr2-timings";
+			min-freq	= <10000000>;
+			max-freq	= <200000000>;
+			tRPab		= <21000>;
+			tRCD		= <18000>;
+			tWR		= <15000>;
+			tRAS-min	= <42000>;
+			tRRD		= <10000>;
+			tWTR		= <10000>;
+			tXP		= <7500>;
+			tRTP		= <7500>;
+			tCKESR		= <15000>;
+			tDQSCK-max 	= <5500>;
+			tFAW		= <50000>;
+			tZQCS		= <90000>;
+			tZQCL		= <360000>;
+			tZQinit		= <1000000>;
+			tRAS-max-ns	= <70000>;
+		};
+	};
+};
arch/arm/boot/dts/omap4-panda.dts +13 -0
index c702657..9b46802 100644
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 /include/ "omap4.dtsi"
+/include/ "elpida_ecb240abacn.dtsi"
 
 / {
 	model = "TI OMAP4 PandaBoard";
@@ -26,4 +27,16 @@
 		device_type = "memory";
 		reg = <0x80000000 0x40000000>; /* 1 GB */
 	};
+
+	ocp {
+		emif1: emif at 0x4c000000 {
+			cs1-used;
+			device-handle = <&elpida_ECB240ABACN>;
+		};
+
+		emif2: emif at 0x4d000000 {
+			cs1-used;
+			device-handle = <&elpida_ECB240ABACN>;
+		};
+	};
 };
arch/arm/boot/dts/omap4-sdp.dts +13 -0
index 066e28c..896d682 100644
@@ -8,6 +8,7 @@
 /dts-v1/;
 
 /include/ "omap4.dtsi"
+/include/ "elpida_ecb240abacn.dtsi"
 
 / {
 	model = "TI OMAP4 SDP board";
@@ -26,4 +27,16 @@
 		device_type = "memory";
 		reg = <0x80000000 0x40000000>; /* 1 GB */
 	};
+
+	ocp {
+		emif1: emif at 0x4c000000 {
+			cs1-used;
+			device-handle = <&elpida_ECB240ABACN>;
+		};
+
+		emif2: emif at 0x4d000000 {
+			cs1-used;
+			device-handle = <&elpida_ECB240ABACN>;
+		};
+	};
 };
arch/arm/boot/dts/omap4.dtsi +19 -0
index e8fe75f..bd57229 100644
@@ -127,5 +127,24 @@
 			ti,hwmods = "uart4";
 			clock-frequency = <48000000>;
 		};
+
+		emif1: emif at 0x4c000000 {
+			compatible	= "ti,emif-4d";
+			ti,hwmods	= "emif1";
+			phy-type	= <1>;
+			hw-caps-read-idle-ctrl;
+			hw-caps-ll-interface;
+			hw-caps-temp-alert;
+		};
+
+		emif2: emif at 0x4d000000 {
+			compatible	= "ti,emif-4d";
+			ti,hwmods	= "emif2";
+			phy-type	= <1>;
+			hw-caps-read-idle-ctrl;
+			hw-caps-ll-interface;
+			hw-caps-temp-alert;
+		};
+
 	};
 };
Signature · 1 line
1.7.1