All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: imx6q: add support for IRAM
@ 2011-12-26 11:15 Jason Chen
  2011-12-26 13:41 ` Shawn Guo
  2012-01-03 12:45 ` Shawn Guo
  0 siblings, 2 replies; 14+ messages in thread
From: Jason Chen @ 2011-12-26 11:15 UTC (permalink / raw)
  To: linux-arm-kernel

Signed-off-by: Jason Chen <jason.chen@linaro.org>
Signed-off-by: Eric Miao <eric.miao@linaro.org>
---
 arch/arm/boot/dts/imx6q.dtsi    |    7 +++++++
 arch/arm/mach-imx/Kconfig       |    1 +
 arch/arm/mach-imx/clock-imx6q.c |    3 ++-
 arch/arm/mach-imx/mach-imx6q.c  |   17 +++++++++++++++++
 4 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
index 263e8f3..01646b8 100644
--- a/arch/arm/boot/dts/imx6q.dtsi
+++ b/arch/arm/boot/dts/imx6q.dtsi
@@ -80,6 +80,13 @@
 		};
 	};
 
+	ocram at 00900000 {
+		compatible = "fsl,imx6q-iram";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x00900000 0x40000>;
+	};
+
 	soc {
 		#address-cells = <1>;
 		#size-cells = <1>;
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index fa5c10c..88eaef6 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -841,6 +841,7 @@ config SOC_IMX6Q
 	select HAVE_IMX_GPC
 	select HAVE_IMX_MMDC
 	select HAVE_IMX_SRC
+	select IRAM_ALLOC
 	select USE_OF
 
 	help
diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
index 9273c2a..285fd06 100644
--- a/arch/arm/mach-imx/clock-imx6q.c
+++ b/arch/arm/mach-imx/clock-imx6q.c
@@ -1777,6 +1777,7 @@ DEF_CLK(mmdc_ch0_axi_clk, CCGR3, CG10, &periph_clk,	  &mmdc_ch0_ipg_clk);
 DEF_CLK(mmdc_ch1_ipg_clk, CCGR3, CG13, &ipg_clk,	  NULL);
 DEF_CLK(mmdc_ch1_axi_clk, CCGR3, CG11, &periph2_clk,	  &mmdc_ch1_ipg_clk);
 DEF_CLK(openvg_axi_clk,   CCGR3, CG13, &axi_clk,	  NULL);
+DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
 DEF_CLK(pwm1_clk,	  CCGR4, CG8,  &ipg_perclk,	  NULL);
 DEF_CLK(pwm2_clk,	  CCGR4, CG9,  &ipg_perclk,	  NULL);
 DEF_CLK(pwm3_clk,	  CCGR4, CG10, &ipg_perclk,	  NULL);
@@ -1982,7 +1983,7 @@ int __init mx6q_clocks_init(void)
 	/* only keep necessary clocks on */
 	writel_relaxed(0x3 << CG0  | 0x3 << CG1  | 0x3 << CG2,	CCGR0);
 	writel_relaxed(0x3 << CG8  | 0x3 << CG9  | 0x3 << CG10,	CCGR2);
-	writel_relaxed(0x3 << CG10 | 0x3 << CG12,		CCGR3);
+	writel_relaxed(0x3 << CG10 | 0x3 << CG12 | 0x1 << CG14,	CCGR3);
 	writel_relaxed(0x3 << CG4  | 0x3 << CG6  | 0x3 << CG7,	CCGR4);
 	writel_relaxed(0x3 << CG0,				CCGR5);
 	writel_relaxed(0,					CCGR6);
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index c257281..7612ef5 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -27,6 +27,7 @@
 #include <asm/mach/time.h>
 #include <mach/common.h>
 #include <mach/hardware.h>
+#include <mach/iram.h>
 
 void imx6q_restart(char mode, const char *cmd)
 {
@@ -73,6 +74,21 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev)
 	return 0;
 }
 
