linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code
@ 2014-01-15 12:25 Magnus Damm
  2014-01-15 12:25 ` [PATCH 01/04] ARM: shmobile: r8a7790 SYSC " Magnus Damm
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Magnus Damm @ 2014-01-15 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code

[PATCH 01/04] ARM: shmobile: r8a7790 SYSC setup code
[PATCH 02/04] ARM: shmobile: r8a7790 CA7-SCU enablement
[PATCH 03/04] ARM: shmobile: r8a7790 CA15-SCU enablement
[PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration

Add r8a7790 specific SYSC, SCU and CCI setup code.

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
[damm@opensource.se: Converted to use broken out SYSC code]
Signed-off-by: Magnus Damm <damm@opensource.se>
---

 Written against renesas.git tag renesas-devel-v3.13-rc8-20140115,
 also requires "[PATCH] ARM: shmobile: Break out R-Car SYSC PM code"

 arch/arm/mach-shmobile/Makefile               |    1 
 arch/arm/mach-shmobile/include/mach/r8a7790.h |    1 
 arch/arm/mach-shmobile/pm-r8a7790.c           |   45 +++++++++++++++++++++++++
 arch/arm/mach-shmobile/smp-r8a7790.c          |   32 +++++++++++++++++
 4 files changed, 79 insertions(+)

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

* [PATCH 01/04] ARM: shmobile: r8a7790 SYSC setup code
  2014-01-15 12:25 [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Magnus Damm
@ 2014-01-15 12:25 ` Magnus Damm
  2014-01-15 12:26 ` [PATCH 02/04] ARM: shmobile: r8a7790 CA7-SCU enablement Magnus Damm
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2014-01-15 12:25 UTC (permalink / raw)
  To: linux-arm-kernel

From: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>

Add r8a7790 SYSC power management support.

Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
[damm@opensource.se: Converted to use broken out SYSC code]
Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/Makefile               |    1 
 arch/arm/mach-shmobile/include/mach/r8a7790.h |    1 
 arch/arm/mach-shmobile/pm-r8a7790.c           |   45 +++++++++++++++++++++++++
 3 files changed, 47 insertions(+)

--- 0002/arch/arm/mach-shmobile/Makefile
+++ work/arch/arm/mach-shmobile/Makefile	2014-01-15 14:21:49.000000000 +0900
@@ -53,6 +53,7 @@ obj-$(CONFIG_ARCH_SH7372)	+= pm-sh7372.o
 obj-$(CONFIG_ARCH_SH73A0)	+= pm-sh73a0.o
 obj-$(CONFIG_ARCH_R8A7740)	+= pm-r8a7740.o pm-rmobile.o
 obj-$(CONFIG_ARCH_R8A7779)	+= pm-r8a7779.o pm-rcar.o
+obj-$(CONFIG_ARCH_R8A7790)	+= pm-r8a7790.o pm-rcar.o
 
 # Board objects
 ifdef CONFIG_ARCH_SHMOBILE_MULTI
--- 0001/arch/arm/mach-shmobile/include/mach/r8a7790.h
+++ work/arch/arm/mach-shmobile/include/mach/r8a7790.h	2014-01-15 14:26:29.000000000 +0900
@@ -32,6 +32,7 @@ void r8a7790_add_standard_devices(void);
 void r8a7790_add_dt_devices(void);
 void r8a7790_clock_init(void);
 void r8a7790_pinmux_init(void);
+void r8a7790_pm_init(void);
 void r8a7790_init_early(void);
 extern struct smp_operations r8a7790_smp_ops;
 
--- /dev/null
+++ work/arch/arm/mach-shmobile/pm-r8a7790.c	2014-01-15 14:23:40.000000000 +0900
@@ -0,0 +1,45 @@
+/*
+ * r8a7790 Power management support
+ *
+ * Copyright (C) 2013  Renesas Electronics Corporation
+ * Copyright (C) 2011  Renesas Solutions Corp.
+ * Copyright (C) 2011  Magnus Damm
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <linux/kernel.h>
+#include <asm/io.h>
+#include <mach/pm-rcar.h>
+#include <mach/r8a7790.h>
+
+/* SYSC */
+#define SYSCIER 0x0c
+#define SYSCIMR 0x10
+
+#if defined(CONFIG_SMP)
+
+static void __init r8a7790_sysc_init(void)
+{
+	void __iomem *base = rcar_sysc_init(0xe6180000);
+
+	/* enable all interrupt sources, but do not use interrupt handler */
+	iowrite32(0x0131000e, base + SYSCIER);
+	iowrite32(0, base + SYSCIMR);
+}
+
+#else /* CONFIG_SMP */
+
+static inline void r8a7790_sysc_init(void) {}
+
+#endif /* CONFIG_SMP */
+
+void __init r8a7790_pm_init(void)
+{
+	static int once;
+
+	if (!once++)
+		r8a7790_sysc_init();
+}

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

* [PATCH 02/04] ARM: shmobile: r8a7790 CA7-SCU enablement
  2014-01-15 12:25 [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Magnus Damm
  2014-01-15 12:25 ` [PATCH 01/04] ARM: shmobile: r8a7790 SYSC " Magnus Damm
