Renesas ARM Based SoC Updates for v3.17
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
PATCH 1/14 ARM: shmobile: r8a7791 SYSC setup code
From: keita kobayashi <[email protected]>
Add r8a7791 SYSC power management support.
--- 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
@@ -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
@@ -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
@@ -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
PATCH 2/14 ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM
In reply to Simon HormanFrom: keita kobayashi <[email protected]>
This patch add Core-Standby-state for Suspend to RAM.
--- 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
@@ -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
PATCH 3/14 ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM
In reply to Simon HormanFrom: 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
@@ -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
PATCH 4/14 ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM
In reply to Simon HormanFrom: 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
@@ -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
PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
In reply to Simon HormanFrom: Benoit Cousson <[email protected]>
Mark all SoCs in shmobile as CPUFreq capable
on multiplatform build only.
--- arch/arm/mach-shmobile/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
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 if ARCH_SHMOBILE_MULTI
Signature · 1 line
2.0.0.rc2
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.Signed-off-by Benoit Cousson <[email protected]>[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]Signed-off-by Gaku Inami <[email protected]>Signed-off-by Simon Horman <[email protected]>--- arch/arm/mach-shmobile/Kconfig | 2 ++ 1 file changed, 2 insertions(+)arch/arm/mach-shmobile/Kconfig +0
-0
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/
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.Signed-off-by Benoit Cousson <[email protected]>[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]Signed-off-by Gaku Inami <[email protected]>Signed-off-by Simon Horman <[email protected]>--- 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@@ -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_OPPhttps://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?
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: RemoveARCH_HAS_CPUFREQconfig for shmobile", removes it.
Hmm.. I fail to see why you are adding it in the first place then ?
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: RemoveARCH_HAS_CPUFREQconfig 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.
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.
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.
PATCH 5/14 ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable
In reply to Simon HormanHi 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.Signed-off-by Benoit Cousson <[email protected]>[gaku.inami.xw at bp.renesas.com: Move the definition of cpufreq capable]Signed-off-by Gaku Inami <[email protected]>Signed-off-by Simon Horman <[email protected]>--- 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@@ -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_OPPhttps://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: RemoveARCH_HAS_CPUFREQconfig for shmobile", removes it.Inami-san, could you see about making a patch to remove
ARCH_HAS_OPPtoo?
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.
PATCH 6/14 ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only
In reply to Simon HormanFrom: 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
@@ -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
PATCH 7/14 ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only
In reply to Simon HormanFrom: 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
@@ -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
PATCH 8/14 ARM: shmobile: Add shared R-Car Gen2 CMA reservation code
In reply to Simon HormanFrom: 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.
--- 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
@@ -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
@@ -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
@@ -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
@@ -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
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.
Signed-off-by Magnus Damm <[email protected]>[horms+renesas at verge.net.au: rebased]Signed-off-by Simon Horman <[email protected]>
[...]
Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0
-0@@ -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
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.
Signed-off-by Magnus Damm <[email protected]>[horms+renesas at verge.net.au: rebased]Signed-off-by Simon Horman <[email protected]>[...]
Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0
-0@@ -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.
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.
Signed-off-by Magnus Damm <[email protected]>[horms+renesas at verge.net.au: rebased]Signed-off-by Simon Horman <[email protected]>[...]
Quoted 6 lines
arch/arm/mach-shmobile/setup-rcar-gen2.c +0
-0@@ -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.
PATCH 9/14 ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update
In reply to Simon HormanFrom: 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.
--- arch/arm/mach-shmobile/setup-rcar-gen2.c | 76 ++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+)
arch/arm/mach-shmobile/setup-rcar-gen2.c +76 -0
@@ -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 +}
Signature · 1 line
2.0.0.rc2
PATCH 10/14 ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"
In reply to Simon HormanFrom: 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
@@ -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
PATCH 11/14 ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail
In reply to Simon HormanFrom: 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
@@ -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
PATCH 12/14 ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init
In reply to Simon HormanThe 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").
--- arch/arm/mach-shmobile/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/mach-shmobile/common.h +1 -1
@@ -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
PATCH 13/14 ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area
In reply to Simon HormanFrom: 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
@@ -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
PATCH 14/14 ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile
In reply to Simon HormanFrom: 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
@@ -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
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.gitrenesas-soc-for-v3.17for you to fetch changes up to
3ed66ec5ced8b801cb851b2b8548301df94f8f54:ARM: shmobile: Remove
ARCH_HAS_CPUFREQconfig for shmobile (2014-06-23 09:53:55 +0900)
Quoted 7 lines
----------------------------------------------------------------
Renesas ARM Based SoC Updates for v3.17* Use
shmobile_init_lateon 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, capableGaku Inami (1):
ARM: shmobile: RemoveARCH_HAS_CPUFREQconfig 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 forof_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: Useshmobile_init_late()on r8a7790 DT-only
ARM: shmobile: Useshmobile_init_late()on r8a7791 DT-only
ARM: shmobile: Add shared R-Car Gen2 CMA reservation codeSimon Horman (1):
ARM: shmobile: rcar-gen2: correct return value ofshmobile_smp_apmu_suspend_initVincent Stehl? (1):
ARM: shmobile: rcar-gen2: update call todma_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
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.gitrenesas-soc-for-v3.17for you to fetch changes up to
3ed66ec5ced8b801cb851b2b8548301df94f8f54:ARM: shmobile: Remove
ARCH_HAS_CPUFREQconfig for shmobile (2014-06-23 09:53:55 +0900)Quoted 7 lines
----------------------------------------------------------------
Renesas ARM Based SoC Updates for v3.17* Use
shmobile_init_lateon 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 supportThis 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, capableGaku Inami (1):
ARM: shmobile: RemoveARCH_HAS_CPUFREQconfig for shmobileThe latter patch fixes the former, why not just fold them in?
Quoted 4 lines
Geert Uytterhoeven (3):
ARM: shmobile: rcar-gen2: Update forof_get_flat_dt_prop()update
ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1"
ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrailThe 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: Useshmobile_init_late()on r8a7790 DT-only
ARM: shmobile: Useshmobile_init_late()on r8a7791 DT-only
ARM: shmobile: Add shared R-Car Gen2 CMA reservation codeSimon Horman (1):
ARM: shmobile: rcar-gen2: correct return value ofshmobile_smp_apmu_suspend_initVincent Stehl? (1):
ARM: shmobile: rcar-gen2: update call todma_contiguous_reserve_areaAgain 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 RAMAnyway, 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.