+static int imx6q_init_iram(void)
+{
+	struct device_node *np;
+	struct resource res;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-iram");
+	if (np) {
+		if (!of_address_to_resource(np, 0, &res))
+			return iram_init(res.start, res.end - res.start + 1);
+		else
+			return 0;
+	} else
+		return 0;
+}
+
 static void __init imx6q_init_machine(void)
 {
 	if (of_machine_is_compatible("fsl,imx6q-sabrelite"))
@@ -81,6 +97,7 @@ static void __init imx6q_init_machine(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	imx6q_init_iram();
 	imx6q_pm_init();
 }
 
-- 
1.7.4.1

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

* [PATCH] ARM: imx6q: add support for IRAM
  2011-12-26 11:15 [PATCH] ARM: imx6q: add support for IRAM Jason Chen
@ 2011-12-26 13:41 ` Shawn Guo
  2012-01-03  9:10   ` Russell King - ARM Linux
  2012-01-03 12:45 ` Shawn Guo
  1 sibling, 1 reply; 14+ messages in thread
From: Shawn Guo @ 2011-12-26 13:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> Signed-off-by: Jason Chen <jason.chen@linaro.org>
> Signed-off-by: Eric Miao <eric.miao@linaro.org>
> ---
>  arch/arm/boot/dts/imx6q.dtsi    |    7 +++++++
>  arch/arm/mach-imx/Kconfig       |    1 +
>  arch/arm/mach-imx/clock-imx6q.c |    3 ++-
>  arch/arm/mach-imx/mach-imx6q.c  |   17 +++++++++++++++++
>  4 files changed, 27 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
> index 263e8f3..01646b8 100644
> --- a/arch/arm/boot/dts/imx6q.dtsi
> +++ b/arch/arm/boot/dts/imx6q.dtsi
> @@ -80,6 +80,13 @@
>  		};
>  	};
>  
> +	ocram at 00900000 {
> +		compatible = "fsl,imx6q-iram";

It should have nothing specific to imx6q, and could be "fsl,iram".
Then we can have some common code across different SoCs to match it.

> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +		reg = <0x00900000 0x40000>;
> +	};
> +

Would it be better to put this node inside node 'soc', since it's
the part of SoC?  The bonus point would be that we can save
#address-cells and #size-cells for iram node.

>  	soc {
>  		#address-cells = <1>;
>  		#size-cells = <1>;
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index fa5c10c..88eaef6 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -841,6 +841,7 @@ config SOC_IMX6Q
>  	select HAVE_IMX_GPC
>  	select HAVE_IMX_MMDC
>  	select HAVE_IMX_SRC
> +	select IRAM_ALLOC
>  	select USE_OF
>  
>  	help
> diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
> index 9273c2a..285fd06 100644
> --- a/arch/arm/mach-imx/clock-imx6q.c
> +++ b/arch/arm/mach-imx/clock-imx6q.c
> @@ -1777,6 +1777,7 @@ DEF_CLK(mmdc_ch0_axi_clk, CCGR3, CG10, &periph_clk,	  &mmdc_ch0_ipg_clk);
>  DEF_CLK(mmdc_ch1_ipg_clk, CCGR3, CG13, &ipg_clk,	  NULL);
>  DEF_CLK(mmdc_ch1_axi_clk, CCGR3, CG11, &periph2_clk,	  &mmdc_ch1_ipg_clk);
>  DEF_CLK(openvg_axi_clk,   CCGR3, CG13, &axi_clk,	  NULL);
> +DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
>  DEF_CLK(pwm1_clk,	  CCGR4, CG8,  &ipg_perclk,	  NULL);
>  DEF_CLK(pwm2_clk,	  CCGR4, CG9,  &ipg_perclk,	  NULL);
>  DEF_CLK(pwm3_clk,	  CCGR4, CG10, &ipg_perclk,	  NULL);
> @@ -1982,7 +1983,7 @@ int __init mx6q_clocks_init(void)
>  	/* only keep necessary clocks on */
>  	writel_relaxed(0x3 << CG0  | 0x3 << CG1  | 0x3 << CG2,	CCGR0);
>  	writel_relaxed(0x3 << CG8  | 0x3 << CG9  | 0x3 << CG10,	CCGR2);
> -	writel_relaxed(0x3 << CG10 | 0x3 << CG12,		CCGR3);
> +	writel_relaxed(0x3 << CG10 | 0x3 << CG12 | 0x1 << CG14,	CCGR3);
>  	writel_relaxed(0x3 << CG4  | 0x3 << CG6  | 0x3 << CG7,	CCGR4);
>  	writel_relaxed(0x3 << CG0,				CCGR5);
>  	writel_relaxed(0,					CCGR6);
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index c257281..7612ef5 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -27,6 +27,7 @@
>  #include <asm/mach/time.h>
>  #include <mach/common.h>
>  #include <mach/hardware.h>
> +#include <mach/iram.h>
>  
>  void imx6q_restart(char mode, const char *cmd)
>  {
> @@ -73,6 +74,21 @@ static int ksz9021rn_phy_fixup(struct phy_device *phydev)
>  	return 0;
>  }
>  
> +static int imx6q_init_iram(void)
> +{
> +	struct device_node *np;
> +	struct resource res;
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-iram");
> +	if (np) {
> +		if (!of_address_to_resource(np, 0, &res))
> +			return iram_init(res.start, res.end - res.start + 1);
> +		else
> +			return 0;
> +	} else
> +		return 0;
> +}
> +
This piece of code should not be imx6q specific.  Instead, it could
become the function iram_of_init() in iram_alloc.c, so that the future
soc like imx6dl or whatever that has iram integrated can just can call
iram_of_init() to have iram allocator set up.

-- 
Regards,
Shawn

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

* [PATCH] ARM: imx6q: add support for IRAM
  2011-12-26 13:41 ` Shawn Guo
@ 2012-01-03  9:10   ` Russell King - ARM Linux
  2012-01-03 12:43     ` Shawn Guo
  0 siblings, 1 reply; 14+ messages in thread
From: Russell King - ARM Linux @ 2012-01-03  9:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 26, 2011 at 09:41:30PM +0800, Shawn Guo wrote:
> On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> > Signed-off-by: Jason Chen <jason.chen@linaro.org>
> > Signed-off-by: Eric Miao <eric.miao@linaro.org>
> > ---
> >  arch/arm/boot/dts/imx6q.dtsi    |    7 +++++++
> >  arch/arm/mach-imx/Kconfig       |    1 +
> >  arch/arm/mach-imx/clock-imx6q.c |    3 ++-
> >  arch/arm/mach-imx/mach-imx6q.c  |   17 +++++++++++++++++
> >  4 files changed, 27 insertions(+), 1 deletions(-)
> > 
> > diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
> > index 263e8f3..01646b8 100644
> > --- a/arch/arm/boot/dts/imx6q.dtsi
> > +++ b/arch/arm/boot/dts/imx6q.dtsi
> > @@ -80,6 +80,13 @@
> >  		};
> >  	};
> >  
> > +	ocram at 00900000 {
> > +		compatible = "fsl,imx6q-iram";
> 
> It should have nothing specific to imx6q, and could be "fsl,iram".
> Then we can have some common code across different SoCs to match it.

Why is this even specific to fsl?  Isn't it something that could be
specified in a totally generic way?

As I showed with my original set of sram patches, there is not much
specific about this on-board RAM: what is specific is how a SoC uses
it, and that's up to the rest of the SoC code.

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

* [PATCH] ARM: imx6q: add support for IRAM
  2012-01-03 12:43     ` Shawn Guo
@ 2012-01-03 12:41       ` Russell King - ARM Linux
  2012-01-03 13:04         ` Shawn Guo
       [not found]         ` <20120103124136.GQ2914-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
  0 siblings, 2 replies; 14+ messages in thread
From: Russell King - ARM Linux @ 2012-01-03 12:41 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 03, 2012 at 08:43:56PM +0800, Shawn Guo wrote:
> On Tue, Jan 03, 2012 at 09:10:15AM +0000, Russell King - ARM Linux wrote:
> > Why is this even specific to fsl?  Isn't it something that could be
> > specified in a totally generic way?
> > 
> > As I showed with my original set of sram patches, there is not much
> > specific about this on-board RAM: what is specific is how a SoC uses
> > it, and that's up to the rest of the SoC code.
> > 
> As I have not seen any news/updates about the sram consolidation series
> since May, I did not bring up it here.  So what's the state of the
> series?  If it shows up on some stable branch, we would be happy to
> base the work here on it.

I have no idea; as I've already said, I lost total interest in it.

What I _am_ saying though is that rather than defining some platform
specific bindings and continuing that idiotic state of affairs, we
have the chance to do things properly now: define a standard set of
DT bindings to describe on-board SRAM.

That's something which can be done with or without the sram
consolidation stuff.

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

* [PATCH] ARM: imx6q: add support for IRAM
  2012-01-03  9:10   ` Russell King - ARM Linux
@ 2012-01-03 12:43     ` Shawn Guo
  2012-01-03 12:41       ` Russell King - ARM Linux
  0 siblings, 1 reply; 14+ messages in thread
From: Shawn Guo @ 2012-01-03 12:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 03, 2012 at 09:10:15AM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 26, 2011 at 09:41:30PM +0800, Shawn Guo wrote:
> > On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> > > Signed-off-by: Jason Chen <jason.chen@linaro.org>
> > > Signed-off-by: Eric Miao <eric.miao@linaro.org>
> > > ---
> > >  arch/arm/boot/dts/imx6q.dtsi    |    7 +++++++
> > >  arch/arm/mach-imx/Kconfig       |    1 +
> > >  arch/arm/mach-imx/clock-imx6q.c |    3 ++-
> > >  arch/arm/mach-imx/mach-imx6q.c  |   17 +++++++++++++++++
> > >  4 files changed, 27 insertions(+), 1 deletions(-)
> > > 
> > > diff --git a/arch/arm/boot/dts/imx6q.dtsi b/arch/arm/boot/dts/imx6q.dtsi
> > > index 263e8f3..01646b8 100644
> > > --- a/arch/arm/boot/dts/imx6q.dtsi
> > > +++ b/arch/arm/boot/dts/imx6q.dtsi
> > > @@ -80,6 +80,13 @@
> > >  		};
> > >  	};
> > >  
> > > +	ocram at 00900000 {
> > > +		compatible = "fsl,imx6q-iram";
> > 
> > It should have nothing specific to imx6q, and could be "fsl,iram".
> > Then we can have some common code across different SoCs to match it.
> 
> Why is this even specific to fsl?  Isn't it something that could be
> specified in a totally generic way?
> 
> As I showed with my original set of sram patches, there is not much
> specific about this on-board RAM: what is specific is how a SoC uses
> it, and that's up to the rest of the SoC code.
> 
As I have not seen any news/updates about the sram consolidation series
since May, I did not bring up it here.  So what's the state of the
series?  If it shows up on some stable branch, we would be happy to
base the work here on it.

-- 
Regards,
Shawn

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

* [PATCH] ARM: imx6q: add support for IRAM
  2011-12-26 11:15 [PATCH] ARM: imx6q: add support for IRAM Jason Chen
  2011-12-26 13:41 ` Shawn Guo
@ 2012-01-03 12:45 ` Shawn Guo
  2012-01-05  5:10   ` Jason Chen
  1 sibling, 1 reply; 14+ messages in thread
From: Shawn Guo @ 2012-01-03 12:45 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> +DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);

  CC      arch/arm/mach-imx/clock-imx6q.o
