From 06e32c91dbce3c24ccbe84e3af2a35199662bca0 Mon Sep 17 00:00:00 2001 From: Gaku Inami Date: Tue, 3 Jun 2014 21:02:45 +0900 Subject: ARM: shmobile: add cpufreq-cpu0 driver for common SH-Mobile I add a new file(cpufreq.c) for the following reasons. - Registration of platform_device must be unified in SH-Mobile. - We can't create a node of cpufreq drivers into device tree. (Because cpufreq driver is virtual device.) Signed-off-by: Gaku Inami Acked-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/cpufreq.c | 31 ++++++++++++++++++++++++++++ arch/arm/mach-shmobile/include/mach/common.h | 7 +++++++ 3 files changed, 39 insertions(+) create mode 100644 arch/arm/mach-shmobile/cpufreq.c (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 38d5fe825e93..1b966da2c81c 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -48,6 +48,7 @@ obj-$(CONFIG_ARCH_SH7372) += entry-intc.o # PM objects obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o +obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o diff --git a/arch/arm/mach-shmobile/cpufreq.c b/arch/arm/mach-shmobile/cpufreq.c new file mode 100644 index 000000000000..e2c868fc41cf --- /dev/null +++ b/arch/arm/mach-shmobile/cpufreq.c @@ -0,0 +1,31 @@ +/* + * CPUFreq support code for SH-Mobile ARM + * + * Copyright (C) 2014 Gaku Inami + * + * 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 +#include +#include + +int __init shmobile_cpufreq_init(void) +{ + struct device_node *np; + + np = of_cpu_device_node_get(0); + if (np == NULL) { + pr_err("failed to find cpu0 node\n"); + return 0; + } + + if (of_get_property(np, "operating-points", NULL)) + platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); + + of_node_put(np); + + return 0; +} diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index f7a360edcc35..921a18ef4dfe 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h @@ -45,12 +45,19 @@ int shmobile_cpuidle_init(void); static inline int shmobile_cpuidle_init(void) { return 0; } #endif +#ifdef CONFIG_CPU_FREQ +int shmobile_cpufreq_init(void); +#else +static inline int shmobile_cpufreq_init(void) { return 0; } +#endif + extern void __iomem *shmobile_scu_base; static inline void __init shmobile_init_late(void) { shmobile_suspend_init(); shmobile_cpuidle_init(); + shmobile_cpufreq_init(); } #endif /* __ARCH_MACH_COMMON_H */ -- cgit v1.2.3 From edc8fb1d6ebdfc4efa009073586d3567c3368475 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Wed, 21 May 2014 15:31:05 +0200 Subject: ARM: shmobile: Fix device node reference leakage in shmobile_init_delay The of_find_compatible_node() function returns a new reference to the found node. Instead of just adding of_node_put() calls, simplify the code by moving the CPU identification logic inside the loop over cpu nodes, in order to lower complexity from O(n) to O(1) by replacing of_find_compatible_node() calls with of_device_is_compatible(). Signed-off-by: Laurent Pinchart Acked-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/timer.c | 50 ++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index 68bc0b82226d..942efdc82a62 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c @@ -59,29 +59,37 @@ void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, void __init shmobile_init_delay(void) { - struct device_node *np, *parent; - u32 max_freq, freq; - - max_freq = 0; - - parent = of_find_node_by_path("/cpus"); - if (parent) { - for_each_child_of_node(parent, np) { - if (!of_property_read_u32(np, "clock-frequency", &freq)) - max_freq = max(max_freq, freq); - } - of_node_put(parent); - } + struct device_node *np, *cpus; + bool is_a8_a9 = false; + bool is_a15 = false; + u32 max_freq = 0; + + cpus = of_find_node_by_path("/cpus"); + if (!cpus) + return; + + for_each_child_of_node(cpus, np) { + u32 freq; + + if (!of_property_read_u32(np, "clock-frequency", &freq)) + max_freq = max(max_freq, freq); - if (max_freq) { - if (of_find_compatible_node(NULL, NULL, "arm,cortex-a8")) - shmobile_setup_delay_hz(max_freq, 1, 3); - else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) - shmobile_setup_delay_hz(max_freq, 1, 3); - else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a15")) - if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) - shmobile_setup_delay_hz(max_freq, 2, 4); + if (of_device_is_compatible(np, "arm,cortex-a8") || + of_device_is_compatible(np, "arm,cortex-a9")) + is_a8_a9 = true; + else if (of_device_is_compatible(np, "arm,cortex-a15")) + is_a15 = true; } + + of_node_put(cpus); + + if (!max_freq) + return; + + if (is_a8_a9) + shmobile_setup_delay_hz(max_freq, 1, 3); + else if (is_a15 && !IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) + shmobile_setup_delay_hz(max_freq, 2, 4); } static void __init shmobile_late_time_init(void) -- cgit v1.2.3 From 5f6108bb9643949bf5ec0bc9f5cbde588c542c7f Mon Sep 17 00:00:00 2001 From: keita kobayashi Date: Fri, 30 May 2014 14:18:48 +0900 Subject: ARM: shmobile: r8a7791 SYSC setup code Add r8a7791 SYSC power management support. Signed-off-by: Keita Kobayashi Acked-by: Magnus Damm [horms+renesas@verge.net.au: rebased] Signed-off-by: Simon Horman --- 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 (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 38d5fe825e93..9c0ad3e115a6 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 664274cc4b64..86eae7bceb6f 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 000000000000..15190875d507 --- /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 +#include +#include +#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 2648d68650e4..17720860f0dd 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, -- cgit v1.2.3 From d6d757c9a4e06e118fa5158fa74e03c514d862d2 Mon Sep 17 00:00:00 2001 From: keita kobayashi Date: Thu, 29 May 2014 16:24:27 +0900 Subject: ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM This patch add Core-Standby-state for Suspend to RAM. Signed-off-by: Keita Kobayashi Acked-by: Magnus Damm [horms+renesas@verge.net.au: rebase] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/common.h | 2 ++ arch/arm/mach-shmobile/platsmp-apmu.c | 60 ++++++++++++++++++++++++++++++++--- 2 files changed, 58 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index f7a360edcc35..8f0cd5791583 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 fe648f5d8f06..590e35c22a60 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 #include #include #include #include #include #include +#include #include #include +#include #include +#include #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 -- cgit v1.2.3 From ce508d1b13d1008db570ac58e775ce36bd9c5112 Mon Sep 17 00:00:00 2001 From: keita kobayashi Date: Thu, 29 May 2014 16:24:39 +0900 Subject: ARM: shmobile: r8a7790: Support Core-Standby for Suspend to RAM Add r8a7790 Core-Standby state for Suspend to RAM support. Signed-off-by: Keita Kobayashi Acked-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/smp-r8a7790.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index a8ace58c3dd2..7590e2b6e2fa 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); } -- cgit v1.2.3 From 7f6234013a835476f1503be2c9287f1fe3497457 Mon Sep 17 00:00:00 2001 From: keita kobayashi Date: Thu, 29 May 2014 16:24:52 +0900 Subject: ARM: shmobile: r8a7791: Support Core-Standby for Suspend to RAM Add r8a7791 Core-Standby state for Suspend to RAM support. Signed-off-by: Keita Kobayashi Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/smp-r8a7791.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index 17720860f0dd..c6543b6ec759 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, -- cgit v1.2.3 From 6596e97e054647fecb016ecb7e1935aa2b7db954 Mon Sep 17 00:00:00 2001 From: Benoit Cousson Date: Thu, 5 Jun 2014 12:49:44 +0900 Subject: ARM: shmobile: Mark all SoCs in shmobile as CPUFreq, capable Mark all SoCs in shmobile as CPUFreq capable on multiplatform build only. Signed-off-by: Benoit Cousson [gaku.inami.xw@bp.renesas.com: Move the definition of cpufreq capable] Signed-off-by: Gaku Inami Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Kconfig | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index dbd954e61aa7..c32fa7ccb68e 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 -- cgit v1.2.3 From 7d95b9ddfb933f94354fa2ff9b1bfccdd6c54653 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 15:13:47 +0900 Subject: ARM: shmobile: Use shmobile_init_late() on r8a7790 DT-only 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 Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7790.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index 4212c8de987a..516b4e4a3ddd 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 */ -- cgit v1.2.3 From 3d65226bc925f4749c2b2ab0ea3f4d274e194688 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 15:15:23 +0900 Subject: ARM: shmobile: Use shmobile_init_late() on r8a7791 DT-only 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 Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7791.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index f554cda4a96a..9e16b1daba59 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 */ -- cgit v1.2.3 From f8e819352d12f1b7d109d846e9bf1c07e006469a Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Mon, 9 Jun 2014 21:38:45 +0900 Subject: ARM: shmobile: Add shared R-Car Gen2 CMA reservation code 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 [horms+renesas@verge.net.au: rebased] Signed-off-by: Simon Horman --- 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(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h index 43f606eb2d82..ce53cb5f53a1 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 516b4e4a3ddd..e1907686ace4 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 9e16b1daba59..7e970d005f7f 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 fdc714ebc4cd..544b9bf28840 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c @@ -20,8 +20,11 @@ #include #include +#include +#include #include #include +#include #include #include "common.h" #include "rcar-gen2.h" -- cgit v1.2.3 From 83850b04ae7744f51681533fb7afb645e66ce8fe Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 12 Jun 2014 10:42:22 +0200 Subject: ARM: shmobile: rcar-gen2: Update for of_get_flat_dt_prop() update 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 Acked-by: Magnus Damm [horms+renesas@verge.net.au: rebased] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 76 ++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 544b9bf28840..b0626f89d7a6 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@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 +} -- cgit v1.2.3 From b69f47c00f2eff19b532cf0142d81b993e587bf0 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 12 Jun 2014 10:42:23 +0200 Subject: ARM: shmobile: rcar-gen2: Use "1ULL" instead of "(u64)1" Casts are evil Signed-off-by: Geert Uytterhoeven Acked-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index b0626f89d7a6..51d572306e1a 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) { -- cgit v1.2.3 From ea2a0d581a3e742c2fb2bc520c8c8887fe1dafa6 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Thu, 12 Jun 2014 10:42:24 +0200 Subject: ARM: shmobile: rcar-gen2: Remove useless copied section for LongTrail 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 Acked-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 51d572306e1a..73fb2a659d9f 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@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); -- cgit v1.2.3 From ecdaca48629bd99609fdc612685363330967dce2 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 16 Jun 2014 20:21:13 +0900 Subject: ARM: shmobile: rcar-gen2: correct return value of shmobile_smp_apmu_suspend_init 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 Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 8f0cd5791583..1e811999557d 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 -- cgit v1.2.3 From 3e05f24aa95bb043f1103b41392b61ce83d2675e Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:01 +0900 Subject: ARM: shmobile: r8a7779: Add helper to read mode pins Add and use helper to read mode pins. This will be re-used when moving marzen-reference to the common clock framework. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a7779.c | 11 ++--------- arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 + arch/arm/mach-shmobile/setup-r8a7779.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index d81539a26dbd..5dd66a21f036 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -23,6 +23,7 @@ #include #include #include +#include #include "clock.h" #include "common.h" @@ -52,9 +53,6 @@ #define MSTPCR3 IOMEM(0xffc8003c) #define MSTPSR1 IOMEM(0xffc80044) -#define MODEMR 0xffcc0020 - - /* ioremap() through clock mapping mandatory to avoid * collision with ARM coherent DMA virtual memory range. */ @@ -207,14 +205,9 @@ static struct clk_lookup lookups[] = { void __init r8a7779_clock_init(void) { - void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); - u32 mode; + u32 mode = r8a7779_read_mode_pins(); int k, ret = 0; - BUG_ON(!modemr); - mode = ioread32(modemr); - iounmap(modemr); - if (mode & MD(1)) { plla_clk.rate = 1500000000; diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h index def10a29e09a..5ef0bad6334d 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h @@ -20,6 +20,7 @@ extern void r8a7779_add_early_devices(void); extern void r8a7779_add_standard_devices(void); extern void r8a7779_add_standard_devices_dt(void); extern void r8a7779_init_late(void); +extern u32 r8a7779_read_mode_pins(void); extern void r8a7779_clock_init(void); extern void r8a7779_pinmux_init(void); extern void r8a7779_pm_init(void); diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 86ec4b625a78..25e1d0b72463 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -762,6 +762,24 @@ void __init r8a7779_add_standard_devices_dt(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } +#define MODEMR 0xffcc0020 + +u32 __init r8a7779_read_mode_pins(void) +{ + static u32 mode; + static bool mode_valid; + + if (!mode_valid) { + void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); + BUG_ON(!modemr); + mode = ioread32(modemr); + iounmap(modemr); + mode_valid = true; + } + + return mode; +} + static const char *r8a7779_compat_dt[] __initdata = { "renesas,r8a7779", NULL, -- cgit v1.2.3 From f48039a3da40f0c193122c83ad582913f2daf29d Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:02 +0900 Subject: ARM: shmobile: r8a7779: Move r8a7779_earlytimer_init to clock-r8a7779.c r8a7779_earlytimer_init() calls r8a7779_clock_init() and r8a7779_clock_init() is defined in clock-r8a7779.c. If both CONFIG_COMMON_CLK and CONFIG_ARCH_R8A7779 are enabled, as will be the case when marzen-reference moves to use the common clock framework, then setup-r8a7779.c is compiled but clock-r8a7779.c is not. As r8a7779_earlytimer_init() is not used by marzen-reference simply move it to clock-r8a7779.c. [horms+renesas@verge.net.au: rebase] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a7779.c | 11 +++++++++++ arch/arm/mach-shmobile/setup-r8a7779.c | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index 5dd66a21f036..e690927f3505 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "clock.h" #include "common.h" @@ -261,3 +262,13 @@ void __init r8a7779_clock_init(void) else panic("failed to setup r8a7779 clocks\n"); } + +/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ +void __init __weak r8a7779_register_twd(void) { } + +void __init r8a7779_earlytimer_init(void) +{ + r8a7779_clock_init(); + r8a7779_register_twd(); + shmobile_earlytimer_init(); +} diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 25e1d0b72463..23122f62366c 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -674,16 +674,6 @@ void __init r8a7779_add_standard_devices(void) r8a7779_register_hpb_dmae(); } -/* do nothing for !CONFIG_SMP or !CONFIG_HAVE_TWD */ -void __init __weak r8a7779_register_twd(void) { } - -void __init r8a7779_earlytimer_init(void) -{ - r8a7779_clock_init(); - r8a7779_register_twd(); - shmobile_earlytimer_init(); -} - void __init r8a7779_add_early_devices(void) { early_platform_add_devices(r8a7779_devices_dt, -- cgit v1.2.3 From f8fba0ce6628109bac9d33f65b637a87a2f3be24 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:03 +0900 Subject: ARM: shmobile: marzen-reference: Move clock and OF device initialisation into board code Move the clock initialisation and OF device population from SoC to board code. This is in keeping with the pattern used by Lager. And the clock portion is part of decoupling clock initialisation from SoC code in preparation for moving to the common clock framework. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 3 +++ arch/arm/mach-shmobile/setup-r8a7779.c | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 94bd57203ff5..46ed17a50183 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -27,7 +28,9 @@ static void __init marzen_init(void) { + r8a7779_clock_init(); r8a7779_add_standard_devices_dt(); + of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ } diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 23122f62366c..15f533b89702 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -744,12 +744,8 @@ void __init r8a7779_init_delay(void) void __init r8a7779_add_standard_devices_dt(void) { - /* clocks are setup late during boot in the case of DT */ - r8a7779_clock_init(); - platform_add_devices(r8a7779_devices_dt, ARRAY_SIZE(r8a7779_devices_dt)); - of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } #define MODEMR 0xffcc0020 -- cgit v1.2.3 From 5016c81bf92eb01741fc71ce7fb8380183a6f66a Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:05 +0900 Subject: ARM: shmobile: r8a7779: Initial multiplatform support Add Marzen and r8a7779 to CONFIG_SHMOBILE_MULTI. At this point CCF is not yet supported so you cannot run this code yet. For CCF support to happen several different components are needed, and this is one simple portion that moves us forward. Other patches need to build on top of this one. Marzen board support exists in 3 flavours: 1) SHMOBILE_MULTI, MACH_MARZEN - board-marzen-reference.c (CCF + DT) 2) SHMOBILE, MACH_MARZEN_REFERENCE - board-marzen-reference.c (DT) 3) SHMOBILE, MACH_MARZEN - board-marzen.c (legacy C code) When CCF is done then 2) will be removed. When 1) includes same features as 3) then 3) will be removed. Based on work for the Koelsch and r8a7791 by Magnus Damm. Cc: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/boot/dts/Makefile | 3 ++- arch/arm/mach-shmobile/Kconfig | 10 ++++++++++ arch/arm/mach-shmobile/Makefile | 1 + arch/arm/mach-shmobile/board-marzen-reference.c | 5 +++++ 4 files changed, 18 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index 5986ff63b901..f44df11eab38 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -339,7 +339,8 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \ r7s72100-genmai.dtb \ r8a7791-henninger.dtb \ r8a7791-koelsch.dtb \ - r8a7790-lager.dtb + r8a7790-lager.dtb \ + r8a7779-marzen-reference.dtb dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \ socfpga_cyclone5_socdk.dtb \ socfpga_cyclone5_sockit.dtb \ diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index dbd954e61aa7..d7f828586802 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -25,6 +25,11 @@ config ARCH_R7S72100 bool "RZ/A1H (R7S72100)" select SYS_SUPPORTS_SH_MTU2 +config ARCH_R8A7779 + bool "R-Car H1 (R8A77790)" + select RENESAS_INTC_IRQPIN + select SYS_SUPPORTS_SH_TMU + config ARCH_R8A7790 bool "R-Car H2 (R8A77900)" select RENESAS_IRQC @@ -51,6 +56,11 @@ config MACH_LAGER depends on ARCH_R8A7790 select MICREL_PHY if SH_ETH +config MACH_MARZEN + bool "MARZEN board" + depends on ARCH_R8A7779 + select REGULATOR_FIXED_VOLTAGE if REGULATOR + comment "Renesas ARM SoCs System Configuration" endif diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 38d5fe825e93..23099063860b 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -59,6 +59,7 @@ ifdef CONFIG_ARCH_SHMOBILE_MULTI obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o obj-$(CONFIG_MACH_KOELSCH) += board-koelsch-reference.o obj-$(CONFIG_MACH_LAGER) += board-lager-reference.o +obj-$(CONFIG_MACH_MARZEN) += board-marzen-reference.o else obj-$(CONFIG_MACH_APE6EVM) += board-ape6evm.o obj-$(CONFIG_MACH_APE6EVM_REFERENCE) += board-ape6evm-reference.o diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 46ed17a50183..d90843b22027 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -19,6 +19,7 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include #include @@ -28,7 +29,11 @@ static void __init marzen_init(void) { +#ifdef CONFIG_COMMON_CLK + of_clk_init(NULL); +#else r8a7779_clock_init(); +#endif r8a7779_add_standard_devices_dt(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ -- cgit v1.2.3 From a92fbd077bbfbe98e4dee84081d84c44ae99538b Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:06 +0900 Subject: ARM: shmobile: marzen-reference: Initialize CPG device On multiplatform kernels clocks are handled by the CCF CPG driver. It must be explicitly initialized by a call to r8a7779_clocks_init() with the value of the boot mode pins. Based on similar work for the Koelsch board by Laurent Pinchart. Acked-by: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index d90843b22027..f642819009ad 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -19,7 +19,8 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include +#include #include #include #include @@ -27,11 +28,17 @@ #include "common.h" #include "irqs.h" -static void __init marzen_init(void) +static void __init marzen_init_timer(void) { #ifdef CONFIG_COMMON_CLK - of_clk_init(NULL); -#else + r8a7779_clocks_init(r8a7779_read_mode_pins()); +#endif + clocksource_of_init(); +} + +static void __init marzen_init(void) +{ +#ifndef CONFIG_COMMON_CLK r8a7779_clock_init(); #endif r8a7779_add_standard_devices_dt(); @@ -48,6 +55,7 @@ DT_MACHINE_START(MARZEN, "marzen") .smp = smp_ops(r8a7779_smp_ops), .map_io = r8a7779_map_io, .init_early = r8a7779_init_delay, + .init_time = marzen_init_timer, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, .init_machine = marzen_init, -- cgit v1.2.3 From 2b2084e8d4ae9265a3240722cb8adce06c0f393f Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:07 +0900 Subject: ARM: shmobile: marzen-reference: Instantiate clkdevs for SCIF and TMU Now that the common clock framework is supported, the clock lookup entries in clock-r8a7779.c are not registered anymore. Devices must instead reference their clocks in the device tree. However, SCIF and CMT devices are still instantiated through platform code, and thus need a clock lookup entry. Retrieve the SCIF and CMT clock entries by name and register clkdevs for the corresponding devices. This will be removed when the SCIF and CMT devices will be instantiated from the device tree. Based on work for the Koelsch board by Laurent Pinchart. Cc: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index f642819009ad..3017040c68be 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -25,6 +25,7 @@ #include #include #include +#include "clock.h" #include "common.h" #include "irqs.h" @@ -36,9 +37,27 @@ static void __init marzen_init_timer(void) clocksource_of_init(); } +#ifdef CONFIG_COMMON_CLK +/* + * This is a really crude hack to provide clkdev support to platform + * devices until they get moved to DT. + */ +static const struct clk_name clk_names[] __initconst = { + { "scif0", NULL, "sh-sci.0" }, + { "scif1", NULL, "sh-sci.1" }, + { "scif2", NULL, "sh-sci.2" }, + { "scif3", NULL, "sh-sci.3" }, + { "scif4", NULL, "sh-sci.4" }, + { "scif5", NULL, "sh-sci.5" }, + { "tmu0", "fck", "sh-tmu.0" }, +}; +#endif + static void __init marzen_init(void) { -#ifndef CONFIG_COMMON_CLK +#ifdef CONFIG_COMMON_CLK + shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); +#else r8a7779_clock_init(); #endif r8a7779_add_standard_devices_dt(); -- cgit v1.2.3 From 1ece7f7bb014485b13faf9504b238ff891a9088a Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:09 +0900 Subject: ARM: shmobile: Remove non-multiplatform Marzen reference support Now that r8a7779 has CCF support remove the legacy Marzen reference Kconfig bits CONFIG_MACH_MARZEN_REFERENCE for the non-multiplatform case. Starting from this commit Marzen board support is always enabled via CONFIG_MACH_MARZEN, and CONFIG_ARCH_MULTIPLATFORM is used to select between board-marzen.c and board-marzen-reference.c The file board-marzen-reference.c can no longer be used together with the legacy sh-clk clock framework, instead CCF is used. Based on work for the Koelsch board by Laurent Pinchart. Cc: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/boot/dts/Makefile | 1 - arch/arm/mach-shmobile/Kconfig | 13 ------------- arch/arm/mach-shmobile/Makefile | 1 - arch/arm/mach-shmobile/Makefile.boot | 1 - 4 files changed, 16 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f44df11eab38..e666d132c10d 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -327,7 +327,6 @@ dtb-$(CONFIG_ARCH_SHMOBILE_LEGACY) += r7s72100-genmai.dtb \ r8a7778-bockw-reference.dtb \ r8a7740-armadillo800eva-reference.dtb \ r8a7779-marzen.dtb \ - r8a7779-marzen-reference.dtb \ r8a7791-koelsch.dtb \ r8a7790-lager.dtb \ sh73a0-kzm9g.dtb \ diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index d7f828586802..8a054dd0445a 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig @@ -245,19 +245,6 @@ config MACH_MARZEN select REGULATOR_FIXED_VOLTAGE if REGULATOR select USE_OF -config MACH_MARZEN_REFERENCE - bool "MARZEN board - Reference Device Tree Implementation" - depends on ARCH_R8A7779 - select ARCH_REQUIRE_GPIOLIB - select REGULATOR_FIXED_VOLTAGE if REGULATOR - select USE_OF - ---help--- - Use reference implementation of Marzen board support - which makes use of device tree at the expense - of not supporting a number of devices. - - This is intended to aid developers - config MACH_LAGER bool "Lager board" depends on ARCH_R8A7790 diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 23099063860b..0d6a04c3f904 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -68,7 +68,6 @@ obj-$(CONFIG_MACH_BOCKW) += board-bockw.o obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o obj-$(CONFIG_MACH_GENMAI) += board-genmai.o obj-$(CONFIG_MACH_MARZEN) += board-marzen.o -obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o obj-$(CONFIG_MACH_LAGER) += board-lager.o obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o obj-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += board-armadillo800eva-reference.o diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot index 918fccffa1b6..ebf97d4bcfd8 100644 --- a/arch/arm/mach-shmobile/Makefile.boot +++ b/arch/arm/mach-shmobile/Makefile.boot @@ -13,7 +13,6 @@ loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 loadaddr-$(CONFIG_MACH_LAGER) += 0x40008000 loadaddr-$(CONFIG_MACH_MACKEREL) += 0x40008000 loadaddr-$(CONFIG_MACH_MARZEN) += 0x60008000 -loadaddr-$(CONFIG_MACH_MARZEN_REFERENCE) += 0x60008000 __ZRELADDR := $(sort $(loadaddr-y)) zreladdr-y += $(__ZRELADDR) -- cgit v1.2.3 From 04d3e8a0b150f1931d48ed9168672a971fc4c761 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:10 +0900 Subject: ARM: shmobile: Let Marzen multiplatform boot with Marzen DTB Let the multiplatform Marzen support boot with the legacy DTS for Marzen as well as the Marzen reference DTS. Based on work for the Koelsch board by Laurent Pinchart. Cc: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/boot/dts/Makefile | 2 +- arch/arm/mach-shmobile/board-marzen-reference.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index e666d132c10d..4ebc4ca5d2ec 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -339,7 +339,7 @@ dtb-$(CONFIG_ARCH_SHMOBILE_MULTI) += emev2-kzm9d.dtb \ r8a7791-henninger.dtb \ r8a7791-koelsch.dtb \ r8a7790-lager.dtb \ - r8a7779-marzen-reference.dtb + r8a7779-marzen.dtb dtb-$(CONFIG_ARCH_SOCFPGA) += socfpga_arria5_socdk.dtb \ socfpga_cyclone5_socdk.dtb \ socfpga_cyclone5_sockit.dtb \ diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 3017040c68be..46936ff2627e 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -66,6 +66,7 @@ static void __init marzen_init(void) } static const char *marzen_boards_compat_dt[] __initdata = { + "renesas,marzen", "renesas,marzen-reference", NULL, }; -- cgit v1.2.3 From f0b78f8b63fe92242232b7a3e4aa951983ee1f45 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:32:12 +0900 Subject: ARM: shmobile: marzen-reference: Remove legacy clock support Marzen DT reference is now only built for multiplatform which means that CCF comes with the package. Remove unused legacy code ifdefs to clean up the code. Based on similar work for the Koelsch board by Magnus Damm. Cc: Magnus Damm Cc: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 46936ff2627e..1b63686e0160 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -31,13 +31,10 @@ static void __init marzen_init_timer(void) { -#ifdef CONFIG_COMMON_CLK r8a7779_clocks_init(r8a7779_read_mode_pins()); -#endif clocksource_of_init(); } -#ifdef CONFIG_COMMON_CLK /* * This is a really crude hack to provide clkdev support to platform * devices until they get moved to DT. @@ -51,15 +48,10 @@ static const struct clk_name clk_names[] __initconst = { { "scif5", NULL, "sh-sci.5" }, { "tmu0", "fck", "sh-tmu.0" }, }; -#endif static void __init marzen_init(void) { -#ifdef CONFIG_COMMON_CLK shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); -#else - r8a7779_clock_init(); -#endif r8a7779_add_standard_devices_dt(); of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); r8a7779_init_irq_extpin_dt(1); /* IRQ1 as individual interrupt */ -- cgit v1.2.3 From 0157b62674aa3db1fc574bb65e6b0e30bb0683d7 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 16 May 2014 13:42:59 +0900 Subject: ARM: shmobile: r8a7779: Use DT CPU Frequency in common case Convert the common C-code-less r8a7779 DT board support to use shmobile_init_delay() to be able to migrate away from per-SoC delay setup functions. Based on work by Magnus dam for the r8a7740 SoC. Cc: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7779.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 15f533b89702..706832f34a69 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -773,7 +773,7 @@ static const char *r8a7779_compat_dt[] __initdata = { DT_MACHINE_START(R8A7779_DT, "Generic R8A7779 (Flattened Device Tree)") .map_io = r8a7779_map_io, - .init_early = r8a7779_init_delay, + .init_early = shmobile_init_delay, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, .init_machine = r8a7779_add_standard_devices_dt, -- cgit v1.2.3 From 17ed9efd8afdd8c38f19ff72f08e71c1fd2376e3 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 16 May 2014 13:43:00 +0900 Subject: ARM: shmobile: marzen-reference: Use DT CPU Frequency Convert the Marzen DT reference board support to use shmobile_init_delay() to be able to migrate away from per-SoC delay setup functions. Based on work for the Armadillo800 EVA board by Magnus Damm. Cc: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 1b63686e0160..bb2df32f597a 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -66,7 +66,7 @@ static const char *marzen_boards_compat_dt[] __initdata = { DT_MACHINE_START(MARZEN, "marzen") .smp = smp_ops(r8a7779_smp_ops), .map_io = r8a7779_map_io, - .init_early = r8a7779_init_delay, + .init_early = shmobile_init_delay, .init_time = marzen_init_timer, .nr_irqs = NR_IRQS_LEGACY, .init_irq = r8a7779_init_irq_dt, -- cgit v1.2.3 From daab540e3a2afeb8c087a67dfaee5aa50a29e844 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Fri, 16 May 2014 13:43:01 +0900 Subject: ARM: shmobile: r8a7779: Remove unused r8a7779_init_delay() Remove the now unused r8a7779_init_delay() function. Based on work for the r8a7740 SoC by Magnus Damm. Cc: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/include/mach/r8a7779.h | 1 - arch/arm/mach-shmobile/setup-r8a7779.c | 5 ----- 2 files changed, 6 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h index 5ef0bad6334d..5415c719dc19 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7779.h @@ -10,7 +10,6 @@ enum { HPBDMA_SLAVE_SDHI0_RX, }; -extern void r8a7779_init_delay(void); extern void r8a7779_init_irq_extpin(int irlm); extern void r8a7779_init_irq_extpin_dt(int irlm); extern void r8a7779_init_irq_dt(void); diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 706832f34a69..f96a30481dfb 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -737,11 +737,6 @@ void __init r8a7779_init_irq_dt(void) __raw_writel(0x003fee3f, INT2SMSKCR4); } -void __init r8a7779_init_delay(void) -{ - shmobile_setup_delay(1000, 2, 4); /* Cortex-A9 @ 1000MHz */ -} - void __init r8a7779_add_standard_devices_dt(void) { platform_add_devices(r8a7779_devices_dt, -- cgit v1.2.3 From 6d4abd79c80742629477479b01077bb92eccdd53 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:39:32 +0900 Subject: ARM: shmobile: marzen: Initialise SCIF devices using DT Initialise SCIF devices using DT when booting marzen using multiplatform. Acked-by: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/boot/dts/r8a7779-marzen.dts | 22 +++++++++++++++++++--- arch/arm/mach-shmobile/setup-r8a7779.c | 8 ++++---- 2 files changed, 23 insertions(+), 7 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/boot/dts/r8a7779-marzen.dts b/arch/arm/boot/dts/r8a7779-marzen.dts index 321290828eee..20b176807848 100644 --- a/arch/arm/boot/dts/r8a7779-marzen.dts +++ b/arch/arm/boot/dts/r8a7779-marzen.dts @@ -18,6 +18,11 @@ model = "marzen"; compatible = "renesas,marzen", "renesas,r8a7779"; + aliases { + serial2 = &scif2; + serial4 = &scif4; + }; + chosen { bootargs = "console=ttySC2,115200 ignore_loglevel root=/dev/nfs ip=on"; }; @@ -74,9 +79,6 @@ }; &pfc { - pinctrl-0 = <&scif2_pins &scif4_pins>; - pinctrl-names = "default"; - lan0_pins: lan0 { intc { renesas,groups = "intc_irq1_b"; @@ -109,6 +111,20 @@ }; }; +&scif2 { + pinctrl-0 = <&scif2_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + +&scif4 { + pinctrl-0 = <&scif4_pins>; + pinctrl-names = "default"; + + status = "okay"; +}; + &sdhi0 { pinctrl-0 = <&sdhi0_pins>; pinctrl-names = "default"; diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index f96a30481dfb..2f59b99b9b86 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -640,16 +640,16 @@ static void __init r8a7779_register_hpb_dmae(void) } static struct platform_device *r8a7779_devices_dt[] __initdata = { + &tmu0_device, +}; + +static struct platform_device *r8a7779_standard_devices[] __initdata = { &scif0_device, &scif1_device, &scif2_device, &scif3_device, &scif4_device, &scif5_device, - &tmu0_device, -}; - -static struct platform_device *r8a7779_standard_devices[] __initdata = { &i2c0_device, &i2c1_device, &i2c2_device, -- cgit v1.2.3 From c1a0f9932b66b2298163c31f8ac3f2844476e1c2 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 15 May 2014 20:39:33 +0900 Subject: ARM: shmobile: marzen: Do not use workaround for scif devices Now that SCIF devices are initialised using DT it should not be necessary to use the work around to provide clocks any more. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index bb2df32f597a..0a000b74ac6d 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -40,12 +40,6 @@ static void __init marzen_init_timer(void) * devices until they get moved to DT. */ static const struct clk_name clk_names[] __initconst = { - { "scif0", NULL, "sh-sci.0" }, - { "scif1", NULL, "sh-sci.1" }, - { "scif2", NULL, "sh-sci.2" }, - { "scif3", NULL, "sh-sci.3" }, - { "scif4", NULL, "sh-sci.4" }, - { "scif5", NULL, "sh-sci.5" }, { "tmu0", "fck", "sh-tmu.0" }, }; -- cgit v1.2.3 From 14a5e926141f9c37bdaa0220169489e782220ee1 Mon Sep 17 00:00:00 2001 From: Vincent Stehlé Date: Thu, 19 Jun 2014 11:31:10 +0200 Subject: ARM: shmobile: rcar-gen2: update call to dma_contiguous_reserve_area MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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é Acked-by: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 73fb2a659d9f..42d5b4308923 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 } -- cgit v1.2.3 From 3ed66ec5ced8b801cb851b2b8548301df94f8f54 Mon Sep 17 00:00:00 2001 From: Gaku Inami Date: Thu, 19 Jun 2014 20:06:08 +0900 Subject: ARM: shmobile: Remove ARCH_HAS_CPUFREQ config for shmobile 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 Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Kconfig | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index c32fa7ccb68e..cbc90f1b2732 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 -- cgit v1.2.3 From 1b55353c9214788b0d0797a5fd4585af1557a12c Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 20 Jun 2014 18:53:05 +0200 Subject: ARM: shmobile: Move r8a7779.h Change location of r8a7779.h so it can be included as "r8a7779.h" instead of the old style Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-marzen-reference.c | 4 ++- arch/arm/mach-shmobile/board-marzen.c | 4 ++- arch/arm/mach-shmobile/clock-r8a7779.c | 3 ++- arch/arm/mach-shmobile/include/mach/r8a7779.h | 36 ------------------------- arch/arm/mach-shmobile/pm-r8a7779.c | 4 ++- arch/arm/mach-shmobile/r8a7779.h | 36 +++++++++++++++++++++++++ arch/arm/mach-shmobile/setup-r8a7779.c | 4 ++- arch/arm/mach-shmobile/smp-r8a7779.c | 4 ++- 8 files changed, 53 insertions(+), 42 deletions(-) delete mode 100644 arch/arm/mach-shmobile/include/mach/r8a7779.h create mode 100644 arch/arm/mach-shmobile/r8a7779.h (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-marzen-reference.c b/arch/arm/mach-shmobile/board-marzen-reference.c index 0a000b74ac6d..21b3e1ca2261 100644 --- a/arch/arm/mach-shmobile/board-marzen-reference.c +++ b/arch/arm/mach-shmobile/board-marzen-reference.c @@ -22,12 +22,14 @@ #include #include #include -#include + #include #include + #include "clock.h" #include "common.h" #include "irqs.h" +#include "r8a7779.h" static void __init marzen_init_timer(void) { diff --git a/arch/arm/mach-shmobile/board-marzen.c b/arch/arm/mach-shmobile/board-marzen.c index fe445ef49fb9..25a1037e289d 100644 --- a/arch/arm/mach-shmobile/board-marzen.c +++ b/arch/arm/mach-shmobile/board-marzen.c @@ -41,13 +41,15 @@ #include #include #include + #include -#include #include #include #include + #include "common.h" #include "irqs.h" +#include "r8a7779.h" /* Fixed 3.3V regulator to be used by SDHI0 */ static struct regulator_consumer_supply fixed3v3_power_consumers[] = { diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c index e690927f3505..c51f9db3f66f 100644 --- a/arch/arm/mach-shmobile/clock-r8a7779.c +++ b/arch/arm/mach-shmobile/clock-r8a7779.c @@ -24,9 +24,10 @@ #include #include #include -#include + #include "clock.h" #include "common.h" +#include "r8a7779.h" /* * MD1 = 1 MD1 = 0 diff --git a/arch/arm/mach-shmobile/include/mach/r8a7779.h b/arch/arm/mach-shmobile/include/mach/r8a7779.h deleted file mode 100644 index 5415c719dc19..000000000000 --- a/arch/arm/mach-shmobile/include/mach/r8a7779.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __ASM_R8A7779_H__ -#define __ASM_R8A7779_H__ - -#include - -/* HPB-DMA slave IDs */ -enum { - HPBDMA_SLAVE_DUMMY, - HPBDMA_SLAVE_SDHI0_TX, - HPBDMA_SLAVE_SDHI0_RX, -}; - -extern void r8a7779_init_irq_extpin(int irlm); -extern void r8a7779_init_irq_extpin_dt(int irlm); -extern void r8a7779_init_irq_dt(void); -extern void r8a7779_map_io(void); -extern void r8a7779_earlytimer_init(void); -extern void r8a7779_add_early_devices(void); -extern void r8a7779_add_standard_devices(void); -extern void r8a7779_add_standard_devices_dt(void); -extern void r8a7779_init_late(void); -extern u32 r8a7779_read_mode_pins(void); -extern void r8a7779_clock_init(void); -extern void r8a7779_pinmux_init(void); -extern void r8a7779_pm_init(void); -extern void r8a7779_register_twd(void); - -#ifdef CONFIG_PM -extern void __init r8a7779_init_pm_domains(void); -#else -static inline void r8a7779_init_pm_domains(void) {} -#endif /* CONFIG_PM */ - -extern struct smp_operations r8a7779_smp_ops; - -#endif /* __ASM_R8A7779_H__ */ diff --git a/arch/arm/mach-shmobile/pm-r8a7779.c b/arch/arm/mach-shmobile/pm-r8a7779.c index f0f36cb5ffe7..69f70b7f7fb2 100644 --- a/arch/arm/mach-shmobile/pm-r8a7779.c +++ b/arch/arm/mach-shmobile/pm-r8a7779.c @@ -19,10 +19,12 @@ #include #include #include + #include -#include + #include "common.h" #include "pm-rcar.h" +#include "r8a7779.h" /* SYSC */ #define SYSCIER 0x0c diff --git a/arch/arm/mach-shmobile/r8a7779.h b/arch/arm/mach-shmobile/r8a7779.h new file mode 100644 index 000000000000..5415c719dc19 --- /dev/null +++ b/arch/arm/mach-shmobile/r8a7779.h @@ -0,0 +1,36 @@ +#ifndef __ASM_R8A7779_H__ +#define __ASM_R8A7779_H__ + +#include + +/* HPB-DMA slave IDs */ +enum { + HPBDMA_SLAVE_DUMMY, + HPBDMA_SLAVE_SDHI0_TX, + HPBDMA_SLAVE_SDHI0_RX, +}; + +extern void r8a7779_init_irq_extpin(int irlm); +extern void r8a7779_init_irq_extpin_dt(int irlm); +extern void r8a7779_init_irq_dt(void); +extern void r8a7779_map_io(void); +extern void r8a7779_earlytimer_init(void); +extern void r8a7779_add_early_devices(void); +extern void r8a7779_add_standard_devices(void); +extern void r8a7779_add_standard_devices_dt(void); +extern void r8a7779_init_late(void); +extern u32 r8a7779_read_mode_pins(void); +extern void r8a7779_clock_init(void); +extern void r8a7779_pinmux_init(void); +extern void r8a7779_pm_init(void); +extern void r8a7779_register_twd(void); + +#ifdef CONFIG_PM +extern void __init r8a7779_init_pm_domains(void); +#else +static inline void r8a7779_init_pm_domains(void) {} +#endif /* CONFIG_PM */ + +extern struct smp_operations r8a7779_smp_ops; + +#endif /* __ASM_R8A7779_H__ */ diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c index 2f59b99b9b86..8dbc407f4c8d 100644 --- a/arch/arm/mach-shmobile/setup-r8a7779.c +++ b/arch/arm/mach-shmobile/setup-r8a7779.c @@ -40,14 +40,16 @@ #include #include #include -#include + #include #include #include #include #include + #include "common.h" #include "irqs.h" +#include "r8a7779.h" static struct map_desc r8a7779_io_desc[] __initdata = { /* 2M entity map for 0xf0000000 (MPCORE) */ diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index c230fc0c3fef..3100e355c3fd 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c @@ -23,13 +23,15 @@ #include #include #include -#include + #include #include #include #include + #include "common.h" #include "pm-rcar.h" +#include "r8a7779.h" #define AVECR IOMEM(0xfe700040) #define R8A7779_SCU_BASE 0xf0000000 -- cgit v1.2.3 From 5201b5a792e95e3ecebe74cd3553413a67da09db Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 20 Jun 2014 18:53:07 +0200 Subject: ARM: shmobile: Move r8a7791.h Change location of r8a7791.h so it can be included as "r8a7791.h" instead of the old style Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/board-koelsch-reference.c | 4 +++- arch/arm/mach-shmobile/board-koelsch.c | 4 +++- arch/arm/mach-shmobile/include/mach/r8a7791.h | 11 ----------- arch/arm/mach-shmobile/pm-r8a7791.c | 6 ++++-- arch/arm/mach-shmobile/r8a7791.h | 11 +++++++++++ arch/arm/mach-shmobile/setup-r8a7791.c | 4 +++- arch/arm/mach-shmobile/smp-r8a7791.c | 4 +++- 7 files changed, 27 insertions(+), 17 deletions(-) delete mode 100644 arch/arm/mach-shmobile/include/mach/r8a7791.h create mode 100644 arch/arm/mach-shmobile/r8a7791.h (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index 1d3f67d4ccd6..0b1fb2345aa1 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c @@ -23,11 +23,13 @@ #include #include #include -#include + #include + #include "clock.h" #include "common.h" #include "irqs.h" +#include "r8a7791.h" #include "rcar-gen2.h" /* DU */ diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 0d44e7eb6508..e698b90ae761 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c @@ -45,11 +45,13 @@ #include #include #include -#include + #include #include + #include "common.h" #include "irqs.h" +#include "r8a7791.h" #include "rcar-gen2.h" /* DU */ diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h deleted file mode 100644 index 86eae7bceb6f..000000000000 --- a/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ASM_R8A7791_H__ -#define __ASM_R8A7791_H__ - -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 index 15190875d507..b7e6513fb38a 100644 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -10,10 +10,12 @@ * for more details. */ -#include #include -#include + +#include + #include "pm-rcar.h" +#include "r8a7791.h" /* SYSC */ #define SYSCIER 0x0c diff --git a/arch/arm/mach-shmobile/r8a7791.h b/arch/arm/mach-shmobile/r8a7791.h new file mode 100644 index 000000000000..86eae7bceb6f --- /dev/null +++ b/arch/arm/mach-shmobile/r8a7791.h @@ -0,0 +1,11 @@ +#ifndef __ASM_R8A7791_H__ +#define __ASM_R8A7791_H__ + +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/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index 7e970d005f7f..8823324ac5a9 100644 --- a/arch/arm/mach-shmobile/setup-r8a7791.c +++ b/arch/arm/mach-shmobile/setup-r8a7791.c @@ -26,10 +26,12 @@ #include #include #include -#include + #include + #include "common.h" #include "irqs.h" +#include "r8a7791.h" #include "rcar-gen2.h" static const struct resource pfc_resources[] __initconst = { diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index c6543b6ec759..248255524127 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -17,9 +17,11 @@ #include #include #include + #include -#include + #include "common.h" +#include "r8a7791.h" #include "rcar-gen2.h" #define RST 0xe6160000 -- cgit v1.2.3 From 8b438bcb9009609a15e5480ab1947acff6fb9005 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:20:10 +0900 Subject: ARM: shmobile: Allow use of boot code for non-SMP case Allow build of platsmp.c and headsmp.S even though SMP is disabled in the kernel configuration. With this in place it is possible to share the reset vector setup code with power management code that needs to be built even though SMP is disabled. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Makefile | 11 +++++++---- arch/arm/mach-shmobile/headsmp.S | 13 ++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 9c0ad3e115a6..279d3f3aad4d 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -34,17 +34,17 @@ obj-$(CONFIG_ARCH_R8A7791) += clock-r8a7791.o obj-$(CONFIG_ARCH_R7S72100) += clock-r7s72100.o endif +# CPU reset vector handling objects +cpu-y := platsmp.o headsmp.o + # SMP objects -smp-y := platsmp.o headsmp.o +smp-y := $(cpu-y) smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o platsmp-apmu.o smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o platsmp-apmu.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o -# IRQ objects -obj-$(CONFIG_ARCH_SH7372) += entry-intc.o - # PM objects obj-$(CONFIG_SUSPEND) += suspend.o obj-$(CONFIG_CPU_IDLE) += cpuidle.o @@ -55,6 +55,9 @@ 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 +# IRQ objects +obj-$(CONFIG_ARCH_SH7372) += entry-intc.o + # Board objects ifdef CONFIG_ARCH_SHMOBILE_MULTI obj-$(CONFIG_MACH_GENMAI) += board-genmai-reference.o diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index e5be5c88644b..faf82144a262 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S @@ -10,14 +10,17 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include #include +#include +#include #include +#ifdef CONFIG_SMP ENTRY(shmobile_invalidate_start) bl v7_invalidate_l1 b secondary_startup ENDPROC(shmobile_invalidate_start) +#endif /* * Reset vector for secondary CPUs. @@ -68,7 +71,7 @@ shmobile_smp_boot_find_mpidr: shmobile_smp_boot_next: add r1, r1, #1 - cmp r1, #CONFIG_NR_CPUS + cmp r1, #NR_CPUS blo shmobile_smp_boot_find_mpidr b shmobile_smp_sleep @@ -85,10 +88,10 @@ ENDPROC(shmobile_smp_sleep) .globl shmobile_smp_mpidr shmobile_smp_mpidr: -1: .space CONFIG_NR_CPUS * 4 +1: .space NR_CPUS * 4 .globl shmobile_smp_fn shmobile_smp_fn: -2: .space CONFIG_NR_CPUS * 4 +2: .space NR_CPUS * 4 .globl shmobile_smp_arg shmobile_smp_arg: -3: .space CONFIG_NR_CPUS * 4 +3: .space NR_CPUS * 4 -- cgit v1.2.3 From 784500be40a0eabcee1e48c70927aea9c9accb1e Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:20:18 +0900 Subject: ARM: shmobile: Adjust APMU code to build for non-SMP Adjust the APMU code to allow build when CONFIG_SMP=n. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/platsmp-apmu.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 590e35c22a60..ce07eb9f5cd5 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -25,13 +26,13 @@ static struct { void __iomem *iomem; int bit; -} apmu_cpus[CONFIG_NR_CPUS]; +} apmu_cpus[NR_CPUS]; #define WUPCR_OFFS 0x10 #define PSTR_OFFS 0x40 #define CPUNCR_OFFS(n) (0x100 + (0x10 * (n))) -static int apmu_power_on(void __iomem *p, int bit) +static int __maybe_unused apmu_power_on(void __iomem *p, int bit) { /* request power on */ writel_relaxed(BIT(bit), p + WUPCR_OFFS); @@ -50,7 +51,7 @@ static int apmu_power_off(void __iomem *p, int bit) return 0; } -static int apmu_power_off_poll(void __iomem *p, int bit) +static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit) { int k; @@ -73,7 +74,7 @@ static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu)) static void apmu_init_cpu(struct resource *res, int cpu, int bit) { - if (apmu_cpus[cpu].iomem) + if ((cpu >= ARRAY_SIZE(apmu_cpus)) || apmu_cpus[cpu].iomem) return; apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); @@ -137,6 +138,7 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus) apmu_parse_cfg(apmu_init_cpu); } +#ifdef CONFIG_SMP int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) { /* For this particular CPU register boot vector */ @@ -144,6 +146,7 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) return apmu_wrap(cpu, apmu_power_on); } +#endif #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) /* nicked from arch/arm/mach-exynos/hotplug.c */ -- cgit v1.2.3 From 0d77c9aa7a13a9fcfc93836188474f43394ea657 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:20:46 +0900 Subject: ARM: shmobile: Use __init for APMU suspend init function The function shmobile_smp_apmu_suspend_init() should be put into the init section to not trigger section mismatch warnings. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/platsmp-apmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index ce07eb9f5cd5..a05b16d88257 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -240,7 +240,7 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state) return 0; } -void shmobile_smp_apmu_suspend_init(void) +void __init shmobile_smp_apmu_suspend_init(void) { shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend; } -- cgit v1.2.3 From 07ce9dfaf477e0d16d40faea251898d5a38d8051 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:20:54 +0900 Subject: ARM: shmobile: Move r8a7790 reset code to pm-r8a7790.c Move r8a7790 specific reset vector setup code from the SMP glue code to PM code. This makes the code one step closer to allow PM operations such as Suspend-to-RAM in the case when SMP is disabled in the kernel config. Signed-off-by: Magnus Damm [horms+renesas@verge.net.au: updated for recent #include changes] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/pm-r8a7790.c | 40 ++++++++++++++++++++++++++++++++++-- arch/arm/mach-shmobile/smp-r8a7790.c | 30 --------------------------- 2 files changed, 38 insertions(+), 32 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index 0f1090d851e7..4289b38201a8 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c @@ -11,10 +11,22 @@ */ #include +#include #include #include +#include "common.h" #include "pm-rcar.h" +/* RST */ +#define RST 0xe6160000 +#define CA15BAR 0x0020 +#define CA7BAR 0x0030 +#define CA15RESCNT 0x0040 +#define CA7RESCNT 0x0044 + +/* On-chip RAM */ +#define MERAM 0xe8080000 + /* SYSC */ #define SYSCIER 0x0c #define SYSCIMR 0x10 @@ -38,8 +50,32 @@ static inline void r8a7790_sysc_init(void) {} void __init r8a7790_pm_init(void) { + void __iomem *p; + u32 bar; static int once; - if (!once++) - r8a7790_sysc_init(); + if (once++) + return; + + /* MERAM for jump stub, because BAR requires 256KB aligned address */ + p = ioremap_nocache(MERAM, shmobile_boot_size); + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + iounmap(p); + + /* setup reset vectors */ + p = ioremap_nocache(RST, 0x63); + bar = (MERAM >> 8) & 0xfffffc00; + writel_relaxed(bar, p + CA15BAR); + writel_relaxed(bar, p + CA7BAR); + writel_relaxed(bar | 0x10, p + CA15BAR); + writel_relaxed(bar | 0x10, p + CA7BAR); + + /* de-assert reset for all CPUs */ + writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, + p + CA15RESCNT); + writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, + p + CA7RESCNT); + iounmap(p); + + r8a7790_sysc_init(); } diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 7590e2b6e2fa..81ba90650bb2 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c @@ -22,13 +22,6 @@ #include "common.h" #include "pm-rcar.h" -#define RST 0xe6160000 -#define CA15BAR 0x0020 -#define CA7BAR 0x0030 -#define CA15RESCNT 0x0040 -#define CA7RESCNT 0x0044 -#define MERAM 0xe8080000 - static struct rcar_sysc_ch r8a7790_ca15_scu = { .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ .isr_bit = 12, /* CA15-SCU */ @@ -41,32 +34,9 @@ static struct rcar_sysc_ch r8a7790_ca7_scu = { static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) { - void __iomem *p; - u32 bar; - /* let APMU code install data related to shmobile_boot_vector */ shmobile_smp_apmu_prepare_cpus(max_cpus); - /* MERAM for jump stub, because BAR requires 256KB aligned address */ - p = ioremap_nocache(MERAM, shmobile_boot_size); - memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); - iounmap(p); - - /* setup reset vectors */ - p = ioremap_nocache(RST, 0x63); - bar = (MERAM >> 8) & 0xfffffc00; - writel_relaxed(bar, p + CA15BAR); - writel_relaxed(bar, p + CA7BAR); - writel_relaxed(bar | 0x10, p + CA15BAR); - writel_relaxed(bar | 0x10, p + CA7BAR); - - /* enable clocks to all CPUs */ - writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, - p + CA15RESCNT); - writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, - p + CA7RESCNT); - iounmap(p); - /* turn on power to SCU */ r8a7790_pm_init(); shmobile_smp_apmu_suspend_init(); -- cgit v1.2.3 From 06f2c5dcc24b026872bfc9b50b47c384638d2111 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:21:03 +0900 Subject: ARM: shmobile: Allow r8a7790 to build non-SMP APMU code Build the APMU for r8a7790 even though SMP is disabled in the kernel config. Also initialize Suspend-to-RAM from pm-r8a7790.c to in the future cover both UP and SMP use cases of the APMU. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Makefile | 5 +++-- arch/arm/mach-shmobile/pm-r8a7790.c | 1 + arch/arm/mach-shmobile/smp-r8a7790.c | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 279d3f3aad4d..08f5952ecce7 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -36,12 +36,13 @@ endif # CPU reset vector handling objects cpu-y := platsmp.o headsmp.o +cpu-$(CONFIG_ARCH_R8A7790) += platsmp-apmu.o # SMP objects smp-y := $(cpu-y) smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o -smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o platsmp-apmu.o +smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o platsmp-apmu.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o @@ -52,7 +53,7 @@ obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o -obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o +obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o $(cpu-y) obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o # IRQ objects diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index 4289b38201a8..2f3c25080738 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c @@ -78,4 +78,5 @@ void __init r8a7790_pm_init(void) iounmap(p); r8a7790_sysc_init(); + shmobile_smp_apmu_suspend_init(); } diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 81ba90650bb2..1e254f995ea7 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c @@ -39,7 +39,6 @@ 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); } -- cgit v1.2.3 From 8e26118d44c4877fa52dc8117692f3cc9af3c769 Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:21:11 +0900 Subject: ARM: shmobile: Move r8a7791 reset code to pm-r8a7791.c Move r8a7791 specific reset vector setup code from the SMP glue code to PM code. This makes the code one step closer to allow PM operations such as Suspend-to-RAM in the case when SMP is disabled in the kernel config. Signed-off-by: Magnus Damm [horms+renesas@verge.net.au: updated for recent header file changes] Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/pm-r8a7791.c | 27 +++++++++++++++++++++++++-- arch/arm/mach-shmobile/smp-r8a7791.c | 24 ------------------------ 2 files changed, 25 insertions(+), 26 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c index b7e6513fb38a..c44304c3c6df 100644 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -11,12 +11,17 @@ */ #include - +#include #include - +#include "common.h" #include "pm-rcar.h" #include "r8a7791.h" +#define RST 0xe6160000 +#define CA15BAR 0x0020 +#define CA15RESCNT 0x0040 +#define RAM 0xe6300000 + /* SYSC */ #define SYSCIER 0x0c #define SYSCIMR 0x10 @@ -40,10 +45,28 @@ static inline void r8a7791_sysc_init(void) {} void __init r8a7791_pm_init(void) { + void __iomem *p; + u32 bar; static int once; if (once++) return; + /* RAM for jump stub, because BAR requires 256KB aligned address */ + p = ioremap_nocache(RAM, shmobile_boot_size); + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + iounmap(p); + + /* setup reset vectors */ + p = ioremap_nocache(RST, 0x63); + bar = (RAM >> 8) & 0xfffffc00; + writel_relaxed(bar, p + CA15BAR); + writel_relaxed(bar | 0x10, p + CA15BAR); + + /* enable clocks to all CPUs */ + writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, + p + CA15RESCNT); + iounmap(p); + r8a7791_sysc_init(); } diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index 248255524127..df086aa79630 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -24,35 +24,11 @@ #include "r8a7791.h" #include "rcar-gen2.h" -#define RST 0xe6160000 -#define CA15BAR 0x0020 -#define CA15RESCNT 0x0040 -#define RAM 0xe6300000 - static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) { - void __iomem *p; - u32 bar; - /* let APMU code install data related to shmobile_boot_vector */ shmobile_smp_apmu_prepare_cpus(max_cpus); - /* RAM for jump stub, because BAR requires 256KB aligned address */ - p = ioremap_nocache(RAM, shmobile_boot_size); - memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); - iounmap(p); - - /* setup reset vectors */ - p = ioremap_nocache(RST, 0x63); - bar = (RAM >> 8) & 0xfffffc00; - writel_relaxed(bar, p + CA15BAR); - writel_relaxed(bar | 0x10, p + CA15BAR); - - /* enable clocks to all CPUs */ - writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, - p + CA15RESCNT); - iounmap(p); - r8a7791_pm_init(); shmobile_smp_apmu_suspend_init(); } -- cgit v1.2.3 From bfe4cfa8ae21628267f2b879b4396ee17ea4fd3a Mon Sep 17 00:00:00 2001 From: Magnus Damm Date: Fri, 6 Jun 2014 16:21:19 +0900 Subject: ARM: shmobile: Allow r8a7791 to build non-SMP APMU code Build the APMU for r8a7791 even though SMP is disabled in the kernel config. Also initialize Suspend-to-RAM from pm-r8a7791.c to in the future cover both UP and SMP use cases of the APMU. Signed-off-by: Magnus Damm Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Makefile | 5 +++-- arch/arm/mach-shmobile/pm-r8a7791.c | 1 + arch/arm/mach-shmobile/smp-r8a7791.c | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 08f5952ecce7..cc0224ed4408 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -37,13 +37,14 @@ endif # CPU reset vector handling objects cpu-y := platsmp.o headsmp.o cpu-$(CONFIG_ARCH_R8A7790) += platsmp-apmu.o +cpu-$(CONFIG_ARCH_R8A7791) += platsmp-apmu.o # SMP objects smp-y := $(cpu-y) smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o -smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o platsmp-apmu.o +smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o # PM objects @@ -54,7 +55,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 $(cpu-y) -obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o +obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o $(cpu-y) # IRQ objects obj-$(CONFIG_ARCH_SH7372) += entry-intc.o diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c index c44304c3c6df..25f107bb3657 100644 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -69,4 +69,5 @@ void __init r8a7791_pm_init(void) iounmap(p); r8a7791_sysc_init(); + shmobile_smp_apmu_suspend_init(); } diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index df086aa79630..f743386166fb 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -30,7 +30,6 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) shmobile_smp_apmu_prepare_cpus(max_cpus); r8a7791_pm_init(); - shmobile_smp_apmu_suspend_init(); } static int r8a7791_smp_boot_secondary(unsigned int cpu, -- cgit v1.2.3 From d358c99838f3cf63ad7536124be4318cc84b11fa Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Thu, 3 Jul 2014 16:08:30 +0200 Subject: ARM: shmobile: fix shmobile_smp_apmu_suspend_init build failure for !SUSPEND Patch d6d757c9a4e ("ARM: shmobile: APMU: Add Core-Standby-state for Suspend to RAM") added both an inline wrapper for shmobile_smp_apmu_suspend_init and an empty function in arch/arm/mach-shmobile/platsmp-apmu.c. We get a build failure when both are present, so this patch removes the one in the .c file and keeps the inline version. Signed-off-by: Arnd Bergmann Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/platsmp-apmu.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index a05b16d88257..2c06810d3a70 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c @@ -244,6 +244,4 @@ void __init shmobile_smp_apmu_suspend_init(void) { shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend; } -#else -void shmobile_smp_apmu_suspend_init(void) {} #endif -- cgit v1.2.3 From e423d12cbcb9576785e891617888f627f1f57bf4 Mon Sep 17 00:00:00 2001 From: Gaku Inami Date: Wed, 25 Jun 2014 16:58:40 +0900 Subject: ARM: shmobile: Remove opps table check for cpufreq This patch is based on feedback from Viresh Kumar. Since cpufreq-cpu0 driver has already check opp table, there is no need to same check in mach-shmobile. Signed-off-by: Gaku Inami Acked-by: Viresh Kumar Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/cpufreq.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/cpufreq.c b/arch/arm/mach-shmobile/cpufreq.c index e2c868fc41cf..8a24b2be46ae 100644 --- a/arch/arm/mach-shmobile/cpufreq.c +++ b/arch/arm/mach-shmobile/cpufreq.c @@ -8,24 +8,10 @@ * for more details. */ -#include -#include #include int __init shmobile_cpufreq_init(void) { - struct device_node *np; - - np = of_cpu_device_node_get(0); - if (np == NULL) { - pr_err("failed to find cpu0 node\n"); - return 0; - } - - if (of_get_property(np, "operating-points", NULL)) - platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); - - of_node_put(np); - + platform_device_register_simple("cpufreq-cpu0", -1, NULL, 0); return 0; } -- cgit v1.2.3 From 7a0c99478dca80f862912be02bf8ec240a9098d1 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 7 Jul 2014 09:54:26 +0200 Subject: ARM: shmobile: r8a7778: add SCI clock support for DT This will be used when initialising SCI devices using DT until common clock framework support is added. Acked-by: Laurent Pinchart Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a7778.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index 13f8f3ab8840..a6dd601165e2 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c @@ -202,11 +202,17 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("i2c-rcar.3", &mstp_clks[MSTP027]), /* I2C3 */ CLKDEV_DEV_ID("ffc73000.i2c", &mstp_clks[MSTP027]), /* I2C3 */ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP026]), /* SCIF0 */ + CLKDEV_DEV_ID("ffe40000.serial", &mstp_clks[MSTP026]), /* SCIF0 */ CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP025]), /* SCIF1 */ + CLKDEV_DEV_ID("ffe41000.serial", &mstp_clks[MSTP025]), /* SCIF1 */ CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP024]), /* SCIF2 */ + CLKDEV_DEV_ID("ffe42000.serial", &mstp_clks[MSTP024]), /* SCIF2 */ CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ + CLKDEV_DEV_ID("ffe43000.serial", &mstp_clks[MSTP023]), /* SCIF3 */ CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ + CLKDEV_DEV_ID("ffe44000.serial", &mstp_clks[MSTP022]), /* SCIF4 */ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ + CLKDEV_DEV_ID("ffe45000.serial", &mstp_clks[MSTP021]), /* SCIF5 */ CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ -- cgit v1.2.3 From 9947efaac0545fd833b0ff5147578aba79d297bc Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 7 Jul 2014 09:54:32 +0200 Subject: ARM: shmobile: r8a73a4: add SCI clock support for DT This will be used when initialising SCI devices using DT until common clock framework support is added. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a73a4.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c index b5bc22c6a858..1d2fe056fa20 100644 --- a/arch/arm/mach-shmobile/clock-r8a73a4.c +++ b/arch/arm/mach-shmobile/clock-r8a73a4.c @@ -574,11 +574,17 @@ static struct clk_lookup lookups[] = { /* MSTP */ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), + CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), + CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP206]), + CLKDEV_DEV_ID("e6c20000.serial", &mstp_clks[MSTP206]), CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP207]), + CLKDEV_DEV_ID("e6c30000.serial", &mstp_clks[MSTP207]), CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP216]), + CLKDEV_DEV_ID("e6ce0000.serial", &mstp_clks[MSTP216]), CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP217]), + CLKDEV_DEV_ID("e6cf0000.serial", &mstp_clks[MSTP217]), CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), CLKDEV_DEV_ID("e6700020.dma-controller", &mstp_clks[MSTP218]), CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), -- cgit v1.2.3 From d1ec90f2875471df2c954f7cbd45b2389ff86aa2 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 7 Jul 2014 09:54:40 +0200 Subject: ARM: shmobile: r8a7740: correct SCI clock support for DT When initialising SCI devices their names will be .serial not .sci. This will be used when initialising SCI devices using DT until common clock framework support is added. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-r8a7740.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c index 50931e3c97c7..68592b7109f7 100644 --- a/arch/arm/mach-shmobile/clock-r8a7740.c +++ b/arch/arm/mach-shmobile/clock-r8a7740.c @@ -555,27 +555,27 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), - CLKDEV_DEV_ID("e6c80000.sci", &mstp_clks[MSTP200]), + CLKDEV_DEV_ID("e6c80000.serial", &mstp_clks[MSTP200]), CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), - CLKDEV_DEV_ID("e6c70000.sci", &mstp_clks[MSTP201]), + CLKDEV_DEV_ID("e6c70000.serial", &mstp_clks[MSTP201]), CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), - CLKDEV_DEV_ID("e6c60000.sci", &mstp_clks[MSTP202]), + CLKDEV_DEV_ID("e6c60000.serial", &mstp_clks[MSTP202]), CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), - CLKDEV_DEV_ID("e6c50000.sci", &mstp_clks[MSTP203]), + CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), - CLKDEV_DEV_ID("e6c40000.sci", &mstp_clks[MSTP204]), + CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), - CLKDEV_DEV_ID("e6c30000.sci", &mstp_clks[MSTP206]), + CLKDEV_DEV_ID("e6c30000.serial", &mstp_clks[MSTP206]), CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), - CLKDEV_DEV_ID("e6cb0000.sci", &mstp_clks[MSTP207]), + CLKDEV_DEV_ID("e6cb0000.serial", &mstp_clks[MSTP207]), CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP222]), - CLKDEV_DEV_ID("e6cd0000.sci", &mstp_clks[MSTP222]), + CLKDEV_DEV_ID("e6cd0000.serial", &mstp_clks[MSTP222]), CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]), - CLKDEV_DEV_ID("e6cc0000.sci", &mstp_clks[MSTP230]), + CLKDEV_DEV_ID("e6cc0000.serial", &mstp_clks[MSTP230]), CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), CLKDEV_DEV_ID("fe1f0000.sound", &mstp_clks[MSTP328]), -- cgit v1.2.3 From ff4ce48e1f163d945c037c1c90ce12950961d91d Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Mon, 7 Jul 2014 09:54:50 +0200 Subject: ARM: shmobile: sh73a0: add SCI clock support for DT This will be used when initialising SCI devices using DT until common clock framework support is added. Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/clock-sh73a0.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 0d9cd1fe0212..4990e03482d2 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c @@ -638,16 +638,25 @@ static struct clk_lookup lookups[] = { CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */ CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), /* LCDC0 */ CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP219]), /* SCIFA7 */ + CLKDEV_DEV_ID("e6cd0000.serial", &mstp_clks[MSTP219]), /* SCIFA7 */ CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* SY-DMAC */ CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* MP-DMAC */ CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ + CLKDEV_DEV_ID("e6cb0000.serial", &mstp_clks[MSTP207]), /* SCIFA5 */ CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP206]), /* SCIFB */ + CLKDEV_DEV_ID("0xe6c3000.serial", &mstp_clks[MSTP206]), /* SCIFB */ CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ + CLKDEV_DEV_ID("e6c40000.serial", &mstp_clks[MSTP204]), /* SCIFA0 */ CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ + CLKDEV_DEV_ID("e6c50000.serial", &mstp_clks[MSTP203]), /* SCIFA1 */ CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ + CLKDEV_DEV_ID("e6c60000.serial", &mstp_clks[MSTP202]), /* SCIFA2 */ CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ + CLKDEV_DEV_ID("e6c70000.serial", &mstp_clks[MSTP201]), /* SCIFA3 */ CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ + CLKDEV_DEV_ID("e6c80000.serial", &mstp_clks[MSTP200]), /* SCIFA4 */ CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ + CLKDEV_DEV_ID("e6cc0000.serial", &mstp_clks[MSTP331]), /* SCIFA6 */ CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ CLKDEV_DEV_ID("ec230000.sound", &mstp_clks[MSTP328]), /* FSI */ CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ -- cgit v1.2.3