Skip to contentSkip to conversation

Renesas ARM Based SoC Updates for v3.17

GIT PULL New Simon Horman 6 participants 27 messages Jun 25, 2014 – Jul 11, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

----------------------------------------------------------------
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

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

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

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

 arch/arm/mach-shmobile/Kconfig                |  1 +
 arch/arm/mach-shmobile/Makefile               |  1 +
 arch/arm/mach-shmobile/common.h               |  2 +
 arch/arm/mach-shmobile/include/mach/r8a7791.h |  1 +
 arch/arm/mach-shmobile/platsmp-apmu.c         | 60 ++++++++++++++++++++--
 arch/arm/mach-shmobile/pm-r8a7791.c           | 47 +++++++++++++++++
 arch/arm/mach-shmobile/rcar-gen2.h            |  1 +
 arch/arm/mach-shmobile/setup-r8a7790.c        |  2 +
 arch/arm/mach-shmobile/setup-r8a7791.c        |  2 +
 arch/arm/mach-shmobile/setup-rcar-gen2.c      | 72 +++++++++++++++++++++++++++
 arch/arm/mach-shmobile/smp-r8a7790.c          |  1 +
 arch/arm/mach-shmobile/smp-r8a7791.c          |  3 ++
 12 files changed, 189 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-shmobile/pm-r8a7791.c
#1 lore raw

PATCH 1/14 ARM: shmobile: r8a7791 SYSC setup code

From: keita kobayashi <[email protected]>

Add r8a7791 SYSC power management support.

[horms+renesas at verge.net.au: rebased]
---
 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
arch/arm/mach-shmobile/Makefile +1 -0
index 38d5fe8..9c0ad3e 100644
@@ -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
arch/arm/mach-shmobile/include/mach/r8a7791.h +1 -0
index 664274c..86eae7b 100644
@@ -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__ */
arch/arm/mach-shmobile/pm-r8a7791.c new file +47 -0

47 lines not on this page · raw message

arch/arm/mach-shmobile/smp-r8a7791.c +2 -0
index 2648d68..1772086 100644
@@ -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,
Signature · 1 line
2.0.0.rc2
#2 lore raw

PATCH 2/14 ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM

In reply to Simon Horman

From: keita kobayashi <[email protected]>

This patch add Core-Standby-state for Suspend to RAM.

[horms+renesas at verge.net.au: rebase]
---
 arch/arm/mach-shmobile/common.h       |  2 ++
 arch/arm/mach-shmobile/platsmp-apmu.c | 60 ++++++++++++++++++++++++++++++++---
 2 files changed, 58 insertions(+), 4 deletions(-)
arch/arm/mach-shmobile/common.h +2 -0
index f7a360e..8f0cd57 100644
@@ -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
arch/arm/mach-shmobile/platsmp-apmu.c +56 -4

97 lines not on this page · raw message

Signature · 1 line
2.0.0.rc2
#3 lore raw

PATCH 3/14 ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM

In reply to Simon Horman

From: keita kobayashi <[email protected]>

Add r8a7790 Core-Standby state for Suspend to RAM support.

---
 arch/arm/mach-shmobile/smp-r8a7790.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/smp-r8a7790.c +1 -0
index a8ace58..7590e2b 100644
@@ -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);
 }
Signature · 1 line
2.0.0.rc2
#4 lore raw

PATCH 4/14 ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM

In reply to Simon Horman

From: keita kobayashi <[email protected]>

Add r8a7791 Core-Standby state for Suspend to RAM support.

---
 arch/arm/mach-shmobile/smp-r8a7791.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/smp-r8a7791.c +1 -0
index 1772086..c6543b6 100644
@@ -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,
Signature · 1 line
2.0.0.rc2
#5 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

In reply to Simon Horman

From: Benoit Cousson <[email protected]>

Mark all SoCs in shmobile as CPUFreq capable
on multiplatform build only.