arch/arm/mach-imx/clock-imx6q.c:1782:1: warning: ?ocram_clk? defined but not used

-- 
Regards,
Shawn

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

* [PATCH] ARM: imx6q: add support for IRAM
  2012-01-03 12:41       ` Russell King - ARM Linux
@ 2012-01-03 13:04         ` Shawn Guo
       [not found]         ` <20120103124136.GQ2914-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2012-01-03 13:04 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 03, 2012 at 12:41:36PM +0000, Russell King - ARM Linux wrote:
> On Tue, Jan 03, 2012 at 08:43:56PM +0800, Shawn Guo wrote:
> > On Tue, Jan 03, 2012 at 09:10:15AM +0000, Russell King - ARM Linux wrote:
> > > Why is this even specific to fsl?  Isn't it something that could be
> > > specified in a totally generic way?
> > > 
> > > As I showed with my original set of sram patches, there is not much
> > > specific about this on-board RAM: what is specific is how a SoC uses
> > > it, and that's up to the rest of the SoC code.
> > > 
> > As I have not seen any news/updates about the sram consolidation series
> > since May, I did not bring up it here.  So what's the state of the
> > series?  If it shows up on some stable branch, we would be happy to
> > base the work here on it.
> 
> I have no idea; as I've already said, I lost total interest in it.
> 
> What I _am_ saying though is that rather than defining some platform
> specific bindings and continuing that idiotic state of affairs, we
> have the chance to do things properly now: define a standard set of
> DT bindings to describe on-board SRAM.
> 
> That's something which can be done with or without the sram
> consolidation stuff.
> 
I guess it makes more sense to have a concentrated piece of code
backing that DT binding.  This can be another reason we should continue
the sram consolidation effort?

-- 
Regards,
Shawn

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

* Re: [PATCH] ARM: imx6q: add support for IRAM
  2012-01-03 12:41       ` Russell King - ARM Linux
