From 8883e72da3a0859e910f96c0372baf08ab47f7ae Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 26 Jan 2015 17:21:14 +0100 Subject: ARM: shmobile: R-Car Gen2: CONFIG_COMMON_CLK is always set Since commit e042681894b62d60 ("ARM: shmobile: r8a7790: Remove legacy code"), all R-Car Gen2 SoCs are supported by multiplatform kernels only. As CONFIG_COMMON_CLK is always set for multiplatform kernels, we can remove related #ifdefs in code specific to R-Car Gen2 SoCs. Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-rcar-gen2.c | 4 ---- 1 file changed, 4 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 d1fa625e61f5..51464cc6d65b 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c @@ -50,9 +50,7 @@ u32 rcar_gen2_read_mode_pins(void) void __init rcar_gen2_timer_init(void) { -#if defined(CONFIG_ARM_ARCH_TIMER) || defined(CONFIG_COMMON_CLK) u32 mode = rcar_gen2_read_mode_pins(); -#endif #ifdef CONFIG_ARM_ARCH_TIMER void __iomem *base; int extal_mhz = 0; @@ -128,9 +126,7 @@ void __init rcar_gen2_timer_init(void) iounmap(base); #endif /* CONFIG_ARM_ARCH_TIMER */ -#ifdef CONFIG_COMMON_CLK rcar_gen2_clocks_init(mode); -#endif #ifdef CONFIG_ARCH_SHMOBILE_MULTI clocksource_of_init(); #endif -- cgit v1.2.3 From 6e5e9c6835e05ccc2be67486bc998b6f62663621 Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Mon, 23 Feb 2015 16:59:28 +0100 Subject: ARM: shmobile: r8a7740: Remove restart callback Remove the restart handling hack from the r8a7740 generic multiplatform case. Restart on DT-based r8a7740 platforms is now handled through the R-Mobile reset driver. This reverts commit 1174c712afa2779f ("ARM: shmobile: r8a7740: Add restart callback"). Signed-off-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/setup-r8a7740.c | 8 -------- 1 file changed, 8 deletions(-) (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index dd64caf79216..9832e48396a4 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c @@ -842,13 +842,6 @@ static void __init r8a7740_generic_init(void) of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); } -#define RESCNT2 IOMEM(0xe6188020) -static void r8a7740_restart(enum reboot_mode mode, const char *cmd) -{ - /* Do soft power on reset */ - writel(1 << 31, RESCNT2); -} - static const char *r8a7740_boards_compat_dt[] __initdata = { "renesas,r8a7740", NULL, @@ -861,7 +854,6 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") .init_machine = r8a7740_generic_init, .init_late = shmobile_init_late, .dt_compat = r8a7740_boards_compat_dt, - .restart = r8a7740_restart, MACHINE_END #endif /* CONFIG_USE_OF */ -- cgit v1.2.3 From ee72f6adfdd95b53432eb60b6944c6fe2790dd13 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 12 Mar 2015 12:55:36 +0900 Subject: ARM: shmobile: r8a7790: Correct SYSCIER value Set the SYSCIER as per the values indicated in the documentation. The value previously used appears to been copied from the r8a7779 implementation but on closer inspection is not correct for the r8a7790. Fixes: a48f165509c1 ("ARM: shmobile: r8a7790 SYSC setup code") Reported-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/pm-r8a7790.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 80e8d95e54d3..23b61f170c22 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c @@ -38,7 +38,7 @@ static void __init r8a7790_sysc_init(void) void __iomem *base = rcar_sysc_init(0xe6180000); /* enable all interrupt sources, but do not use interrupt handler */ - iowrite32(0x0131000e, base + SYSCIER); + iowrite32(0x013111ef, base + SYSCIER); iowrite32(0, base + SYSCIMR); } -- cgit v1.2.3 From 78420b5dca18f2034f18925f5608cda2c960c3f3 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Thu, 12 Mar 2015 12:55:37 +0900 Subject: ARM: shmobile: r8a7791: Correct SYSCIER value Set the SYSCIER as per the values indicated in the documentation. The value previously used appears to been copied from the r8a7779 implementation but on closer inspection is not correct for the r8a7791. Fixes: 5f6108bb9643 ("ARM: shmobile: r8a7791 SYSC setup code") Reported-by: Geert Uytterhoeven Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/pm-r8a7791.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 25f107bb3657..f7cfb3b72574 100644 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ b/arch/arm/mach-shmobile/pm-r8a7791.c @@ -33,7 +33,7 @@ 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(0x00111003, base + SYSCIER); iowrite32(0, base + SYSCIMR); } -- cgit v1.2.3 From a8caad66904a7923c05fc4a137110085533ef00c Mon Sep 17 00:00:00 2001 From: Gaku Inami Date: Mon, 16 Mar 2015 14:48:43 +0900 Subject: ARM: shmobile: Consolidate the pm code for R-Car Gen2 The pm code for R-Car Gen2 is scatterd in each SoC. These files (pm-r8a7790.c/pm-r8a7791.c) have some overlap code. This change consolidate the pm code for R-Car Gen2 into one. Signed-off-by: Gaku Inami Acked-by: Geert Uytterhoeven Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Makefile | 5 +- arch/arm/mach-shmobile/pm-r8a7790.c | 82 ------------------------ arch/arm/mach-shmobile/pm-r8a7791.c | 73 --------------------- arch/arm/mach-shmobile/pm-rcar-gen2.c | 115 ++++++++++++++++++++++++++++++++++ arch/arm/mach-shmobile/r8a7790.h | 1 - arch/arm/mach-shmobile/r8a7791.h | 1 - arch/arm/mach-shmobile/rcar-gen2.h | 1 + arch/arm/mach-shmobile/smp-r8a7790.c | 3 +- arch/arm/mach-shmobile/smp-r8a7791.c | 2 +- 9 files changed, 122 insertions(+), 161 deletions(-) delete mode 100644 arch/arm/mach-shmobile/pm-r8a7790.c delete mode 100644 arch/arm/mach-shmobile/pm-r8a7791.c create mode 100644 arch/arm/mach-shmobile/pm-rcar-gen2.c (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index d53996e6da97..0ae702b0d45b 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -12,8 +12,8 @@ obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o pm-r8a7740.o obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o pm-r8a7779.o -obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o pm-r8a7790.o -obj-$(CONFIG_ARCH_R8A7791) += setup-r8a7791.o pm-r8a7791.o +obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o +obj-$(CONFIG_ARCH_R8A7791) += setup-r8a7791.o obj-$(CONFIG_ARCH_R8A7794) += setup-r8a7794.o obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o @@ -50,6 +50,7 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_PM_RCAR) += pm-rcar.o obj-$(CONFIG_PM_RMOBILE) += pm-rmobile.o +obj-$(CONFIG_ARCH_RCAR_GEN2) += pm-rcar-gen2.o # special sh7372 handling for IRQ objects and low level sleep code obj-$(CONFIG_ARCH_SH7372) += entry-intc.o sleep-sh7372.o diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c deleted file mode 100644 index 23b61f170c22..000000000000 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * r8a7790 Power management support - * - * Copyright (C) 2013 Renesas Electronics Corporation - * Copyright (C) 2011 Renesas Solutions Corp. - * Copyright (C) 2011 Magnus Damm - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file "COPYING" in the main directory of this archive - * for more details. - */ - -#include -#include -#include -#include "common.h" -#include "pm-rcar.h" -#include "r8a7790.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 - -#if defined(CONFIG_SMP) - -static void __init r8a7790_sysc_init(void) -{ - void __iomem *base = rcar_sysc_init(0xe6180000); - - /* enable all interrupt sources, but do not use interrupt handler */ - iowrite32(0x013111ef, base + SYSCIER); - iowrite32(0, base + SYSCIMR); -} - -#else /* CONFIG_SMP */ - -static inline void r8a7790_sysc_init(void) {} - -#endif /* CONFIG_SMP */ - -void __init r8a7790_pm_init(void) -{ - void __iomem *p; - u32 bar; - static int once; - - 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(); - shmobile_smp_apmu_suspend_init(); -} diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c deleted file mode 100644 index f7cfb3b72574..000000000000 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 "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 - -#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(0x00111003, 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) -{ - 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(); - shmobile_smp_apmu_suspend_init(); -} diff --git a/arch/arm/mach-shmobile/pm-rcar-gen2.c b/arch/arm/mach-shmobile/pm-rcar-gen2.c new file mode 100644 index 000000000000..6815781ad116 --- /dev/null +++ b/arch/arm/mach-shmobile/pm-rcar-gen2.c @@ -0,0 +1,115 @@ +/* + * R-Car Generation 2 Power management support + * + * Copyright (C) 2013 - 2015 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 +#include "common.h" +#include "pm-rcar.h" +#include "rcar-gen2.h" + +/* RST */ +#define RST 0xe6160000 +#define CA15BAR 0x0020 +#define CA7BAR 0x0030 +#define CA15RESCNT 0x0040 +#define CA7RESCNT 0x0044 + +/* On-chip RAM */ +#define MERAM 0xe8080000 +#define RAM 0xe6300000 + +/* SYSC */ +#define SYSCIER 0x0c +#define SYSCIMR 0x10 + +#if defined(CONFIG_SMP) + +static void __init rcar_gen2_sysc_init(u32 syscier) +{ + void __iomem *base = rcar_sysc_init(0xe6180000); + + /* enable all interrupt sources, but do not use interrupt handler */ + iowrite32(syscier, base + SYSCIER); + iowrite32(0, base + SYSCIMR); +} + +#else /* CONFIG_SMP */ + +static inline void rcar_gen2_sysc_init(u32 syscier) {} + +#endif /* CONFIG_SMP */ + +void __init rcar_gen2_pm_init(void) +{ + void __iomem *p; + u32 bar; + static int once; + struct device_node *np, *cpus; + bool has_a7 = false; + bool has_a15 = false; + phys_addr_t boot_vector_addr = 0; + u32 syscier = 0; + + if (once++) + return; + + cpus = of_find_node_by_path("/cpus"); + if (!cpus) + return; + + for_each_child_of_node(cpus, np) { + if (of_device_is_compatible(np, "arm,cortex-a15")) + has_a15 = true; + else if (of_device_is_compatible(np, "arm,cortex-a7")) + has_a7 = true; + } + + if (of_machine_is_compatible("renesas,r8a7790")) { + boot_vector_addr = MERAM; + syscier = 0x013111ef; + + } else if (of_machine_is_compatible("renesas,r8a7791")) { + boot_vector_addr = RAM; + syscier = 0x00111003; + } + + /* RAM for jump stub, because BAR requires 256KB aligned address */ + p = ioremap_nocache(boot_vector_addr, shmobile_boot_size); + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); + iounmap(p); + + /* setup reset vectors */ + p = ioremap_nocache(RST, 0x63); + bar = (boot_vector_addr >> 8) & 0xfffffc00; + if (has_a15) { + writel_relaxed(bar, p + CA15BAR); + writel_relaxed(bar | 0x10, p + CA15BAR); + + /* de-assert reset for CA15 CPUs */ + writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | + 0xa5a50000, p + CA15RESCNT); + } + if (has_a7) { + writel_relaxed(bar, p + CA7BAR); + writel_relaxed(bar | 0x10, p + CA7BAR); + + /* de-assert reset for CA7 CPUs */ + writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | + 0x5a5a0000, p + CA7RESCNT); + } + iounmap(p); + + rcar_gen2_sysc_init(syscier); + shmobile_smp_apmu_suspend_init(); +} diff --git a/arch/arm/mach-shmobile/r8a7790.h b/arch/arm/mach-shmobile/r8a7790.h index bf73a850aaed..1a46d026052c 100644 --- a/arch/arm/mach-shmobile/r8a7790.h +++ b/arch/arm/mach-shmobile/r8a7790.h @@ -1,7 +1,6 @@ #ifndef __ASM_R8A7790_H__ #define __ASM_R8A7790_H__ -void r8a7790_pm_init(void); extern struct smp_operations r8a7790_smp_ops; #endif /* __ASM_R8A7790_H__ */ diff --git a/arch/arm/mach-shmobile/r8a7791.h b/arch/arm/mach-shmobile/r8a7791.h index 6cf11eb69d10..7ca0b7d0f59b 100644 --- a/arch/arm/mach-shmobile/r8a7791.h +++ b/arch/arm/mach-shmobile/r8a7791.h @@ -1,7 +1,6 @@ #ifndef __ASM_R8A7791_H__ #define __ASM_R8A7791_H__ -void r8a7791_pm_init(void); extern struct smp_operations r8a7791_smp_ops; #endif /* __ASM_R8A7791_H__ */ diff --git a/arch/arm/mach-shmobile/rcar-gen2.h b/arch/arm/mach-shmobile/rcar-gen2.h index ce53cb5f53a1..8a66b4aae035 100644 --- a/arch/arm/mach-shmobile/rcar-gen2.h +++ b/arch/arm/mach-shmobile/rcar-gen2.h @@ -5,5 +5,6 @@ void rcar_gen2_timer_init(void); #define MD(nr) BIT(nr) u32 rcar_gen2_read_mode_pins(void); void rcar_gen2_reserve(void); +void rcar_gen2_pm_init(void); #endif /* __ASM_RCAR_GEN2_H__ */ diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index 9c3da1345b8b..f8be41575d7c 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c @@ -23,6 +23,7 @@ #include "common.h" #include "platsmp-apmu.h" #include "pm-rcar.h" +#include "rcar-gen2.h" #include "r8a7790.h" static struct rcar_sysc_ch r8a7790_ca15_scu = { @@ -54,7 +55,7 @@ static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) ARRAY_SIZE(r8a7790_apmu_config)); /* turn on power to SCU */ - r8a7790_pm_init(); + rcar_gen2_pm_init(); rcar_sysc_power_up(&r8a7790_ca15_scu); rcar_sysc_power_up(&r8a7790_ca7_scu); } diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index 7e49e0a52e32..6658682d5c9e 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c @@ -39,7 +39,7 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) r8a7791_apmu_config, ARRAY_SIZE(r8a7791_apmu_config)); - r8a7791_pm_init(); + rcar_gen2_pm_init(); } static int r8a7791_smp_boot_secondary(unsigned int cpu, -- cgit v1.2.3 From df67a2b72eb6fa205c0954e3f4f416e282e7412b Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Tue, 17 Mar 2015 16:25:12 +0100 Subject: ARM: shmobile: cpuidle: Remove the pointless default driver The default idle driver uses one state with the WFI instruction. The default idle routine invokes WFI when no cpuidle driver is present. The default cpuidle driver is pointless and does not give more than the default idle routine and moreover it pulls all the mathematics tied with the cpuidle governor for nothing, hence consuming more energy. Remove the default driver, the related code and register the driver directly. [compiled only - no board - no test] Signed-off-by: Daniel Lezcano Signed-off-by: Simon Horman --- arch/arm/mach-shmobile/Makefile | 1 - arch/arm/mach-shmobile/common.h | 9 --------- arch/arm/mach-shmobile/cpuidle.c | 37 ------------------------------------- arch/arm/mach-shmobile/pm-sh7372.c | 2 +- 4 files changed, 1 insertion(+), 48 deletions(-) delete mode 100644 arch/arm/mach-shmobile/cpuidle.c (limited to 'arch/arm/mach-shmobile') diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index d53996e6da97..c60429652a6a 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile @@ -46,7 +46,6 @@ smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o # PM objects obj-$(CONFIG_SUSPEND) += suspend.o -obj-$(CONFIG_CPU_IDLE) += cpuidle.o obj-$(CONFIG_CPU_FREQ) += cpufreq.o obj-$(CONFIG_PM_RCAR) += pm-rcar.o obj-$(CONFIG_PM_RMOBILE) += pm-rmobile.o diff --git a/arch/arm/mach-shmobile/common.h b/arch/arm/mach-shmobile/common.h index 309025efd4cf..1dc09713f753 100644 --- a/arch/arm/mach-shmobile/common.h +++ b/arch/arm/mach-shmobile/common.h @@ -23,8 +23,6 @@ struct clk; extern int shmobile_clk_init(void); extern void shmobile_handle_irq_intc(struct pt_regs *); extern struct platform_suspend_ops shmobile_suspend_ops; -struct cpuidle_driver; -extern void shmobile_cpuidle_set_driver(struct cpuidle_driver *drv); #ifdef CONFIG_SUSPEND int shmobile_suspend_init(void); @@ -34,12 +32,6 @@ static inline int shmobile_suspend_init(void) { return 0; } static inline void shmobile_smp_apmu_suspend_init(void) { } #endif -#ifdef CONFIG_CPU_IDLE -int shmobile_cpuidle_init(void); -#else -static inline int shmobile_cpuidle_init(void) { return 0; } -#endif - #ifdef CONFIG_CPU_FREQ int shmobile_cpufreq_init(void); #else @@ -51,7 +43,6 @@ extern void __iomem *shmobile_scu_base; static inline void __init shmobile_init_late(void) { shmobile_suspend_init(); - shmobile_cpuidle_init(); shmobile_cpufreq_init(); } diff --git a/arch/arm/mach-shmobile/cpuidle.c b/arch/arm/mach-shmobile/cpuidle.c deleted file mode 100644 index 0afeb5c7061c..000000000000 --- a/arch/arm/mach-shmobile/cpuidle.c +++ /dev/null @@ -1,37 +0,0 @@ -/* - * CPUIdle support code for SH-Mobile ARM - * - * 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 -#include -#include -#include - -static struct cpuidle_driver shmobile_cpuidle_default_driver = { - .name = "shmobile_cpuidle", - .owner = THIS_MODULE, - .states[0] = ARM_CPUIDLE_WFI_STATE, - .safe_state_index = 0, /* C1 */ - .state_count = 1, -}; - -static struct cpuidle_driver *cpuidle_drv = &shmobile_cpuidle_default_driver; - -void __init shmobile_cpuidle_set_driver(struct cpuidle_driver *drv) -{ - cpuidle_drv = drv; -} - -int __init shmobile_cpuidle_init(void) -{ - return cpuidle_register(cpuidle_drv, NULL); -} diff --git a/arch/arm/mach-shmobile/pm-sh7372.c b/arch/arm/mach-shmobile/pm-sh7372.c index c0293ae4b013..9f190528a556 100644 --- a/arch/arm/mach-shmobile/pm-sh7372.c +++ b/arch/arm/mach-shmobile/pm-sh7372.c @@ -462,7 +462,7 @@ static struct cpuidle_driver sh7372_cpuidle_driver = { static void __init sh7372_cpuidle_init(void) { - shmobile_cpuidle_set_driver(&sh7372_cpuidle_driver); + return cpuidle_register(cpuidle_drv, NULL); } #else static void __init sh7372_cpuidle_init(void) {} -- cgit v1.2.3