[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
---
 arch/arm/mach-shmobile/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-shmobile/Kconfig +2 -0
index dbd954e..c32fa7c 100644
@@ -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
 
Signature · 1 line
2.0.0.rc2
#6 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

Quoted 18 lines · Simon Horman

From: Benoit Cousson <[email protected]>

Mark all SoCs in shmobile as CPUFreq capable
on multiplatform build only.

[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
---
 arch/arm/mach-shmobile/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-shmobile/Kconfig +0 -0
index dbd954e..c32fa7c 100644

arch/arm/mach-shmobile/Kconfig config ARCH_SHMOBILE_MULTI · line 16

Quoted 5 lines
arch/arm/mach-shmobile/Kconfig +2 -0
@@ -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/

#7 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

Quoted 15 lines · Viresh Kumar
Quoted 13 lines · Simon Horman

From: Benoit Cousson <[email protected]>

Mark all SoCs in shmobile as CPUFreq capable
on multiplatform build only.

[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
---
 arch/arm/mach-shmobile/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

arch/arm/mach-shmobile/Kconfig config ARCH_SHMOBILE_MULTI · line 16

Quoted 10 lines
arch/arm/mach-shmobile/Kconfig +2 -0
index dbd954e..c32fa7c 100644
@@ -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?

#8 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

Quoted 3 lines · Simon Horman

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 ?

#9 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

Quoted 6 lines · Viresh Kumar
Quoted 3 lines · Simon Horman

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.

#10 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

Quoted 2 lines · Simon Horman

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.

#11 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

Quoted 6 lines · Viresh Kumar
Quoted 2 lines · Simon Horman

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.

#12 lore raw

PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable

In reply to Simon Horman

Hi Simon-san,

Quoted 28 lines · Simon Horman
Quoted 15 lines · Viresh Kumar
Quoted 13 lines · Simon Horman

From: Benoit Cousson <[email protected]>

Mark all SoCs in shmobile as CPUFreq capable
on multiplatform build only.

[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]
---
 arch/arm/mach-shmobile/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
Quoted 12 lines

arch/arm/mach-shmobile/Kconfig config ARCH_SHMOBILE_MULTI · line 16

Quoted 10 lines
arch/arm/mach-shmobile/Kconfig +2 -0
index dbd954e..c32fa7c 100644
@@ -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/

Quoted 7 lines

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.

#13 lore raw

PATCH 6/14 ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only

In reply to Simon Horman

From: Magnus Damm <[email protected]>

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.

---
 arch/arm/mach-shmobile/setup-r8a7790.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
index 4212c8d..516b4e4 100644
@@ -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 */
Signature · 1 line
2.0.0.rc2
#14 lore raw

PATCH 7/14 ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only

In reply to Simon Horman

From: Magnus Damm <[email protected]>

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.

---
 arch/arm/mach-shmobile/setup-r8a7791.c | 1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-shmobile/setup-r8a7791.c +1 -0
index f554cda..9e16b1d 100644
@@ -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 */
Signature · 1 line
2.0.0.rc2
#15 lore raw

PATCH 8/14 ARM: shmobile: Add shared R-Car Gen2 CMA reservation code

In reply to Simon Horman

From: Magnus Damm <[email protected]>

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.

[horms+renesas at verge.net.au: rebased]
---
 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(+)
arch/arm/mach-shmobile/rcar-gen2.h +1 -0
index 43f606e..ce53cb5 100644
@@ -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__ */
arch/arm/mach-shmobile/setup-r8a7790.c +1 -0
index 516b4e4..e190768 100644
@@ -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 */
arch/arm/mach-shmobile/setup-r8a7791.c +1 -0
index 9e16b1d..7e970d0 100644
@@ -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 */
arch/arm/mach-shmobile/setup-rcar-gen2.c +3 -0
index fdc714e..544b9bf 100644
@@ -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"
Signature · 1 line
2.0.0.rc2
#16 lore raw

PATCH 8/14 ARM: shmobile: Add shared R-Car Gen2 CMA reservation code

Hello.

Quoted 13 lines · Simon Horman

From: Magnus Damm <[email protected]>

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.

[horms+renesas at verge.net.au: rebased]

[...]

Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0
index fdc714e..544b9bf 100644
@@ -20,8 +20,11 @@
 

arch/arm/mach-shmobile/setup-rcar-gen2.c line 30

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +3 -0
  #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

#17 lore raw

PATCH 8/14 ARM: shmobile: Add shared R-Car Gen2 CMA reservation code

Quoted 26 lines · Sergei Shtylyov

Hello.

Quoted 13 lines · Simon Horman

From: Magnus Damm <[email protected]>

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.

[horms+renesas at verge.net.au: rebased]

[...]

Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0
index fdc714e..544b9bf 100644
@@ -20,8 +20,11 @@
 
Quoted 12 lines

arch/arm/mach-shmobile/setup-rcar-gen2.c line 30

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +3 -0
 #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.

#18 lore raw

PATCH 8/14 ARM: shmobile: Add shared R-Car Gen2 CMA reservation code

[Cc Olof]

Quoted 40 lines · Simon Horman
Quoted 26 lines · Sergei Shtylyov

Hello.

Quoted 13 lines · Simon Horman

From: Magnus Damm <[email protected]>

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.

[horms+renesas at verge.net.au: rebased]

[...]

Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0 -0
index fdc714e..544b9bf 100644
@@ -20,8 +20,11 @@
 
Quoted 12 lines

arch/arm/mach-shmobile/setup-rcar-gen2.c line 30

Quoted 10 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +3 -0
 #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?

Quoted 1 line

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.

#19 lore raw

PATCH 9/14 ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update

In reply to Simon Horman

From: Geert Uytterhoeven <[email protected]>

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.

[horms+renesas at verge.net.au: rebased]
---
 arch/arm/mach-shmobile/setup-rcar-gen2.c | 76 ++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)
arch/arm/mach-shmobile/setup-rcar-gen2.c +76 -0
index 544b9bf..b0626f8 100644
@@ -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, &reg);
+		size = dt_mem_next_cell(dt_root_size_cells, &reg);
+
+		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
+}
Signature · 1 line
2.0.0.rc2
#20 lore raw