@ 2012-01-04 11:12             ` Linus Walleij
       [not found]         ` <20120103124136.GQ2914-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
  1 sibling, 0 replies; 14+ messages in thread
From: Linus Walleij @ 2012-01-04 11:12 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Jason Chen, s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ,
	eric.miao-QSEj5FYQhm4dnm+yROfE0A,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Jan 3, 2012 at 1:41 PM, Russell King - ARM Linux
<linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org> wrote:
> On Tue, Jan 03, 2012 at 08:43:56PM +0800, Shawn Guo wrote:
>> On Tue, Jan 03, 2012 at 09:10:15AM +0000, Russell King - ARM Linux wrote:
>> > Why is this even specific to fsl?  Isn't it something that could be
>> > specified in a totally generic way?
>> >
>> > As I showed with my original set of sram patches, there is not much
>> > specific about this on-board RAM: what is specific is how a SoC uses
>> > it, and that's up to the rest of the SoC code.
>> >
>> As I have not seen any news/updates about the sram consolidation series
>> since May, I did not bring up it here.  So what's the state of the
>> series?  If it shows up on some stable branch, we would be happy to
>> base the work here on it.
>
> I have no idea; as I've already said, I lost total interest in it.
>
> What I _am_ saying though is that rather than defining some platform
> specific bindings and continuing that idiotic state of affairs, we
> have the chance to do things properly now: define a standard set of
> DT bindings to describe on-board SRAM.
>
> That's something which can be done with or without the sram
> consolidation stuff.

