diff mbox

[3/5] ARM: at91/dt: sama5d3: define mpddr clock and ramc clocks

Message ID 1404746355-19988-4-git-send-email-alexandre.belloni@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alexandre Belloni July 7, 2014, 3:19 p.m. UTC
Define the available clock for mprddr and take both mpddr_clk and ddrck in the
ram controller driver.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---
 arch/arm/boot/dts/sama5d3.dtsi | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Jean-Christophe PLAGNIOL-VILLARD July 7, 2014, 6:32 p.m. UTC | #1
On 17:19 Mon 07 Jul     , Alexandre Belloni wrote:
> 
> Define the available clock for mprddr and take both mpddr_clk and ddrck in the
> ram controller driver.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
>  arch/arm/boot/dts/sama5d3.dtsi | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
> index e0b15a6e8897..3bd8db9e069b 100644
> --- a/arch/arm/boot/dts/sama5d3.dtsi
> +++ b/arch/arm/boot/dts/sama5d3.dtsi
> @@ -402,8 +402,10 @@
>  			};
>  
>  			ramc0: ramc@ffffea00 {
> -				compatible = "atmel,at91sam9g45-ddramc";
> +				compatible = "atmel,sama5d3-mpddramc", "atmel,at91sam9g45-ddramc";
the sama5 ddr controler is not back compitble with 9g45 one the compatible is
wrong
>  				reg = <0xffffea00 0x200>;
> +				clocks = <&ddrck>, <&mpddr_clk>;
> +				clock-names = "ddrck", "mpddr";
>  			};
>  
>  			dbgu: serial@ffffee00 {
> @@ -1170,6 +1172,11 @@
>  						#clock-cells = <0>;
>  						reg = <48>;
>  					};
> +
> +					mpddr_clk: mpddr_clk {
> +						#clock-cells = <0>;
> +						reg = <49>;
> +					};
>  				};
>  			};
>  
> -- 
> 1.9.1
>
Alexandre Belloni July 7, 2014, 7:55 p.m. UTC | #2
On 07/07/2014 at 20:32:36 +0200, Jean-Christophe PLAGNIOL-VILLARD wrote :
> > -				compatible = "atmel,at91sam9g45-ddramc";
> > +				compatible = "atmel,sama5d3-mpddramc", "atmel,at91sam9g45-ddramc";
> the sama5 ddr controler is not back compitble with 9g45 one the compatible is
> wrong

Keeping atmel,at91sam9g45-ddramc allows to reuse the old code for the
iomap needed for the PM code without adding a new compatible in the
ramc_ids[] array.
Maxime Ripard July 8, 2014, 7:51 a.m. UTC | #3
Hi,

On Mon, Jul 07, 2014 at 09:55:56PM +0200, Alexandre Belloni wrote:
> On 07/07/2014 at 20:32:36 +0200, Jean-Christophe PLAGNIOL-VILLARD wrote :
> > > -				compatible = "atmel,at91sam9g45-ddramc";
> > > +				compatible = "atmel,sama5d3-mpddramc", "atmel,at91sam9g45-ddramc";
> > the sama5 ddr controler is not back compitble with 9g45 one the compatible is
> > wrong
> 
> Keeping atmel,at91sam9g45-ddramc allows to reuse the old code for the
> iomap needed for the PM code without adding a new compatible in the
> ramc_ids[] array.

That looks like a pretty bad argument :)

If the two devices are not alike, they should have a different
compatible, it's as simple as that, and Linux should just deal with
it.

Maxime
diff mbox

Patch

diff --git a/arch/arm/boot/dts/sama5d3.dtsi b/arch/arm/boot/dts/sama5d3.dtsi
index e0b15a6e8897..3bd8db9e069b 100644
--- a/arch/arm/boot/dts/sama5d3.dtsi
+++ b/arch/arm/boot/dts/sama5d3.dtsi
@@ -402,8 +402,10 @@ 
 			};
 
 			ramc0: ramc@ffffea00 {
-				compatible = "atmel,at91sam9g45-ddramc";
+				compatible = "atmel,sama5d3-mpddramc", "atmel,at91sam9g45-ddramc";
 				reg = <0xffffea00 0x200>;
+				clocks = <&ddrck>, <&mpddr_clk>;
+				clock-names = "ddrck", "mpddr";
 			};
 
 			dbgu: serial@ffffee00 {
@@ -1170,6 +1172,11 @@ 
 						#clock-cells = <0>;
 						reg = <48>;
 					};
+
+					mpddr_clk: mpddr_clk {
+						#clock-cells = <0>;
+						reg = <49>;
+					};
 				};
 			};