@ 2014-01-15 12:26 ` Magnus Damm
  2014-01-15 12:26 ` [PATCH 03/04] ARM: shmobile: r8a7790 CA15-SCU enablement Magnus Damm
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2014-01-15 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Gaku Inami <gaku.inami.xw@bp.renesas.com>

Power on CA7 SCU in case of booting from a CA15 core.

Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
[damm@opensource.se: Converted to use broken out SYSC code]
Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/smp-r8a7790.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

--- 0001/arch/arm/mach-shmobile/smp-r8a7790.c
+++ work/arch/arm/mach-shmobile/smp-r8a7790.c	2014-01-15 14:34:03.000000000 +0900
@@ -19,6 +19,8 @@
 #include <linux/io.h>
 #include <asm/smp_plat.h>
 #include <mach/common.h>
+#include <mach/pm-rcar.h>
+#include <mach/r8a7790.h>
 
 #define RST		0xe6160000
 #define CA15BAR		0x0020
@@ -27,6 +29,11 @@
 #define CA7RESCNT	0x0044
 #define MERAM		0xe8080000
 
+static struct rcar_sysc_ch r8a7790_ca7_scu = {
+	.chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
+	.isr_bit = 21, /* CA7-SCU */
+};
+
 static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
 {
 	void __iomem *p;
@@ -54,6 +61,10 @@ static void __init r8a7790_smp_prepare_c
 	writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000,
 		       p + CA7RESCNT);
 	iounmap(p);