I second this. It's just a piece of RAM, it should be described
the same way irrespective of system or even OS.

On-chip RAM is yet another area where platforms and their
maintainers sometimes think they are very different - just like
everyone else.

(This connects to the other IRAM patch floating on the list.)

Yours,
Linus Walleij

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

* [PATCH] ARM: imx6q: add support for IRAM
@ 2012-01-04 11:12             ` Linus Walleij
  0 siblings, 0 replies; 14+ messages in thread
From: Linus Walleij @ 2012-01-04 11:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 3, 2012 at 1:41 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Jan 03, 2012 at 08:43:56PM +0800, Shawn Guo wrote:
>> On Tue, Jan 03, 2012 at 09:10:15AM +0000, Russell King - ARM Linux wrote:
>> > Why is this even specific to fsl? ?Isn't it something that could be
>> > specified in a totally generic way?
>> >
>> > As I showed with my original set of sram patches, there is not much
>> > specific about this on-board RAM: what is specific is how a SoC uses
>> > it, and that's up to the rest of the SoC code.
>> >
>> As I have not seen any news/updates about the sram consolidation series
>> since May, I did not bring up it here. ?So what's the state of the
>> series? ?If it shows up on some stable branch, we would be happy to
>> base the work here on it.
>
> I have no idea; as I've already said, I lost total interest in it.
>
> What I _am_ saying though is that rather than defining some platform
> specific bindings and continuing that idiotic state of affairs, we
> have the chance to do things properly now: define a standard set of
> DT bindings to describe on-board SRAM.
>
> That's something which can be done with or without the sram
> consolidation stuff.

I second this. It's just a piece of RAM, it should be described
the same way irrespective of system or even OS.

On-chip RAM is yet another area where platforms and their
maintainers sometimes think they are very different - just like
everyone else.

(This connects to the other IRAM patch floating on the list.)

Yours,
Linus Walleij

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

* [PATCH] ARM: imx6q: add support for IRAM
  2012-01-03 12:45 ` Shawn Guo
@ 2012-01-05  5:10   ` Jason Chen
  2012-01-05  5:47     ` Shawn Guo
  0 siblings, 1 reply; 14+ messages in thread
From: Jason Chen @ 2012-01-05  5:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Jan 03, 2012 at 08:45:02PM +0800, Shawn Guo wrote:
> On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> > +DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
> 
>   CC      arch/arm/mach-imx/clock-imx6q.o
> arch/arm/mach-imx/clock-imx6q.c:1782:1: warning: ?ocram_clk? defined but not used
it should be a dependcy of vpu/sdma who using IRAM, they can be added.
> 
> -- 
> Regards,
> Shawn
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] ARM: imx6q: add support for IRAM
  2012-01-05  5:47     ` Shawn Guo
@ 2012-01-05  5:40       ` Jason Chen
  0 siblings, 0 replies; 14+ messages in thread
From: Jason Chen @ 2012-01-05  5:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 05, 2012 at 01:47:54PM +0800, Shawn Guo wrote:
> On Thu, Jan 05, 2012 at 01:10:48PM +0800, Jason Chen wrote:
> > On Tue, Jan 03, 2012 at 08:45:02PM +0800, Shawn Guo wrote:
> > > On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> > > > +DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
> > > 
> > >   CC      arch/arm/mach-imx/clock-imx6q.o
> > > arch/arm/mach-imx/clock-imx6q.c:1782:1: warning: ?ocram_clk? defined but not used
> > it should be a dependcy of vpu/sdma who using IRAM, they can be added.
> 
> My point is your patch should not introduce any warning at any time.
sure, will fix it.
> 
> -- 
> Regards,
> Shawn

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