PATCH 10/14 ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"

In reply to Simon Horman

From: Geert Uytterhoeven <[email protected]>

Casts are evil

---
 arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
index b0626f8..51d5723 100644
@@ -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) {
Signature · 1 line
2.0.0.rc2
#21 lore raw

PATCH 11/14 ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail

In reply to Simon Horman

From: Geert Uytterhoeven <[email protected]>

Open Firmware in the CHRP LongTrail does not support plugging in ARM CPUs in its PPC 603e/604e-compatible CPU socket ;-)

---
 arch/arm/mach-shmobile/setup-rcar-gen2.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -8
index 51d5723..73fb2a6 100644
@@ -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);
Signature · 1 line
2.0.0.rc2
#22 lore raw

PATCH 12/14 ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init

In reply to Simon Horman

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 <[email protected]>
---
 arch/arm/mach-shmobile/common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/common.h +1 -1
index 8f0cd57..1e81199 100644
@@ -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
Signature · 1 line
2.0.0.rc2
#23 lore raw

PATCH 13/14 ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area

In reply to Simon Horman

From: Vincent Stehl? <[email protected]>

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?

---
 arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/setup-rcar-gen2.c +1 -1
index 73fb2a6..42d5b43 100644
@@ -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
 }
Signature · 1 line
2.0.0.rc2
#24 lore raw

PATCH 14/14 ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile

In reply to Simon Horman

From: Gaku Inami <[email protected]>

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.

---
 arch/arm/mach-shmobile/Kconfig | 1 -
 1 file changed, 1 deletion(-)
arch/arm/mach-shmobile/Kconfig +0 -1
index c32fa7c..cbc90f1 100644
@@ -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
Signature · 1 line
2.0.0.rc2
#25 lore raw
In reply to Simon Horman
Quoted 20 lines · Simon Horman

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)

Quoted 7 lines

----------------------------------------------------------------
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?

Quoted 5 lines

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?

Quoted 4 lines

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).

Quoted 11 lines

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.

Quoted 5 lines

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

#26 lore raw
Quoted 65 lines · Olof Johansson
Quoted 20 lines · Simon Horman

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)

Quoted 7 lines

----------------------------------------------------------------
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?

Quoted 5 lines

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?

Quoted 4 lines

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).

Quoted 11 lines

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.

Quoted 8 lines
Quoted 5 lines

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.