+
+	/* turn on power to SCU */
+	r8a7790_pm_init();
+	rcar_sysc_power_up(&r8a7790_ca7_scu);
 }
 
 struct smp_operations r8a7790_smp_ops __initdata = {

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

* [PATCH 03/04] ARM: shmobile: r8a7790 CA15-SCU enablement
  2014-01-15 12:25 [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Magnus Damm
  2014-01-15 12:25 ` [PATCH 01/04] ARM: shmobile: r8a7790 SYSC " Magnus Damm
  2014-01-15 12:26 ` [PATCH 02/04] ARM: shmobile: r8a7790 CA7-SCU enablement Magnus Damm
@ 2014-01-15 12:26 ` Magnus Damm
  2014-01-15 12:26 ` [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration Magnus Damm
  2014-02-06  7:06 ` [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Simon Horman
  4 siblings, 0 replies; 7+ messages in thread
From: Magnus Damm @ 2014-01-15 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Keita Kobayashi <keita.kobayashi.ym@renesas.com>

Power on CA15 SCU in case of booting from a CA7 core.

Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
[damm@opensource.se: Converted to use broken out SYSC code]
Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/smp-r8a7790.c |    6 ++++++
 1 file changed, 6 insertions(+)

--- 0004/arch/arm/mach-shmobile/smp-r8a7790.c
+++ work/arch/arm/mach-shmobile/smp-r8a7790.c	2014-01-15 14:41:47.000000000 +0900
@@ -29,6 +29,11 @@
 #define CA7RESCNT	0x0044
 #define MERAM		0xe8080000
 
+static struct rcar_sysc_ch r8a7790_ca15_scu = {
+	.chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
+	.isr_bit = 12, /* CA15-SCU */
+};
+
 static struct rcar_sysc_ch r8a7790_ca7_scu = {
 	.chan_offs = 0x100, /* PWRSR3 .. PWRER3 */
 	.isr_bit = 21, /* CA7-SCU */
@@ -64,6 +69,7 @@ static void __init r8a7790_smp_prepare_c
 
 	/* turn on power to SCU */
 	r8a7790_pm_init();
+	rcar_sysc_power_up(&r8a7790_ca15_scu);
 	rcar_sysc_power_up(&r8a7790_ca7_scu);
 }
 

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

* [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration
  2014-01-15 12:25 [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Magnus Damm
                   ` (2 preceding siblings ...)
  2014-01-15 12:26 ` [PATCH 03/04] ARM: shmobile: r8a7790 CA15-SCU enablement Magnus Damm
@ 2014-01-15 12:26 ` Magnus Damm
  2014-01-15 14:01   ` Sudeep Holla
  2014-02-06  7:06 ` [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Simon Horman
  4 siblings, 1 reply; 7+ messages in thread
From: Magnus Damm @ 2014-01-15 12:26 UTC (permalink / raw)
  To: linux-arm-kernel

From: Gaku Inami <gaku.inami.xw@bp.renesas.com>

Add the settings of CCI-400 for enabling ca15/ca7 snoop on r8a7790.

Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/smp-r8a7790.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- 0005/arch/arm/mach-shmobile/smp-r8a7790.c
+++ work/arch/arm/mach-shmobile/smp-r8a7790.c	2014-01-15 15:40:56.000000000 +0900
@@ -28,6 +28,11 @@
 #define CA15RESCNT	0x0040
 #define CA7RESCNT	0x0044
 #define MERAM		0xe8080000
+#define CCI_BASE	0xf0090000
+#define CCI_SLAVE3	0x4000
+#define CCI_SLAVE4	0x5000
+#define CCI_SNOOP	0x0000
+#define CCI_STATUS	0x000c
 
 static struct rcar_sysc_ch r8a7790_ca15_scu = {
 	.chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
@@ -71,6 +76,16 @@ static void __init r8a7790_smp_prepare_c
 	r8a7790_pm_init();
 	rcar_sysc_power_up(&r8a7790_ca15_scu);
 	rcar_sysc_power_up(&r8a7790_ca7_scu);
+
+	/* enable snoop and DVM */
+	p = ioremap_nocache(CCI_BASE, 0x8000);
+	writel_relaxed(readl_relaxed(p + CCI_SLAVE3 + CCI_SNOOP) | 0x3,
+		p + CCI_SLAVE3 + CCI_SNOOP);    /* ca15 */
+	writel_relaxed(readl_relaxed(p + CCI_SLAVE4 + CCI_SNOOP) | 0x3,
+		p + CCI_SLAVE4 + CCI_SNOOP);    /* ca7 */
+	while (__raw_readl(p + CCI_STATUS));
+	/* wait for pending bit low */
+	iounmap(p);
 }
 
 struct smp_operations r8a7790_smp_ops __initdata = {

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

* Re: [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration
  2014-01-15 12:26 ` [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration Magnus Damm
@ 2014-01-15 14:01   ` Sudeep Holla
  0 siblings, 0 replies; 7+ messages in thread
From: Sudeep Holla @ 2014-01-15 14:01 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 15/01/14 12:26, Magnus Damm wrote:
> From: Gaku Inami <gaku.inami.xw@bp.renesas.com>
> 
> Add the settings of CCI-400 for enabling ca15/ca7 snoop on r8a7790.
> 
> Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  arch/arm/mach-shmobile/smp-r8a7790.c |   15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> --- 0005/arch/arm/mach-shmobile/smp-r8a7790.c
> +++ work/arch/arm/mach-shmobile/smp-r8a7790.c	2014-01-15 15:40:56.000000000 +0900
> @@ -28,6 +28,11 @@
>  #define CA15RESCNT	0x0040
>  #define CA7RESCNT	0x0044
>  #define MERAM		0xe8080000
> +#define CCI_BASE	0xf0090000
> +#define CCI_SLAVE3	0x4000
> +#define CCI_SLAVE4	0x5000
> +#define CCI_SNOOP	0x0000
> +#define CCI_STATUS	0x000c
>  
>  static struct rcar_sysc_ch r8a7790_ca15_scu = {
>  	.chan_offs = 0x180, /* PWRSR5 .. PWRER5 */
> @@ -71,6 +76,16 @@ static void __init r8a7790_smp_prepare_c
>  	r8a7790_pm_init();
>  	rcar_sysc_power_up(&r8a7790_ca15_scu);
>  	rcar_sysc_power_up(&r8a7790_ca7_scu);
> +
> +	/* enable snoop and DVM */
> +	p = ioremap_nocache(CCI_BASE, 0x8000);
> +	writel_relaxed(readl_relaxed(p + CCI_SLAVE3 + CCI_SNOOP) | 0x3,
> +		p + CCI_SLAVE3 + CCI_SNOOP);    /* ca15 */
> +	writel_relaxed(readl_relaxed(p + CCI_SLAVE4 + CCI_SNOOP) | 0x3,
> +		p + CCI_SLAVE4 + CCI_SNOOP);    /* ca7 */
> +	while (__raw_readl(p + CCI_STATUS));
> +	/* wait for pending bit low */
> +	iounmap(p);
>  }

I have mentioned this before, please use drivers/bus/arm-cci.c
That already does the job you need here and you need to use CCI DT bindings
for base address.

Regards,
Sudeep



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

* Re: [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code
  2014-01-15 12:25 [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Magnus Damm
                   ` (3 preceding siblings ...)
  2014-01-15 12:26 ` [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration Magnus Damm
@ 2014-02-06  7:06 ` Simon Horman
  4 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2014-02-06  7:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jan 15, 2014 at 09:25:39PM +0900, Magnus Damm wrote:
> ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code
> 
> [PATCH 01/04] ARM: shmobile: r8a7790 SYSC setup code
> [PATCH 02/04] ARM: shmobile: r8a7790 CA7-SCU enablement
> [PATCH 03/04] ARM: shmobile: r8a7790 CA15-SCU enablement

Thanks, I have queued up the above three patches.

> [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration

This one seems not quite ready.

> 
> Add r8a7790 specific SYSC, SCU and CCI setup code.
> 
> Signed-off-by: Hisashi Nakamura <hisashi.nakamura.ak@renesas.com>
> Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
> Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
> Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
> [damm@opensource.se: Converted to use broken out SYSC code]
> Signed-off-by: Magnus Damm <damm@opensource.se>
> ---
> 
>  Written against renesas.git tag renesas-devel-v3.13-rc8-20140115,
>  also requires "[PATCH] ARM: shmobile: Break out R-Car SYSC PM code"
> 
>  arch/arm/mach-shmobile/Makefile               |    1 
>  arch/arm/mach-shmobile/include/mach/r8a7790.h |    1 
>  arch/arm/mach-shmobile/pm-r8a7790.c           |   45 +++++++++++++++++++++++++
>  arch/arm/mach-shmobile/smp-r8a7790.c          |   32 +++++++++++++++++
>  4 files changed, 79 insertions(+)
> 

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

end of thread, other threads:[~2014-02-06  7:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 12:25 [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Magnus Damm
2014-01-15 12:25 ` [PATCH 01/04] ARM: shmobile: r8a7790 SYSC " Magnus Damm
2014-01-15 12:26 ` [PATCH 02/04] ARM: shmobile: r8a7790 CA7-SCU enablement Magnus Damm
2014-01-15 12:26 ` [PATCH 03/04] ARM: shmobile: r8a7790 CA15-SCU enablement Magnus Damm
2014-01-15 12:26 ` [PATCH 04/04] ARM: shmobile: r8a7790 CCI configuration Magnus Damm
2014-01-15 14:01   ` Sudeep Holla
2014-02-06  7:06 ` [PATCH 00/04] ARM: shmobile: r8a7790 SYSC, SCU and CCI setup code Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).