* [PATCH] ARM: imx6q: add support for IRAM
  2012-01-05  5:10   ` Jason Chen
@ 2012-01-05  5:47     ` Shawn Guo
  2012-01-05  5:40       ` Jason Chen
  0 siblings, 1 reply; 14+ messages in thread
From: Shawn Guo @ 2012-01-05  5:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Jan 05, 2012 at 01:10:48PM +0800, Jason Chen wrote:
> On Tue, Jan 03, 2012 at 08:45:02PM +0800, Shawn Guo wrote:
> > On Mon, Dec 26, 2011 at 07:15:23PM +0800, Jason Chen wrote:
> > > +DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
> > 
> >   CC      arch/arm/mach-imx/clock-imx6q.o
> > arch/arm/mach-imx/clock-imx6q.c:1782:1: warning: ?ocram_clk? defined but not used
> it should be a dependcy of vpu/sdma who using IRAM, they can be added.

My point is your patch should not introduce any warning at any time.

-- 
Regards,
Shawn

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

* [PATCH] ARM: imx6q: add support for IRAM
  2011-12-22 13:48 Eric Miao
@ 2011-12-25 13:37 ` Shawn Guo
  0 siblings, 0 replies; 14+ messages in thread
From: Shawn Guo @ 2011-12-25 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Dec 22, 2011 at 09:48:24PM +0800, Eric Miao wrote:
> From: Jason Chen <jason.chen@linaro.org>
> 
> Signed-off-by: Jason Chen <jason.chen@linaro.org>
> Signed-off-by: Eric Miao <eric.miao@linaro.org>
> ---
>  arch/arm/mach-imx/Kconfig             |    1 +
>  arch/arm/mach-imx/clock-imx6q.c       |    3 ++-
>  arch/arm/mach-imx/mach-imx6q.c        |    3 +++
>  arch/arm/plat-mxc/include/mach/mx6q.h |    6 ++++++
>  4 files changed, 12 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
> index 6ee6803..023d240 100644
> --- a/arch/arm/mach-imx/Kconfig
> +++ b/arch/arm/mach-imx/Kconfig
> @@ -602,6 +602,7 @@ config SOC_IMX6Q
>  	select HAVE_IMX_GPC
>  	select HAVE_IMX_MMDC
>  	select HAVE_IMX_SRC
> +	select IRAM_ALLOC
>  	select ARM_CPU_SUSPEND if PM
>  	select USE_OF
>  
> diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
> index 039a7ab..b347a84 100644
> --- a/arch/arm/mach-imx/clock-imx6q.c
> +++ b/arch/arm/mach-imx/clock-imx6q.c
> @@ -1777,6 +1777,7 @@ DEF_CLK(mmdc_ch0_axi_clk, CCGR3, CG10, &periph_clk,	  &mmdc_ch0_ipg_clk);
>  DEF_CLK(mmdc_ch1_ipg_clk, CCGR3, CG13, &ipg_clk,	  NULL);
>  DEF_CLK(mmdc_ch1_axi_clk, CCGR3, CG11, &periph2_clk,	  &mmdc_ch1_ipg_clk);
>  DEF_CLK(openvg_axi_clk,   CCGR3, CG13, &axi_clk,	  NULL);
> +DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
>  DEF_CLK(pwm1_clk,	  CCGR4, CG8,  &ipg_perclk,	  NULL);
>  DEF_CLK(pwm2_clk,	  CCGR4, CG9,  &ipg_perclk,	  NULL);
>  DEF_CLK(pwm3_clk,	  CCGR4, CG10, &ipg_perclk,	  NULL);
> @@ -1984,7 +1985,7 @@ int __init mx6q_clocks_init(void)
>  	/* only keep necessary clocks on */
>  	writel_relaxed(0x3 << CG0  | 0x3 << CG1  | 0x3 << CG2,	CCGR0);
>  	writel_relaxed(0x3 << CG8  | 0x3 << CG9  | 0x3 << CG10,	CCGR2);
> -	writel_relaxed(0x3 << CG10 | 0x3 << CG12,		CCGR3);
> +	writel_relaxed(0x3 << CG10 | 0x3 << CG12 | 0x1 << CG14,	CCGR3);
>  	writel_relaxed(0x3 << CG4  | 0x3 << CG6  | 0x3 << CG7,	CCGR4);
>  	writel_relaxed(0x3 << CG0,				CCGR5);
>  	writel_relaxed(0,					CCGR6);
> diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
> index bee6334..d69f99f 100644
> --- a/arch/arm/mach-imx/mach-imx6q.c
> +++ b/arch/arm/mach-imx/mach-imx6q.c
> @@ -24,6 +24,7 @@
>  #include <asm/mach/time.h>
>  #include <mach/common.h>
>  #include <mach/hardware.h>
> +#include <mach/iram.h>
>  
>  /* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
>  static int ksz9021rn_phy_fixup(struct phy_device *phydev)
> @@ -48,6 +49,8 @@ static void __init imx6q_init_machine(void)
>  
>  	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
>  
> +	iram_init(MX6Q_IRAM_BASE_ADDR, MX6Q_IRAM_SIZE);
> +
Instead of defining MX6Q_IRAM_BASE_ADDR and MX6Q_IRAM_SIZE in mx6q.h,
they should be retrieved from device tree with io_map() returning the
mapped virtual address.

We may probably want to have a iram_of_init(void) for device tree case,
and create a helper function saying iram_common_init() for the common
pattern between iram_init() and iram_of_init().

>  	imx6q_pm_init();
>  }
>  
> diff --git a/arch/arm/plat-mxc/include/mach/mx6q.h b/arch/arm/plat-mxc/include/mach/mx6q.h
> index 254a561..e051ff1 100644
> --- a/arch/arm/plat-mxc/include/mach/mx6q.h
> +++ b/arch/arm/plat-mxc/include/mach/mx6q.h
> @@ -13,6 +13,8 @@
>  #ifndef __MACH_MX6Q_H__
>  #define __MACH_MX6Q_H__
>  
> +#include <asm/sizes.h>
> +
>  #define MX6Q_IO_P2V(x)			IMX_IO_P2V(x)
>  #define MX6Q_IO_ADDRESS(x)		IOMEM(MX6Q_IO_P2V(x))
>  
> @@ -30,4 +32,8 @@
>  #define MX6Q_UART4_BASE_ADDR		0x021f0000
>  #define MX6Q_UART4_SIZE			0x4000
>  
> +/* The last 4K is for cpu hotplug to workaround wdog issue */
> +#define MX6Q_IRAM_BASE_ADDR		0x00900000
> +#define MX6Q_IRAM_SIZE			(SZ_256K - SZ_4K)
> +
We only define those that have to go with static mapping in mx6q.h.

