* [PATCH 01/14] ARM: shmobile: r8a7791 SYSC setup code
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 02/14] ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM Simon Horman
` (13 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
Add r8a7791 SYSC power management support.
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
[horms+renesas at verge.net.au: rebased]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/Makefile | 1 +
arch/arm/mach-shmobile/include/mach/r8a7791.h | 1 +
arch/arm/mach-shmobile/pm-r8a7791.c | 47 +++++++++++++++++++++++++++
arch/arm/mach-shmobile/smp-r8a7791.c | 2 ++
4 files changed, 51 insertions(+)
create mode 100644 arch/arm/mach-shmobile/pm-r8a7791.c
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 38d5fe8..9c0ad3e 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -53,6 +53,7 @@ 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
+obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o
# Board objects
ifdef CONFIG_ARCH_SHMOBILE_MULTI
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h
index 664274c..86eae7b 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7791.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h
@@ -5,6 +5,7 @@ void r8a7791_add_standard_devices(void);
void r8a7791_add_dt_devices(void);
void r8a7791_clock_init(void);
void r8a7791_pinmux_init(void);
+void r8a7791_pm_init(void);
extern struct smp_operations r8a7791_smp_ops;
#endif /* __ASM_R8A7791_H__ */
diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c
new file mode 100644
index 0000000..1519087
--- /dev/null
+++ b/arch/arm/mach-shmobile/pm-r8a7791.c
@@ -0,0 +1,47 @@
+/*
+ * r8a7791 Power management support
+ *
+ * Copyright (C) 2014 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 <asm/io.h>
+#include <linux/kernel.h>
+#include <mach/r8a7791.h>
+#include "pm-rcar.h"
+
+/* SYSC */
+#define SYSCIER 0x0c
+#define SYSCIMR 0x10
+
+#if defined(CONFIG_SMP)
+
+static void __init r8a7791_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 r8a7791_sysc_init(void) {}
+
+#endif /* CONFIG_SMP */
+
+void __init r8a7791_pm_init(void)
+{
+ static int once;
+
+ if (once++)
+ return;
+
+ r8a7791_sysc_init();
+}
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index 2648d68..1772086 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -50,6 +50,8 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
p + CA15RESCNT);
iounmap(p);
+
+ r8a7791_pm_init();
}
static int r8a7791_smp_boot_secondary(unsigned int cpu,
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 02/14] ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
2014-06-25 7:35 ` [PATCH 01/14] ARM: shmobile: r8a7791 SYSC setup code Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 03/14] ARM: shmobile: r8a7790: Support Core-Standby " Simon Horman
` (12 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
This patch add Core-Standby-state for Suspend to RAM.
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
[horms+renesas at verge.net.au: rebase]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/common.h | 2 ++
arch/arm/mach-shmobile/platsmp-apmu.c | 60 ++++++++++++++++++++++++++++++++---
2 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index f7a360e..8f0cd57 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -35,8 +35,10 @@ extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv);
#ifdef CONFIG_SUSPEND
int shmobile_suspend_init(void);
+void shmobile_smp_apmu_suspend_init(void);
#else
static inline int shmobile_suspend_init(void) { return 0; }
+static inline void shmobile_smp_apmu_suspend_init(void) { return 0; }
#endif
#ifdef CONFIG_CPU_IDLE
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c
index fe648f5..590e35c 100644
--- a/arch/arm/mach-shmobile/platsmp-apmu.c
+++ b/arch/arm/mach-shmobile/platsmp-apmu.c
@@ -7,15 +7,19 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+#include <linux/cpu_pm.h>
#include <linux/delay.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/of_address.h>
#include <linux/smp.h>
+#include <linux/suspend.h>
#include <asm/cacheflush.h>
#include <asm/cp15.h>
+#include <asm/proc-fns.h>
#include <asm/smp_plat.h>
+#include <asm/suspend.h>
#include "common.h"
static struct {
@@ -141,7 +145,7 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
return apmu_wrap(cpu, apmu_power_on);
}
-#ifdef CONFIG_HOTPLUG_CPU
+#if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND)
/* nicked from arch/arm/mach-exynos/hotplug.c */
static inline void cpu_enter_lowpower_a15(void)
{
@@ -172,16 +176,40 @@ static inline void cpu_enter_lowpower_a15(void)
dsb();
}
-void shmobile_smp_apmu_cpu_die(unsigned int cpu)
+void shmobile_smp_apmu_cpu_shutdown(unsigned int cpu)
{
- /* For this particular CPU deregister boot vector */
- shmobile_smp_hook(cpu, 0, 0);
/* Select next sleep mode using the APMU */
apmu_wrap(cpu, apmu_power_off);
/* Do ARM specific CPU shutdown */
cpu_enter_lowpower_a15();
+}
+
+static inline void cpu_leave_lowpower(void)
+{
+ unsigned int v;
+
+ asm volatile("mrc p15, 0, %0, c1, c0, 0\n"
+ " orr %0, %0, %1\n"
+ " mcr p15, 0, %0, c1, c0, 0\n"
+ " mrc p15, 0, %0, c1, c0, 1\n"
+ " orr %0, %0, %2\n"
+ " mcr p15, 0, %0, c1, c0, 1\n"
+ : "=&r" (v)
+ : "Ir" (CR_C), "Ir" (0x40)
+ : "cc");
+}
+#endif
+
+#if defined(CONFIG_HOTPLUG_CPU)
+void shmobile_smp_apmu_cpu_die(unsigned int cpu)
+{
+ /* For this particular CPU deregister boot vector */
+ shmobile_smp_hook(cpu, 0, 0);
+
+ /* Shutdown CPU core */
+ shmobile_smp_apmu_cpu_shutdown(cpu);
/* jump to shared mach-shmobile sleep / reset code */
shmobile_smp_sleep();
@@ -192,3 +220,27 @@ int shmobile_smp_apmu_cpu_kill(unsigned int cpu)
return apmu_wrap(cpu, apmu_power_off_poll);
}
#endif
+
+#if defined(CONFIG_SUSPEND)
+static int shmobile_smp_apmu_do_suspend(unsigned long cpu)
+{
+ shmobile_smp_hook(cpu, virt_to_phys(cpu_resume), 0);
+ shmobile_smp_apmu_cpu_shutdown(cpu);
+ cpu_do_idle(); /* WFI selects Core Standby */
+ return 1;
+}
+
+static int shmobile_smp_apmu_enter_suspend(suspend_state_t state)
+{
+ cpu_suspend(smp_processor_id(), shmobile_smp_apmu_do_suspend);
+ cpu_leave_lowpower();
+ return 0;
+}
+
+void shmobile_smp_apmu_suspend_init(void)
+{
+ shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend;
+}
+#else
+void shmobile_smp_apmu_suspend_init(void) {}
+#endif
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 03/14] ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
2014-06-25 7:35 ` [PATCH 01/14] ARM: shmobile: r8a7791 SYSC setup code Simon Horman
2014-06-25 7:35 ` [PATCH 02/14] ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 04/14] ARM: shmobile: r8a7791: " Simon Horman
` (11 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
Add r8a7790 Core-Standby state for Suspend to RAM support.
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/smp-r8a7790.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c
index a8ace58..7590e2b 100644
--- a/arch/arm/mach-shmobile/smp-r8a7790.c
+++ b/arch/arm/mach-shmobile/smp-r8a7790.c
@@ -69,6 +69,7 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus)
/* turn on power to SCU */
r8a7790_pm_init();
+ shmobile_smp_apmu_suspend_init();
rcar_sysc_power_up(&r8a7790_ca15_scu);
rcar_sysc_power_up(&r8a7790_ca7_scu);
}
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 04/14] ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (2 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 03/14] ARM: shmobile: r8a7790: Support Core-Standby " Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable Simon Horman
` (10 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: keita kobayashi <keita.kobayashi.ym@renesas.com>
Add r8a7791 Core-Standby state for Suspend to RAM support.
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/smp-r8a7791.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
index 1772086..c6543b6 100644
--- a/arch/arm/mach-shmobile/smp-r8a7791.c
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -52,6 +52,7 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
iounmap(p);
r8a7791_pm_init();
+ shmobile_smp_apmu_suspend_init();
}
static int r8a7791_smp_boot_secondary(unsigned int cpu,
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (3 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 04/14] ARM: shmobile: r8a7791: " Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 8:56 ` Viresh Kumar
2014-06-25 7:35 ` [PATCH 06/14] ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only Simon Horman
` (9 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Benoit Cousson <bcousson@baylibre.com>
Mark all SoCs in shmobile as CPUFreq capable
on multiplatform build only.
Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/Kconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index dbd954e..c32fa7c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -12,6 +12,8 @@ config ARCH_SHMOBILE_MULTI
select NO_IOPORT_MAP
select PINCTRL
select ARCH_REQUIRE_GPIOLIB
+ select ARCH_HAS_CPUFREQ
+ select ARCH_HAS_OPP
if ARCH_SHMOBILE_MULTI
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 7:35 ` [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable Simon Horman
@ 2014-06-25 8:56 ` Viresh Kumar
2014-06-25 9:26 ` Simon Horman
0 siblings, 1 reply; 27+ messages in thread
From: Viresh Kumar @ 2014-06-25 8:56 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 25, 2014 at 1:05 PM, Simon Horman
<horms+renesas@verge.net.au> wrote:
> From: Benoit Cousson <bcousson@baylibre.com>
>
> Mark all SoCs in shmobile as CPUFreq capable
> on multiplatform build only.
>
> Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
> [gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
> Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> arch/arm/mach-shmobile/Kconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> index dbd954e..c32fa7c 100644
> --- a/arch/arm/mach-shmobile/Kconfig
> +++ b/arch/arm/mach-shmobile/Kconfig
> @@ -12,6 +12,8 @@ config ARCH_SHMOBILE_MULTI
> select NO_IOPORT_MAP
> select PINCTRL
> select ARCH_REQUIRE_GPIOLIB
> + select ARCH_HAS_CPUFREQ
> + select ARCH_HAS_OPP
https://lkml.org/lkml/2014/6/2/714
http://patchwork.ozlabs.org/patch/356780/
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 8:56 ` Viresh Kumar
@ 2014-06-25 9:26 ` Simon Horman
2014-06-25 9:30 ` Viresh Kumar
2014-06-26 1:48 ` Gaku Inami
0 siblings, 2 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 9:26 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 25, 2014 at 02:26:24PM +0530, Viresh Kumar wrote:
> On Wed, Jun 25, 2014 at 1:05 PM, Simon Horman
> <horms+renesas@verge.net.au> wrote:
> > From: Benoit Cousson <bcousson@baylibre.com>
> >
> > Mark all SoCs in shmobile as CPUFreq capable
> > on multiplatform build only.
> >
> > Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
> > [gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
> > Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> > arch/arm/mach-shmobile/Kconfig | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
> > index dbd954e..c32fa7c 100644
> > --- a/arch/arm/mach-shmobile/Kconfig
> > +++ b/arch/arm/mach-shmobile/Kconfig
> > @@ -12,6 +12,8 @@ config ARCH_SHMOBILE_MULTI
> > select NO_IOPORT_MAP
> > select PINCTRL
> > select ARCH_REQUIRE_GPIOLIB
> > + select ARCH_HAS_CPUFREQ
> > + select ARCH_HAS_OPP
>
> https://lkml.org/lkml/2014/6/2/714
> http://patchwork.ozlabs.org/patch/356780/
I believe this patch was queued up before those patches hit Linus's tree.
In the case of ARCH_HAS_CPUFREQ, a subsequent patch in
this pull-request, "ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile",
removes it.
Inami-san, could you see about making a patch to remove ARCH_HAS_OPP too?
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 9:26 ` Simon Horman
@ 2014-06-25 9:30 ` Viresh Kumar
2014-06-25 11:38 ` Simon Horman
2014-06-26 1:48 ` Gaku Inami
1 sibling, 1 reply; 27+ messages in thread
From: Viresh Kumar @ 2014-06-25 9:30 UTC (permalink / raw)
To: linux-arm-kernel
On 25 June 2014 14:56, Simon Horman <horms@verge.net.au> wrote:
> In the case of ARCH_HAS_CPUFREQ, a subsequent patch in
> this pull-request, "ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile",
> removes it.
Hmm.. I fail to see why you are adding it in the first place then ?
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 9:30 ` Viresh Kumar
@ 2014-06-25 11:38 ` Simon Horman
2014-06-25 11:39 ` Viresh Kumar
0 siblings, 1 reply; 27+ messages in thread
From: Simon Horman @ 2014-06-25 11:38 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 25, 2014 at 03:00:08PM +0530, Viresh Kumar wrote:
> On 25 June 2014 14:56, Simon Horman <horms@verge.net.au> wrote:
> > In the case of ARCH_HAS_CPUFREQ, a subsequent patch in
> > this pull-request, "ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile",
> > removes it.
>
> Hmm.. I fail to see why you are adding it in the first place then ?
Because it seemed to be right thing to do when the patch was written
and accepted.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 11:38 ` Simon Horman
@ 2014-06-25 11:39 ` Viresh Kumar
2014-06-25 12:23 ` Simon Horman
0 siblings, 1 reply; 27+ messages in thread
From: Viresh Kumar @ 2014-06-25 11:39 UTC (permalink / raw)
To: linux-arm-kernel
On 25 June 2014 17:08, Simon Horman <horms@verge.net.au> wrote:
> Because it seemed to be right thing to do when the patch was written
> and accepted.
But it isn't merged yet, just drop irrelevant patches. Wouldn't make any
sense to get these into kernel.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 11:39 ` Viresh Kumar
@ 2014-06-25 12:23 ` Simon Horman
0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 12:23 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 25, 2014 at 05:09:59PM +0530, Viresh Kumar wrote:
> On 25 June 2014 17:08, Simon Horman <horms@verge.net.au> wrote:
> > Because it seemed to be right thing to do when the patch was written
> > and accepted.
>
> But it isn't merged yet, just drop irrelevant patches. Wouldn't make any
> sense to get these into kernel.
Its been sitting in next and as I understand things it is
frowned upon to rebase branches that are in next unless
it is really necessary.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
2014-06-25 9:26 ` Simon Horman
2014-06-25 9:30 ` Viresh Kumar
@ 2014-06-26 1:48 ` Gaku Inami
1 sibling, 0 replies; 27+ messages in thread
From: Gaku Inami @ 2014-06-26 1:48 UTC (permalink / raw)
To: linux-arm-kernel
Hi Simon-san,
(2014/06/25 18:26), Simon Horman wrote:
> On Wed, Jun 25, 2014 at 02:26:24PM +0530, Viresh Kumar wrote:
>> On Wed, Jun 25, 2014 at 1:05 PM, Simon Horman
>> <horms+renesas@verge.net.au> wrote:
>>> From: Benoit Cousson <bcousson@baylibre.com>
>>>
>>> Mark all SoCs in shmobile as CPUFreq capable
>>> on multiplatform build only.
>>>
>>> Signed-off-by: Benoit Cousson <bcousson@baylibre.com>
>>> [gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
>>> Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
>>> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>>> ---
>>> arch/arm/mach-shmobile/Kconfig | 2 ++
>>> 1 file changed, 2 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
>>> index dbd954e..c32fa7c 100644
>>> --- a/arch/arm/mach-shmobile/Kconfig
>>> +++ b/arch/arm/mach-shmobile/Kconfig
>>> @@ -12,6 +12,8 @@ config ARCH_SHMOBILE_MULTI
>>> select NO_IOPORT_MAP
>>> select PINCTRL
>>> select ARCH_REQUIRE_GPIOLIB
>>> + select ARCH_HAS_CPUFREQ
>>> + select ARCH_HAS_OPP
>> https://lkml.org/lkml/2014/6/2/714
>> http://patchwork.ozlabs.org/patch/356780/
> I believe this patch was queued up before those patches hit Linus's tree.
>
> In the case of ARCH_HAS_CPUFREQ, a subsequent patch in
> this pull-request, "ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile",
> removes it.
>
> Inami-san, could you see about making a patch to remove ARCH_HAS_OPP too?
Sorry for late reply. I posted this patch to linux-sh ML on May 29.
At that time, I couldn't see a patch to remove ARCH_HAS_CPUFREQ.
However, I should have noticed this modification earlier.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 06/14] ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (4 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 05/14] ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 07/14] ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only Simon Horman
` (8 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm+renesas@opensource.se>
Tie in shmobile_init_late for the DT-only r8a7790 SoC
Multiplatform support code. This will make sure that
Suspend-to-RAM, CPUIdle and CPUFreq get initialized.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/setup-r8a7790.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 4212c8d..516b4e4 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -326,6 +326,7 @@ DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
.smp = smp_ops(r8a7790_smp_ops),
.init_early = r8a7790_init_early,
.init_time = rcar_gen2_timer_init,
+ .init_late = shmobile_init_late,
.dt_compat = r8a7790_boards_compat_dt,
MACHINE_END
#endif /* CONFIG_USE_OF */
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 07/14] ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (5 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 06/14] ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code Simon Horman
` (7 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm+renesas@opensource.se>
Tie in shmobile_init_late for the DT-only r8a7791 SoC
Multiplatform support code. This will make sure that
Suspend-to-RAM, CPUIdle and CPUFreq get initialized.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/setup-r8a7791.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index f554cda..9e16b1d 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -217,6 +217,7 @@ DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
.smp = smp_ops(r8a7791_smp_ops),
.init_early = shmobile_init_delay,
.init_time = rcar_gen2_timer_init,
+ .init_late = shmobile_init_late,
.dt_compat = r8a7791_boards_compat_dt,
MACHINE_END
#endif /* CONFIG_USE_OF */
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (6 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 07/14] ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 15:18 ` Sergei Shtylyov
2014-06-25 7:35 ` [PATCH 09/14] ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update Simon Horman
` (6 subsequent siblings)
14 siblings, 1 reply; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Magnus Damm <damm+renesas@opensource.se>
Add R-Car Gen2 CMA memory reservation code that can be
shared between multiple SoCs and boards. At this point
r8a7790 and r8a7791 are supported.
The top 256MiB of the legacy 32-bit physical memory space
is assigned to a separate CMA area that may be assigned
to various devices later on.
Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
[horms+renesas at verge.net.au: rebased]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/rcar-gen2.h | 1 +
arch/arm/mach-shmobile/setup-r8a7790.c | 1 +
arch/arm/mach-shmobile/setup-r8a7791.c | 1 +
arch/arm/mach-shmobile/setup-rcar-gen2.c | 3 +++
4 files changed, 6 insertions(+)
diff --git a/arch/arm/mach-shmobile/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h
index 43f606e..ce53cb5 100644
--- a/arch/arm/mach-shmobile/rcar-gen2.h
+++ b/arch/arm/mach-shmobile/rcar-gen2.h
@@ -4,5 +4,6 @@
void rcar_gen2_timer_init(void);
#define MD(nr) BIT(nr)
u32 rcar_gen2_read_mode_pins(void);
+void rcar_gen2_reserve(void);
#endif /* __ASM_RCAR_GEN2_H__ */
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 516b4e4..e190768 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -327,6 +327,7 @@ DT_MACHINE_START(R8A7790_DT, "Generic R8A7790 (Flattened Device Tree)")
.init_early = r8a7790_init_early,
.init_time = rcar_gen2_timer_init,
.init_late = shmobile_init_late,
+ .reserve = rcar_gen2_reserve,
.dt_compat = r8a7790_boards_compat_dt,
MACHINE_END
#endif /* CONFIG_USE_OF */
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 9e16b1d..7e970d0 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -218,6 +218,7 @@ DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
.init_early = shmobile_init_delay,
.init_time = rcar_gen2_timer_init,
.init_late = shmobile_init_late,
+ .reserve = rcar_gen2_reserve,
.dt_compat = r8a7791_boards_compat_dt,
MACHINE_END
#endif /* CONFIG_USE_OF */
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index fdc714e..544b9bf 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -20,8 +20,11 @@
#include <linux/clk/shmobile.h>
#include <linux/clocksource.h>
+#include <linux/device.h>
+#include <linux/dma-contiguous.h>
#include <linux/io.h>
#include <linux/kernel.h>
+#include <linux/of_fdt.h>
#include <asm/mach/arch.h>
#include "common.h"
#include "rcar-gen2.h"
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
2014-06-25 7:35 ` [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code Simon Horman
@ 2014-06-25 15:18 ` Sergei Shtylyov
2014-06-25 23:47 ` Simon Horman
0 siblings, 1 reply; 27+ messages in thread
From: Sergei Shtylyov @ 2014-06-25 15:18 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 06/25/2014 11:35 AM, Simon Horman wrote:
> From: Magnus Damm <damm+renesas@opensource.se>
> Add R-Car Gen2 CMA memory reservation code that can be
> shared between multiple SoCs and boards. At this point
> r8a7790 and r8a7791 are supported.
> The top 256MiB of the legacy 32-bit physical memory space
> is assigned to a separate CMA area that may be assigned
> to various devices later on.
> Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> [horms+renesas at verge.net.au: rebased]
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
[...]
> diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
> index fdc714e..544b9bf 100644
> --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
> +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
> @@ -20,8 +20,11 @@
>
> #include <linux/clk/shmobile.h>
> #include <linux/clocksource.h>
> +#include <linux/device.h>
> +#include <linux/dma-contiguous.h>
> #include <linux/io.h>
> #include <linux/kernel.h>
> +#include <linux/of_fdt.h>
> #include <asm/mach/arch.h>
> #include "common.h"
> #include "rcar-gen2.h"
Hm, this part looks incomplete. I thought you were going to add CMA code here?
WBR, Sergei
^ permalink raw reply [flat|nested] 27+ messages in thread* [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
2014-06-25 15:18 ` Sergei Shtylyov
@ 2014-06-25 23:47 ` Simon Horman
2014-06-26 0:19 ` Simon Horman
0 siblings, 1 reply; 27+ messages in thread
From: Simon Horman @ 2014-06-25 23:47 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 25, 2014 at 07:18:09PM +0400, Sergei Shtylyov wrote:
> Hello.
>
> On 06/25/2014 11:35 AM, Simon Horman wrote:
>
> >From: Magnus Damm <damm+renesas@opensource.se>
>
> >Add R-Car Gen2 CMA memory reservation code that can be
> >shared between multiple SoCs and boards. At this point
> >r8a7790 and r8a7791 are supported.
>
> >The top 256MiB of the legacy 32-bit physical memory space
> >is assigned to a separate CMA area that may be assigned
> >to various devices later on.
>
> >Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> >[horms+renesas at verge.net.au: rebased]
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
> [...]
>
> >diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
> >index fdc714e..544b9bf 100644
> >--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
> >+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
> >@@ -20,8 +20,11 @@
> >
> > #include <linux/clk/shmobile.h>
> > #include <linux/clocksource.h>
> >+#include <linux/device.h>
> >+#include <linux/dma-contiguous.h>
> > #include <linux/io.h>
> > #include <linux/kernel.h>
> >+#include <linux/of_fdt.h>
> > #include <asm/mach/arch.h>
> > #include "common.h"
> > #include "rcar-gen2.h"
>
> Hm, this part looks incomplete. I thought you were going to add CMA code here?
Thanks, something does indeed seem to have gone wrong there.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
2014-06-25 23:47 ` Simon Horman
@ 2014-06-26 0:19 ` Simon Horman
0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-26 0:19 UTC (permalink / raw)
To: linux-arm-kernel
[Cc Olof]
On Thu, Jun 26, 2014 at 08:47:08AM +0900, Simon Horman wrote:
> On Wed, Jun 25, 2014 at 07:18:09PM +0400, Sergei Shtylyov wrote:
> > Hello.
> >
> > On 06/25/2014 11:35 AM, Simon Horman wrote:
> >
> > >From: Magnus Damm <damm+renesas@opensource.se>
> >
> > >Add R-Car Gen2 CMA memory reservation code that can be
> > >shared between multiple SoCs and boards. At this point
> > >r8a7790 and r8a7791 are supported.
> >
> > >The top 256MiB of the legacy 32-bit physical memory space
> > >is assigned to a separate CMA area that may be assigned
> > >to various devices later on.
> >
> > >Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
> > >[horms+renesas at verge.net.au: rebased]
> > >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >
> > [...]
> >
> > >diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
> > >index fdc714e..544b9bf 100644
> > >--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
> > >+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
> > >@@ -20,8 +20,11 @@
> > >
> > > #include <linux/clk/shmobile.h>
> > > #include <linux/clocksource.h>
> > >+#include <linux/device.h>
> > >+#include <linux/dma-contiguous.h>
> > > #include <linux/io.h>
> > > #include <linux/kernel.h>
> > >+#include <linux/of_fdt.h>
> > > #include <asm/mach/arch.h>
> > > #include "common.h"
> > > #include "rcar-gen2.h"
> >
> > Hm, this part looks incomplete. I thought you were going to add CMA code here?
>
> Thanks, something does indeed seem to have gone wrong there.
I suspect that this is the result of an error on my part when I rebased
the code on top of v3.16-rc1 before making it available to next.
The missing code appears to lie in "ARM: shmobile: rcar-gen2: Update for
of_get_flat_dt_prop() update".
Olof, I'd prefer not to rebase my branches in next. But if you'd like
me to do so to clean up this problem then let me know.
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 09/14] ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (7 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 08/14] ARM: shmobile: Add shared R-Car Gen2 CMA reservation code Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 10/14] ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1" Simon Horman
` (5 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Geert Uytterhoeven <geert+renesas@glider.be>
Commit 9d0c4dfedd96ee54fc075b16d02f82499c8cc3a6 ("of/fdt: update
of_get_flat_dt_prop in prep for libfdt") changed the function prototypes
of of_get_flat_dt_prop():
- The return type was made const,
- The last parameter was changed from "unsigned long *" to "int *".
and dt_mem_next_cell():
- The second parameter was made const.
This causes the following compiler warnings:
arch/arm/mach-shmobile/setup-rcar-gen2.c: In function 'rcar_gen2_scan_mem':
arch/arm/mach-shmobile/setup-rcar-gen2.c:125:15: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
arch/arm/mach-shmobile/setup-rcar-gen2.c:142:2: warning: passing argument 3 of 'of_get_flat_dt_prop' from incompatible pointer type [enabled by default]
include/linux/of_fdt.h:53:20: note: expected 'int *' but argument is of type 'long unsigned int *'
arch/arm/mach-shmobile/setup-rcar-gen2.c:142:6: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
arch/arm/mach-shmobile/setup-rcar-gen2.c:144:3: warning: passing argument 3 of 'of_get_flat_dt_prop' from incompatible pointer type [enabled by default]
include/linux/of_fdt.h:53:20: note: expected 'int *' but argument is of type 'long unsigned int *'
arch/arm/mach-shmobile/setup-rcar-gen2.c:144:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
arch/arm/mach-shmobile/setup-rcar-gen2.c:152:3: warning: passing argument 2 of 'dt_mem_next_cell' from incompatible pointer type [enabled by default]
include/linux/of_fdt.h:69:12: note: expected 'const __be32 **' but argument is of type '__be32 **'
arch/arm/mach-shmobile/setup-rcar-gen2.c:153:3: warning: passing argument 2 of 'dt_mem_next_cell' from incompatible pointer type [enabled by default]
include/linux/of_fdt.h:69:12: note: expected 'const __be32 **' but argument is of type '__be32 **'
Update the variable types in rcar_gen2_scan_mem() to fix this.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
[horms+renesas at verge.net.au: rebased]
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/setup-rcar-gen2.c | 76 ++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 544b9bf..b0626f8 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -113,3 +113,79 @@ void __init rcar_gen2_timer_init(void)
#endif
clocksource_of_init();
}
+
+struct memory_reserve_config {
+ u64 reserved;
+ u64 base, size;
+};
+
+static int __init rcar_gen2_scan_mem(unsigned long node, const char *uname,
+ int depth, void *data)
+{
+ const char *type = of_get_flat_dt_prop(node, "device_type", NULL);
+ const __be32 *reg, *endp;
+ int l;
+ struct memory_reserve_config *mrc = data;
+ u64 lpae_start = (u64)1 << 32;
+
+ /* We are scanning "memory" nodes only */
+ if (type == NULL) {
+ /*
+ * The longtrail doesn't have a device_type on the
+ * /memory node, so look for the node called /memory at 0.
+ */
+ if (depth != 1 || strcmp(uname, "memory@0") != 0)
+ return 0;
+ } else if (strcmp(type, "memory") != 0)
+ return 0;
+
+ reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
+ if (reg == NULL)
+ reg = of_get_flat_dt_prop(node, "reg", &l);
+ if (reg == NULL)
+ return 0;
+
+ endp = reg + (l / sizeof(__be32));
+ while ((endp - reg) >= (dt_root_addr_cells + dt_root_size_cells)) {
+ u64 base, size;
+
+ base = dt_mem_next_cell(dt_root_addr_cells, ®);
+ size = dt_mem_next_cell(dt_root_size_cells, ®);
+
+ if (base >= lpae_start)
+ continue;
+
+ if ((base + size) >= lpae_start)
+ size = lpae_start - base;
+
+ if (size < mrc->reserved)
+ continue;
+
+ if (base < mrc->base)
+ continue;
+
+ /* keep the area at top near the 32-bit legacy limit */
+ mrc->base = base + size - mrc->reserved;
+ mrc->size = mrc->reserved;
+ }
+
+ return 0;
+}
+
+struct cma *rcar_gen2_dma_contiguous;
+
+void __init rcar_gen2_reserve(void)
+{
+ struct memory_reserve_config mrc;
+
+ /* reserve 256 MiB at the top of the physical legacy 32-bit space */
+ memset(&mrc, 0, sizeof(mrc));
+ mrc.reserved = SZ_256M;
+
+ of_scan_flat_dt(rcar_gen2_scan_mem, &mrc);
+#ifdef CONFIG_DMA_CMA
+ if (mrc.size)
+ dma_contiguous_reserve_area(mrc.size, mrc.base, 0,
+ &rcar_gen2_dma_contiguous);
+#endif
+}
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 10/14] ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (8 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 09/14] ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 11/14] ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail Simon Horman
` (4 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Geert Uytterhoeven <geert+renesas@glider.be>
Casts are evil
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index b0626f8..51d5723 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -126,7 +126,7 @@ static int __init rcar_gen2_scan_mem(unsigned long node, const char *uname,
const __be32 *reg, *endp;
int l;
struct memory_reserve_config *mrc = data;
- u64 lpae_start = (u64)1 << 32;
+ u64 lpae_start = 1ULL << 32;
/* We are scanning "memory" nodes only */
if (type == NULL) {
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 11/14] ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (9 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 10/14] ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1" Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 12/14] ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init Simon Horman
` (3 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Geert Uytterhoeven <geert+renesas@glider.be>
Open Firmware in the CHRP LongTrail does not support plugging in ARM CPUs
in its PPC 603e/604e-compatible CPU socket ;-)
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/setup-rcar-gen2.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 51d5723..73fb2a6 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -129,14 +129,7 @@ static int __init rcar_gen2_scan_mem(unsigned long node, const char *uname,
u64 lpae_start = 1ULL << 32;
/* We are scanning "memory" nodes only */
- if (type == NULL) {
- /*
- * The longtrail doesn't have a device_type on the
- * /memory node, so look for the node called /memory at 0.
- */
- if (depth != 1 || strcmp(uname, "memory@0") != 0)
- return 0;
- } else if (strcmp(type, "memory") != 0)
+ if (type == NULL || strcmp(type, "memory"))
return 0;
reg = of_get_flat_dt_prop(node, "linux,usable-memory", &l);
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 12/14] ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (10 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 11/14] ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 13/14] ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area Simon Horman
` (2 subsequent siblings)
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
The dummy shmobile_smp_apmu_suspend_init() function provided when
CPU_IDLE is not set should not return a value as per the signature
of the function.
This problem appears to have been introduced by
867ba81f728f1daa ("ARM: shmobile: APMU: Add Core-Standby-state for Suspend
to RAM").
Cc: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h
index 8f0cd57..1e81199 100644
--- a/arch/arm/mach-shmobile/common.h
+++ b/arch/arm/mach-shmobile/common.h
@@ -38,7 +38,7 @@ int shmobile_suspend_init(void);
void shmobile_smp_apmu_suspend_init(void);
#else
static inline int shmobile_suspend_init(void) { return 0; }
-static inline void shmobile_smp_apmu_suspend_init(void) { return 0; }
+static inline void shmobile_smp_apmu_suspend_init(void) { }
#endif
#ifdef CONFIG_CPU_IDLE
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 13/14] ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (11 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 12/14] ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-06-25 7:35 ` [PATCH 14/14] ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile Simon Horman
2014-07-08 5:07 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Olof Johansson
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Vincent Stehl? <vincent.stehle@laposte.net>
Commit 5ea3b1b2f8ad 'cma: add placement specifier for "cma=" kernel parameter'
adds a new 'fixed' parameter to dma_contiguous_reserve_area(). Update
rcar_gen2_reserve() accordingly.
This fixes the following compilation error:
arch/arm/mach-shmobile/setup-rcar-gen2.c: In function ?rcar_gen2_reserve?:
arch/arm/mach-shmobile/setup-rcar-gen2.c:182:10: error: too few arguments to function ?dma_contiguous_reserve_area?
Signed-off-by: Vincent Stehl? <vincent.stehle@laposte.net>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c
index 73fb2a6..42d5b43 100644
--- a/arch/arm/mach-shmobile/setup-rcar-gen2.c
+++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c
@@ -179,6 +179,6 @@ void __init rcar_gen2_reserve(void)
#ifdef CONFIG_DMA_CMA
if (mrc.size)
dma_contiguous_reserve_area(mrc.size, mrc.base, 0,
- &rcar_gen2_dma_contiguous);
+ &rcar_gen2_dma_contiguous, true);
#endif
}
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH 14/14] ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (12 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 13/14] ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area Simon Horman
@ 2014-06-25 7:35 ` Simon Horman
2014-07-08 5:07 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Olof Johansson
14 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-06-25 7:35 UTC (permalink / raw)
To: linux-arm-kernel
From: Gaku Inami <gaku.inami.xw@bp.renesas.com>
The following commit has removed ARCH_HAS_CPUFREQ config:
Commit: e49d9b375628e67c9a718f4befaa8e45e5fad21b
Subject: ARM: Remove ARCH_HAS_CPUFREQ config option
This patch removes the code that is using ARCH_HAS_CPUFREQ
in mach-shmobile.
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
arch/arm/mach-shmobile/Kconfig | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index c32fa7c..cbc90f1 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -12,7 +12,6 @@ config ARCH_SHMOBILE_MULTI
select NO_IOPORT_MAP
select PINCTRL
select ARCH_REQUIRE_GPIOLIB
- select ARCH_HAS_CPUFREQ
select ARCH_HAS_OPP
if ARCH_SHMOBILE_MULTI
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 27+ messages in thread* [GIT PULL] Renesas ARM Based SoC Updates for v3.17
2014-06-25 7:35 [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Simon Horman
` (13 preceding siblings ...)
2014-06-25 7:35 ` [PATCH 14/14] ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile Simon Horman
@ 2014-07-08 5:07 ` Olof Johansson
2014-07-11 9:40 ` Simon Horman
14 siblings, 1 reply; 27+ messages in thread
From: Olof Johansson @ 2014-07-08 5:07 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jun 25, 2014 at 04:35:24PM +0900, Simon Horman wrote:
> Hi Olof, Hi Kevin, Hi Arnd,
>
> Please consider these Renesas ARM based SoC updates for v3.17.
>
> This pull request is based on 'Renesas ARM Based SoC Header Cleanup for v3.17',
> tagged as header-cleanup-for-v3.17, which I have already sent a
> pull-request for.
>
> The following changes since commit 62872989bdbf1245d7239b9f4c05a8ee7c775ed5:
>
> ARM: shmobile: Move rcar-gen2.h, cleanup r8a7790 case (2014-06-17 17:09:40 +0900)
>
> are available in the git repository at:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.17
>
> for you to fetch changes up to 3ed66ec5ced8b801cb851b2b8548301df94f8f54:
>
> ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile (2014-06-23 09:53:55 +0900)
>
> ----------------------------------------------------------------
> Renesas ARM Based SoC Updates for v3.17
>
> * Use shmobile_init_late on r8a7791 and r8a7790 whien booting using DT-only
> * Support Core-Standby for Suspend to RAM on r8a7791 and r8a7790 SoCs
> * Shared CMA reservation for R-Car Gen2 SoCs
> * Add r8a7791 SYSC power management support
This branch also seems to contain a bunch of bugfixes? Did they get merged into
the wrong base, or what's going on?
> Benoit Cousson (1):
> ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
>
> Gaku Inami (1):
> ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile
The latter patch fixes the former, why not just fold them in?
> Geert Uytterhoeven (3):
> ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update
> ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"
> ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail
The last two seem to be small bug fixes/cleanups. They should probably go in a
cleanup branch unless there are conflicts with new development. Even then, we
tend to prefer to order it with the cleanups/fixes before new development
(where it doesn't cause extra complications).
>
> Magnus Damm (3):
> ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only
> ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only
> ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
>
> Simon Horman (1):
> ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init
>
> Vincent Stehl? (1):
> ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area
Again those two patches seem to be fixes, the former to a patch in this very
branch.
> keita kobayashi (4):
> ARM: shmobile: r8a7791 SYSC setup code
> ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM
> ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM
> ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM
Anyway, I've merged it in as it is. Keep some of the above stuff in mind
for future releases though.
-Olof
^ permalink raw reply [flat|nested] 27+ messages in thread* [GIT PULL] Renesas ARM Based SoC Updates for v3.17
2014-07-08 5:07 ` [GIT PULL] Renesas ARM Based SoC Updates for v3.17 Olof Johansson
@ 2014-07-11 9:40 ` Simon Horman
0 siblings, 0 replies; 27+ messages in thread
From: Simon Horman @ 2014-07-11 9:40 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Jul 07, 2014 at 10:07:08PM -0700, Olof Johansson wrote:
> On Wed, Jun 25, 2014 at 04:35:24PM +0900, Simon Horman wrote:
> > Hi Olof, Hi Kevin, Hi Arnd,
> >
> > Please consider these Renesas ARM based SoC updates for v3.17.
> >
> > This pull request is based on 'Renesas ARM Based SoC Header Cleanup for v3.17',
> > tagged as header-cleanup-for-v3.17, which I have already sent a
> > pull-request for.
> >
> > The following changes since commit 62872989bdbf1245d7239b9f4c05a8ee7c775ed5:
> >
> > ARM: shmobile: Move rcar-gen2.h, cleanup r8a7790 case (2014-06-17 17:09:40 +0900)
> >
> > are available in the git repository at:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git renesas-soc-for-v3.17
> >
> > for you to fetch changes up to 3ed66ec5ced8b801cb851b2b8548301df94f8f54:
> >
> > ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile (2014-06-23 09:53:55 +0900)
> >
> > ----------------------------------------------------------------
> > Renesas ARM Based SoC Updates for v3.17
> >
> > * Use shmobile_init_late on r8a7791 and r8a7790 whien booting using DT-only
> > * Support Core-Standby for Suspend to RAM on r8a7791 and r8a7790 SoCs
> > * Shared CMA reservation for R-Car Gen2 SoCs
> > * Add r8a7791 SYSC power management support
>
> This branch also seems to contain a bunch of bugfixes? Did they get merged into
> the wrong base, or what's going on?
>
> > Benoit Cousson (1):
> > ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
> >
> > Gaku Inami (1):
> > ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile
>
> The latter patch fixes the former, why not just fold them in?
>
> > Geert Uytterhoeven (3):
> > ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update
> > ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"
> > ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail
>
> The last two seem to be small bug fixes/cleanups. They should probably go in a
> cleanup branch unless there are conflicts with new development. Even then, we
> tend to prefer to order it with the cleanups/fixes before new development
> (where it doesn't cause extra complications).
>
> >
> > Magnus Damm (3):
> > ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only
> > ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only
> > ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
> >
> > Simon Horman (1):
> > ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init
> >
> > Vincent Stehl? (1):
> > ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area
>
> Again those two patches seem to be fixes, the former to a patch in this very
> branch.
>
> > keita kobayashi (4):
> > ARM: shmobile: r8a7791 SYSC setup code
> > ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM
> > ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM
> > ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM
>
> Anyway, I've merged it in as it is. Keep some of the above stuff in mind
> for future releases though.
Thanks, I will try to tune my processes to produce cleaner branches for you.
^ permalink raw reply [flat|nested] 27+ messages in thread