-- 
Regards,
Shawn

>  #endif	/* __MACH_MX6Q_H__ */
> -- 
> 1.7.5.4

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

* [PATCH] ARM: imx6q: add support for IRAM
@ 2011-12-22 13:48 Eric Miao
  2011-12-25 13:37 ` Shawn Guo
  0 siblings, 1 reply; 14+ messages in thread
From: Eric Miao @ 2011-12-22 13:48 UTC (permalink / raw)
  To: linux-arm-kernel

From: Jason Chen <jason.chen@linaro.org>

Signed-off-by: Jason Chen <jason.chen@linaro.org>
Signed-off-by: Eric Miao <eric.miao@linaro.org>
---
 arch/arm/mach-imx/Kconfig             |    1 +
 arch/arm/mach-imx/clock-imx6q.c       |    3 ++-
 arch/arm/mach-imx/mach-imx6q.c        |    3 +++
 arch/arm/plat-mxc/include/mach/mx6q.h |    6 ++++++
 4 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index 6ee6803..023d240 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -602,6 +602,7 @@ config SOC_IMX6Q
 	select HAVE_IMX_GPC
 	select HAVE_IMX_MMDC
 	select HAVE_IMX_SRC
+	select IRAM_ALLOC
 	select ARM_CPU_SUSPEND if PM
 	select USE_OF
 
diff --git a/arch/arm/mach-imx/clock-imx6q.c b/arch/arm/mach-imx/clock-imx6q.c
index 039a7ab..b347a84 100644
--- a/arch/arm/mach-imx/clock-imx6q.c
+++ b/arch/arm/mach-imx/clock-imx6q.c
@@ -1777,6 +1777,7 @@ DEF_CLK(mmdc_ch0_axi_clk, CCGR3, CG10, &periph_clk,	  &mmdc_ch0_ipg_clk);
 DEF_CLK(mmdc_ch1_ipg_clk, CCGR3, CG13, &ipg_clk,	  NULL);
 DEF_CLK(mmdc_ch1_axi_clk, CCGR3, CG11, &periph2_clk,	  &mmdc_ch1_ipg_clk);
 DEF_CLK(openvg_axi_clk,   CCGR3, CG13, &axi_clk,	  NULL);
+DEF_CLK(ocram_clk,   	  CCGR3, CG14, &ahb_clk,	  NULL);
 DEF_CLK(pwm1_clk,	  CCGR4, CG8,  &ipg_perclk,	  NULL);
 DEF_CLK(pwm2_clk,	  CCGR4, CG9,  &ipg_perclk,	  NULL);
 DEF_CLK(pwm3_clk,	  CCGR4, CG10, &ipg_perclk,	  NULL);
@@ -1984,7 +1985,7 @@ int __init mx6q_clocks_init(void)
 	/* only keep necessary clocks on */
 	writel_relaxed(0x3 << CG0  | 0x3 << CG1  | 0x3 << CG2,	CCGR0);
 	writel_relaxed(0x3 << CG8  | 0x3 << CG9  | 0x3 << CG10,	CCGR2);
-	writel_relaxed(0x3 << CG10 | 0x3 << CG12,		CCGR3);
+	writel_relaxed(0x3 << CG10 | 0x3 << CG12 | 0x1 << CG14,	CCGR3);
 	writel_relaxed(0x3 << CG4  | 0x3 << CG6  | 0x3 << CG7,	CCGR4);
 	writel_relaxed(0x3 << CG0,				CCGR5);
 	writel_relaxed(0,					CCGR6);
diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index bee6334..d69f99f 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -24,6 +24,7 @@
 #include <asm/mach/time.h>
 #include <mach/common.h>
 #include <mach/hardware.h>
+#include <mach/iram.h>
 
 /* For imx6q sabrelite board: set KSZ9021RN RGMII pad skew */
 static int ksz9021rn_phy_fixup(struct phy_device *phydev)
@@ -48,6 +49,8 @@ static void __init imx6q_init_machine(void)
 
 	of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
 
+	iram_init(MX6Q_IRAM_BASE_ADDR, MX6Q_IRAM_SIZE);
+
 	imx6q_pm_init();
 }
 
diff --git a/arch/arm/plat-mxc/include/mach/mx6q.h b/arch/arm/plat-mxc/include/mach/mx6q.h
index 254a561..e051ff1 100644
--- a/arch/arm/plat-mxc/include/mach/mx6q.h
+++ b/arch/arm/plat-mxc/include/mach/mx6q.h
@@ -13,6 +13,8 @@
 #ifndef __MACH_MX6Q_H__
 #define __MACH_MX6Q_H__
 
+#include <asm/sizes.h>
+
 #define MX6Q_IO_P2V(x)			IMX_IO_P2V(x)
 #define MX6Q_IO_ADDRESS(x)		IOMEM(MX6Q_IO_P2V(x))
 
@@ -30,4 +32,8 @@
 #define MX6Q_UART4_BASE_ADDR		0x021f0000
 #define MX6Q_UART4_SIZE			0x4000
 
+/* The last 4K is for cpu hotplug to workaround wdog issue */
+#define MX6Q_IRAM_BASE_ADDR		0x00900000
+#define MX6Q_IRAM_SIZE			(SZ_256K - SZ_4K)
+
 #endif	/* __MACH_MX6Q_H__ */
-- 
1.7.5.4

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

end of thread, other threads:[~2012-01-05  5:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-26 11:15 [PATCH] ARM: imx6q: add support for IRAM Jason Chen
2011-12-26 13:41 ` Shawn Guo
2012-01-03  9:10   ` Russell King - ARM Linux
2012-01-03 12:43     ` Shawn Guo
2012-01-03 12:41       ` Russell King - ARM Linux
2012-01-03 13:04         ` Shawn Guo
     [not found]         ` <20120103124136.GQ2914-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2012-01-04 11:12           ` Linus Walleij
2012-01-04 11:12             ` Linus Walleij
2012-01-03 12:45 ` Shawn Guo
2012-01-05  5:10   ` Jason Chen
2012-01-05  5:47     ` Shawn Guo
2012-01-05  5:40       ` Jason Chen
  -- strict thread matches above, loose matches on Subject: below --
2011-12-22 13:48 Eric Miao
2011-12-25 13:37 ` Shawn Guo

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.