diff options
Diffstat (limited to 'arch/sh')
32 files changed, 222 insertions, 460 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index 5e859633ce69..78d8ace57272 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -33,6 +33,7 @@ config SUPERH | |||
33 | select GENERIC_ATOMIC64 | 33 | select GENERIC_ATOMIC64 |
34 | select GENERIC_IRQ_SHOW | 34 | select GENERIC_IRQ_SHOW |
35 | select GENERIC_SMP_IDLE_THREAD | 35 | select GENERIC_SMP_IDLE_THREAD |
36 | select GENERIC_IDLE_POLL_SETUP | ||
36 | select GENERIC_CLOCKEVENTS | 37 | select GENERIC_CLOCKEVENTS |
37 | select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST | 38 | select GENERIC_CMOS_UPDATE if SH_SH03 || SH_DREAMCAST |
38 | select GENERIC_STRNCPY_FROM_USER | 39 | select GENERIC_STRNCPY_FROM_USER |
@@ -148,9 +149,6 @@ config ARCH_HAS_ILOG2_U32 | |||
148 | config ARCH_HAS_ILOG2_U64 | 149 | config ARCH_HAS_ILOG2_U64 |
149 | def_bool n | 150 | def_bool n |
150 | 151 | ||
151 | config ARCH_HAS_DEFAULT_IDLE | ||
152 | def_bool y | ||
153 | |||
154 | config NO_IOPORT | 152 | config NO_IOPORT |
155 | def_bool !PCI | 153 | def_bool !PCI |
156 | depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN && \ | 154 | depends on !SH_CAYMAN && !SH_SH4202_MICRODEV && !SH_SHMIN && \ |
@@ -624,25 +622,7 @@ config SH_CLK_CPG_LEGACY | |||
624 | endmenu | 622 | endmenu |
625 | 623 | ||
626 | menu "CPU Frequency scaling" | 624 | menu "CPU Frequency scaling" |
627 | |||
628 | source "drivers/cpufreq/Kconfig" | 625 | source "drivers/cpufreq/Kconfig" |
629 | |||
630 | config SH_CPU_FREQ | ||
631 | tristate "SuperH CPU Frequency driver" | ||
632 | depends on CPU_FREQ | ||
633 | select CPU_FREQ_TABLE | ||
634 | help | ||
635 | This adds the cpufreq driver for SuperH. Any CPU that supports | ||
636 | clock rate rounding through the clock framework can use this | ||
637 | driver. While it will make the kernel slightly larger, this is | ||
638 | harmless for CPUs that don't support rate rounding. The driver | ||
639 | will also generate a notice in the boot log before disabling | ||
640 | itself if the CPU in question is not capable of rate rounding. | ||
641 | |||
642 | For details, take a look at <file:Documentation/cpu-freq>. | ||
643 | |||
644 | If unsure, say N. | ||
645 | |||
646 | endmenu | 626 | endmenu |
647 | 627 | ||
648 | source "arch/sh/drivers/Kconfig" | 628 | source "arch/sh/drivers/Kconfig" |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index aaff7671101b..764530c85aa9 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -254,11 +254,13 @@ static int usbhs_get_id(struct platform_device *pdev) | |||
254 | return gpio_get_value(GPIO_PTB3); | 254 | return gpio_get_value(GPIO_PTB3); |
255 | } | 255 | } |
256 | 256 | ||
257 | static void usbhs_phy_reset(struct platform_device *pdev) | 257 | static int usbhs_phy_reset(struct platform_device *pdev) |
258 | { | 258 | { |
259 | /* enable vbus if HOST */ | 259 | /* enable vbus if HOST */ |
260 | if (!gpio_get_value(GPIO_PTB3)) | 260 | if (!gpio_get_value(GPIO_PTB3)) |
261 | gpio_set_value(GPIO_PTB5, 1); | 261 | gpio_set_value(GPIO_PTB5, 1); |
262 | |||
263 | return 0; | ||
262 | } | 264 | } |
263 | 265 | ||
264 | static struct renesas_usbhs_platform_info usbhs_info = { | 266 | static struct renesas_usbhs_platform_info usbhs_info = { |
diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c index f46848f088e4..c0eec08d8f95 100644 --- a/arch/sh/drivers/dma/dma-api.c +++ b/arch/sh/drivers/dma/dma-api.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/spinlock.h> | 14 | #include <linux/spinlock.h> |
15 | #include <linux/proc_fs.h> | 15 | #include <linux/proc_fs.h> |
16 | #include <linux/seq_file.h> | ||
16 | #include <linux/list.h> | 17 | #include <linux/list.h> |
17 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
18 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
@@ -308,11 +309,9 @@ int dma_extend(unsigned int chan, unsigned long op, void *param) | |||
308 | } | 309 | } |
309 | EXPORT_SYMBOL(dma_extend); | 310 | EXPORT_SYMBOL(dma_extend); |
310 | 311 | ||
311 | static int dma_read_proc(char *buf, char **start, off_t off, | 312 | static int dma_proc_show(struct seq_file *m, void *v) |
312 | int len, int *eof, void *data) | ||
313 | { | 313 | { |
314 | struct dma_info *info; | 314 | struct dma_info *info = v; |
315 | char *p = buf; | ||
316 | 315 | ||
317 | if (list_empty(®istered_dmac_list)) | 316 | if (list_empty(®istered_dmac_list)) |
318 | return 0; | 317 | return 0; |
@@ -332,14 +331,26 @@ static int dma_read_proc(char *buf, char **start, off_t off, | |||
332 | if (!(channel->flags & DMA_CONFIGURED)) | 331 | if (!(channel->flags & DMA_CONFIGURED)) |
333 | continue; | 332 | continue; |
334 | 333 | ||
335 | p += sprintf(p, "%2d: %14s %s\n", i, | 334 | seq_printf(m, "%2d: %14s %s\n", i, |
336 | info->name, channel->dev_id); | 335 | info->name, channel->dev_id); |
337 | } | 336 | } |
338 | } | 337 | } |
339 | 338 | ||
340 | return p - buf; | 339 | return 0; |
340 | } | ||
341 | |||
342 | static int dma_proc_open(struct inode *inode, struct file *file) | ||
343 | { | ||
344 | return single_open(file, dma_proc_show, NULL); | ||
341 | } | 345 | } |
342 | 346 | ||
347 | static const struct file_operations dma_proc_fops = { | ||
348 | .open = dma_proc_open, | ||
349 | .read = seq_read, | ||
350 | .llseek = seq_lseek, | ||
351 | .release = single_release, | ||
352 | }; | ||
353 | |||
343 | int register_dmac(struct dma_info *info) | 354 | int register_dmac(struct dma_info *info) |
344 | { | 355 | { |
345 | unsigned int total_channels, i; | 356 | unsigned int total_channels, i; |
@@ -412,8 +423,7 @@ EXPORT_SYMBOL(unregister_dmac); | |||
412 | static int __init dma_api_init(void) | 423 | static int __init dma_api_init(void) |
413 | { | 424 | { |
414 | printk(KERN_NOTICE "DMA: Registering DMA API.\n"); | 425 | printk(KERN_NOTICE "DMA: Registering DMA API.\n"); |
415 | return create_proc_read_entry("dma", 0, 0, dma_read_proc, 0) | 426 | return proc_create("dma", 0, NULL, &dma_proc_fops) ? 0 : -ENOMEM; |
416 | ? 0 : -ENOMEM; | ||
417 | } | 427 | } |
418 | subsys_initcall(dma_api_init); | 428 | subsys_initcall(dma_api_init); |
419 | 429 | ||
diff --git a/arch/sh/drivers/pci/pcie-sh7786.c b/arch/sh/drivers/pci/pcie-sh7786.c index c2c85f6cd738..a162a7f86b2e 100644 --- a/arch/sh/drivers/pci/pcie-sh7786.c +++ b/arch/sh/drivers/pci/pcie-sh7786.c | |||
@@ -35,7 +35,7 @@ static unsigned int nr_ports; | |||
35 | 35 | ||
36 | static struct sh7786_pcie_hwops { | 36 | static struct sh7786_pcie_hwops { |
37 | int (*core_init)(void); | 37 | int (*core_init)(void); |
38 | async_func_ptr *port_init_hw; | 38 | async_func_t port_init_hw; |
39 | } *sh7786_pcie_hwops; | 39 | } *sh7786_pcie_hwops; |
40 | 40 | ||
41 | static struct resource sh7786_pci0_resources[] = { | 41 | static struct resource sh7786_pci0_resources[] = { |
diff --git a/arch/sh/include/asm/hugetlb.h b/arch/sh/include/asm/hugetlb.h index b3808c7d67b2..699255d6d1c6 100644 --- a/arch/sh/include/asm/hugetlb.h +++ b/arch/sh/include/asm/hugetlb.h | |||
@@ -3,6 +3,7 @@ | |||
3 | 3 | ||
4 | #include <asm/cacheflush.h> | 4 | #include <asm/cacheflush.h> |
5 | #include <asm/page.h> | 5 | #include <asm/page.h> |
6 | #include <asm-generic/hugetlb.h> | ||
6 | 7 | ||
7 | 8 | ||
8 | static inline int is_hugepage_only_range(struct mm_struct *mm, | 9 | static inline int is_hugepage_only_range(struct mm_struct *mm, |
diff --git a/arch/sh/include/asm/suspend.h b/arch/sh/include/asm/suspend.h index e14567a7e9a1..70ae0b2888ab 100644 --- a/arch/sh/include/asm/suspend.h +++ b/arch/sh/include/asm/suspend.h | |||
@@ -14,9 +14,9 @@ struct swsusp_arch_regs { | |||
14 | void sh_mobile_call_standby(unsigned long mode); | 14 | void sh_mobile_call_standby(unsigned long mode); |
15 | 15 | ||
16 | #ifdef CONFIG_CPU_IDLE | 16 | #ifdef CONFIG_CPU_IDLE |
17 | void sh_mobile_setup_cpuidle(void); | 17 | int sh_mobile_setup_cpuidle(void); |
18 | #else | 18 | #else |
19 | static inline void sh_mobile_setup_cpuidle(void) {} | 19 | static inline int sh_mobile_setup_cpuidle(void) { return 0; } |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | /* notifier chains for pre/post sleep hooks */ | 22 | /* notifier chains for pre/post sleep hooks */ |
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h index 7d5ac4e48485..45a93669289d 100644 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h | |||
@@ -207,8 +207,6 @@ static inline bool test_and_clear_restore_sigmask(void) | |||
207 | return true; | 207 | return true; |
208 | } | 208 | } |
209 | 209 | ||
210 | #define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG) | ||
211 | |||
212 | #endif /* !__ASSEMBLY__ */ | 210 | #endif /* !__ASSEMBLY__ */ |
213 | 211 | ||
214 | #endif /* __KERNEL__ */ | 212 | #endif /* __KERNEL__ */ |
diff --git a/arch/sh/include/asm/unistd.h b/arch/sh/include/asm/unistd.h index 5e90fa2b7eed..e77816c4b9bc 100644 --- a/arch/sh/include/asm/unistd.h +++ b/arch/sh/include/asm/unistd.h | |||
@@ -30,12 +30,4 @@ | |||
30 | # define __ARCH_WANT_SYS_VFORK | 30 | # define __ARCH_WANT_SYS_VFORK |
31 | # define __ARCH_WANT_SYS_CLONE | 31 | # define __ARCH_WANT_SYS_CLONE |
32 | 32 | ||
33 | /* | ||
34 | * "Conditional" syscalls | ||
35 | * | ||
36 | * What we want is __attribute__((weak,alias("sys_ni_syscall"))), | ||
37 | * but it doesn't work on all toolchains, so we just do it by hand | ||
38 | */ | ||
39 | # define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") | ||
40 | |||
41 | #include <uapi/asm/unistd.h> | 33 | #include <uapi/asm/unistd.h> |
diff --git a/arch/sh/kernel/Makefile b/arch/sh/kernel/Makefile index f259b37874e9..261c8bfd75ce 100644 --- a/arch/sh/kernel/Makefile +++ b/arch/sh/kernel/Makefile | |||
@@ -31,7 +31,6 @@ obj-$(CONFIG_VSYSCALL) += vsyscall/ | |||
31 | obj-$(CONFIG_SMP) += smp.o | 31 | obj-$(CONFIG_SMP) += smp.o |
32 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o | 32 | obj-$(CONFIG_SH_STANDARD_BIOS) += sh_bios.o |
33 | obj-$(CONFIG_KGDB) += kgdb.o | 33 | obj-$(CONFIG_KGDB) += kgdb.o |
34 | obj-$(CONFIG_SH_CPU_FREQ) += cpufreq.o | ||
35 | obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o | 34 | obj-$(CONFIG_MODULES) += sh_ksyms_$(BITS).o module.o |
36 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o | 35 | obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o |
37 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o | 36 | obj-$(CONFIG_CRASH_DUMP) += crash_dump.o |
diff --git a/arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c b/arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c index 96c6c2634cb4..eef17dcc3a41 100644 --- a/arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c +++ b/arch/sh/kernel/cpu/sh2a/pinmux-sh7203.c | |||
@@ -8,12 +8,23 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bug.h> | ||
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/ioport.h> | ||
13 | #include <cpu/pfc.h> | 15 | #include <cpu/pfc.h> |
14 | 16 | ||
17 | static struct resource sh7203_pfc_resources[] = { | ||
18 | [0] = { | ||
19 | .start = 0xfffe3800, | ||
20 | .end = 0xfffe3a9f, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, | ||
23 | }; | ||
24 | |||
15 | static int __init plat_pinmux_setup(void) | 25 | static int __init plat_pinmux_setup(void) |
16 | { | 26 | { |
17 | return sh_pfc_register("pfc-sh7203", NULL, 0); | 27 | return sh_pfc_register("pfc-sh7203", sh7203_pfc_resources, |
28 | ARRAY_SIZE(sh7203_pfc_resources)); | ||
18 | } | 29 | } |
19 | arch_initcall(plat_pinmux_setup); | 30 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c b/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c index b1b7c1bae127..569decbd6d93 100644 --- a/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c +++ b/arch/sh/kernel/cpu/sh2a/pinmux-sh7264.c | |||
@@ -8,12 +8,23 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bug.h> | ||
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/ioport.h> | ||
13 | #include <cpu/pfc.h> | 15 | #include <cpu/pfc.h> |
14 | 16 | ||
17 | static struct resource sh7264_pfc_resources[] = { | ||
18 | [0] = { | ||
19 | .start = 0xfffe3800, | ||
20 | .end = 0xfffe393f, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, | ||
23 | }; | ||
24 | |||
15 | static int __init plat_pinmux_setup(void) | 25 | static int __init plat_pinmux_setup(void) |
16 | { | 26 | { |
17 | return sh_pfc_register("pfc-sh7264", NULL, 0); | 27 | return sh_pfc_register("pfc-sh7264", sh7264_pfc_resources, |
28 | ARRAY_SIZE(sh7264_pfc_resources)); | ||
18 | } | 29 | } |
19 | arch_initcall(plat_pinmux_setup); | 30 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c b/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c index dc2a86830456..1825b0bd523d 100644 --- a/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c +++ b/arch/sh/kernel/cpu/sh2a/pinmux-sh7269.c | |||
@@ -13,8 +13,17 @@ | |||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <cpu/pfc.h> | 14 | #include <cpu/pfc.h> |
15 | 15 | ||
16 | static struct resource sh7269_pfc_resources[] = { | ||
17 | [0] = { | ||
18 | .start = 0xfffe3800, | ||
19 | .end = 0xfffe391f, | ||
20 | .flags = IORESOURCE_MEM, | ||
21 | }, | ||
22 | }; | ||
23 | |||
16 | static int __init plat_pinmux_setup(void) | 24 | static int __init plat_pinmux_setup(void) |
17 | { | 25 | { |
18 | return sh_pfc_register("pfc-sh7269", NULL, 0); | 26 | return sh_pfc_register("pfc-sh7269", sh7269_pfc_resources, |
27 | ARRAY_SIZE(sh7269_pfc_resources)); | ||
19 | } | 28 | } |
20 | arch_initcall(plat_pinmux_setup); | 29 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh3/pinmux-sh7720.c b/arch/sh/kernel/cpu/sh3/pinmux-sh7720.c index 7d3744ac7b08..26e90a66ebb7 100644 --- a/arch/sh/kernel/cpu/sh3/pinmux-sh7720.c +++ b/arch/sh/kernel/cpu/sh3/pinmux-sh7720.c | |||
@@ -8,13 +8,23 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bug.h> | ||
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/ioport.h> | ||
13 | #include <cpu/pfc.h> | 15 | #include <cpu/pfc.h> |
14 | 16 | ||
17 | static struct resource sh7720_pfc_resources[] = { | ||
18 | [0] = { | ||
19 | .start = 0xa4050100, | ||
20 | .end = 0xa405016f, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, | ||
23 | }; | ||
24 | |||
15 | static int __init plat_pinmux_setup(void) | 25 | static int __init plat_pinmux_setup(void) |
16 | { | 26 | { |
17 | return sh_pfc_register("pfc-sh7720", NULL, 0); | 27 | return sh_pfc_register("pfc-sh7720", sh7720_pfc_resources, |
28 | ARRAY_SIZE(sh7720_pfc_resources)); | ||
18 | } | 29 | } |
19 | |||
20 | arch_initcall(plat_pinmux_setup); | 30 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c index d9bcc4290997..271bbc864929 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7722.c | |||
@@ -1,10 +1,20 @@ | |||
1 | #include <linux/bug.h> | ||
1 | #include <linux/init.h> | 2 | #include <linux/init.h> |
2 | #include <linux/kernel.h> | 3 | #include <linux/kernel.h> |
4 | #include <linux/ioport.h> | ||
3 | #include <cpu/pfc.h> | 5 | #include <cpu/pfc.h> |
4 | 6 | ||
7 | static struct resource sh7722_pfc_resources[] = { | ||
8 | [0] = { | ||
9 | .start = 0xa4050100, | ||
10 | .end = 0xa405018f, | ||
11 | .flags = IORESOURCE_MEM, | ||
12 | }, | ||
13 | }; | ||
14 | |||
5 | static int __init plat_pinmux_setup(void) | 15 | static int __init plat_pinmux_setup(void) |
6 | { | 16 | { |
7 | return sh_pfc_register("pfc-sh7722", NULL, 0); | 17 | return sh_pfc_register("pfc-sh7722", sh7722_pfc_resources, |
18 | ARRAY_SIZE(sh7722_pfc_resources)); | ||
8 | } | 19 | } |
9 | |||
10 | arch_initcall(plat_pinmux_setup); | 20 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c index bcec7ad7f783..99c637d5bf7a 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7723.c | |||
@@ -8,13 +8,23 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bug.h> | ||
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/ioport.h> | ||
13 | #include <cpu/pfc.h> | 15 | #include <cpu/pfc.h> |
14 | 16 | ||
17 | static struct resource sh7723_pfc_resources[] = { | ||
18 | [0] = { | ||
19 | .start = 0xa4050100, | ||
20 | .end = 0xa405016f, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, | ||
23 | }; | ||
24 | |||
15 | static int __init plat_pinmux_setup(void) | 25 | static int __init plat_pinmux_setup(void) |
16 | { | 26 | { |
17 | return sh_pfc_register("pfc-sh7723", NULL, 0); | 27 | return sh_pfc_register("pfc-sh7723", sh7723_pfc_resources, |
28 | ARRAY_SIZE(sh7723_pfc_resources)); | ||
18 | } | 29 | } |
19 | |||
20 | arch_initcall(plat_pinmux_setup); | 30 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c index 5c3541d6aed8..63be4749e341 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7724.c | |||
@@ -13,12 +13,23 @@ | |||
13 | * for more details. | 13 | * for more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/bug.h> | ||
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/ioport.h> | ||
18 | #include <cpu/pfc.h> | 20 | #include <cpu/pfc.h> |
19 | 21 | ||
22 | static struct resource sh7724_pfc_resources[] = { | ||
23 | [0] = { | ||
24 | .start = 0xa4050100, | ||
25 | .end = 0xa405016f, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | }; | ||
29 | |||
20 | static int __init plat_pinmux_setup(void) | 30 | static int __init plat_pinmux_setup(void) |
21 | { | 31 | { |
22 | return sh_pfc_register("pfc-sh7724", NULL, 0); | 32 | return sh_pfc_register("pfc-sh7724", sh7724_pfc_resources, |
33 | ARRAY_SIZE(sh7724_pfc_resources)); | ||
23 | } | 34 | } |
24 | arch_initcall(plat_pinmux_setup); | 35 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c index cda6bd177b8c..567745d44221 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7757.c | |||
@@ -13,12 +13,23 @@ | |||
13 | * for more details. | 13 | * for more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/bug.h> | ||
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/ioport.h> | ||
18 | #include <cpu/pfc.h> | 20 | #include <cpu/pfc.h> |
19 | 21 | ||
22 | static struct resource sh7757_pfc_resources[] = { | ||
23 | [0] = { | ||
24 | .start = 0xffec0000, | ||
25 | .end = 0xffec008f, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | }; | ||
29 | |||
20 | static int __init plat_pinmux_setup(void) | 30 | static int __init plat_pinmux_setup(void) |
21 | { | 31 | { |
22 | return sh_pfc_register("pfc-sh7757", NULL, 0); | 32 | return sh_pfc_register("pfc-sh7757", sh7757_pfc_resources, |
33 | ARRAY_SIZE(sh7757_pfc_resources)); | ||
23 | } | 34 | } |
24 | arch_initcall(plat_pinmux_setup); | 35 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c index 01055b809f64..e336ab8b5125 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7785.c | |||
@@ -8,13 +8,23 @@ | |||
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/bug.h> | ||
11 | #include <linux/init.h> | 12 | #include <linux/init.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/ioport.h> | ||
13 | #include <cpu/pfc.h> | 15 | #include <cpu/pfc.h> |
14 | 16 | ||
17 | static struct resource sh7785_pfc_resources[] = { | ||
18 | [0] = { | ||
19 | .start = 0xffe70000, | ||
20 | .end = 0xffe7008f, | ||
21 | .flags = IORESOURCE_MEM, | ||
22 | }, | ||
23 | }; | ||
24 | |||
15 | static int __init plat_pinmux_setup(void) | 25 | static int __init plat_pinmux_setup(void) |
16 | { | 26 | { |
17 | return sh_pfc_register("pfc-sh7785", NULL, 0); | 27 | return sh_pfc_register("pfc-sh7785", sh7785_pfc_resources, |
28 | ARRAY_SIZE(sh7785_pfc_resources)); | ||
18 | } | 29 | } |
19 | |||
20 | arch_initcall(plat_pinmux_setup); | 30 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c index 3061778d55da..9a459556a2f7 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-sh7786.c | |||
@@ -13,13 +13,23 @@ | |||
13 | * for more details. | 13 | * for more details. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include <linux/bug.h> | ||
16 | #include <linux/init.h> | 17 | #include <linux/init.h> |
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
19 | #include <linux/ioport.h> | ||
18 | #include <cpu/pfc.h> | 20 | #include <cpu/pfc.h> |
19 | 21 | ||
22 | static struct resource sh7786_pfc_resources[] = { | ||
23 | [0] = { | ||
24 | .start = 0xffcc0000, | ||
25 | .end = 0xffcc008f, | ||
26 | .flags = IORESOURCE_MEM, | ||
27 | }, | ||
28 | }; | ||
29 | |||
20 | static int __init plat_pinmux_setup(void) | 30 | static int __init plat_pinmux_setup(void) |
21 | { | 31 | { |
22 | return sh_pfc_register("pfc-sh7786", NULL, 0); | 32 | return sh_pfc_register("pfc-sh7786", sh7786_pfc_resources, |
33 | ARRAY_SIZE(sh7786_pfc_resources)); | ||
23 | } | 34 | } |
24 | |||
25 | arch_initcall(plat_pinmux_setup); | 35 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/sh4a/pinmux-shx3.c b/arch/sh/kernel/cpu/sh4a/pinmux-shx3.c index ace84acc55ea..444bf25c60fa 100644 --- a/arch/sh/kernel/cpu/sh4a/pinmux-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/pinmux-shx3.c | |||
@@ -7,12 +7,23 @@ | |||
7 | * License. See the file "COPYING" in the main directory of this archive | 7 | * License. See the file "COPYING" in the main directory of this archive |
8 | * for more details. | 8 | * for more details. |
9 | */ | 9 | */ |
10 | #include <linux/bug.h> | ||
10 | #include <linux/init.h> | 11 | #include <linux/init.h> |
11 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/ioport.h> | ||
12 | #include <cpu/pfc.h> | 14 | #include <cpu/pfc.h> |
13 | 15 | ||
14 | static int __init shx3_pinmux_setup(void) | 16 | static struct resource shx3_pfc_resources[] = { |
17 | [0] = { | ||
18 | .start = 0xffc70000, | ||
19 | .end = 0xffc7001f, | ||
20 | .flags = IORESOURCE_MEM, | ||
21 | }, | ||
22 | }; | ||
23 | |||
24 | static int __init plat_pinmux_setup(void) | ||
15 | { | 25 | { |
16 | return sh_pfc_register("pfc-shx3", NULL, 0); | 26 | return sh_pfc_register("pfc-shx3", shx3_pfc_resources, |
27 | ARRAY_SIZE(shx3_pfc_resources)); | ||
17 | } | 28 | } |
18 | arch_initcall(shx3_pinmux_setup); | 29 | arch_initcall(plat_pinmux_setup); |
diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c index 1ddc876d3b26..d30622592116 100644 --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c | |||
@@ -51,70 +51,53 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev, | |||
51 | return k; | 51 | return k; |
52 | } | 52 | } |
53 | 53 | ||
54 | static struct cpuidle_device cpuidle_dev; | ||
55 | static struct cpuidle_driver cpuidle_driver = { | 54 | static struct cpuidle_driver cpuidle_driver = { |
56 | .name = "sh_idle", | 55 | .name = "sh_idle", |
57 | .owner = THIS_MODULE, | 56 | .owner = THIS_MODULE, |
58 | .en_core_tk_irqen = 1, | 57 | .states = { |
58 | { | ||
59 | .exit_latency = 1, | ||
60 | .target_residency = 1 * 2, | ||
61 | .power_usage = 3, | ||
62 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
63 | .enter = cpuidle_sleep_enter, | ||
64 | .name = "C1", | ||
65 | .desc = "SuperH Sleep Mode", | ||
66 | }, | ||
67 | { | ||
68 | .exit_latency = 100, | ||
69 | .target_residency = 1 * 2, | ||
70 | .power_usage = 1, | ||
71 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
72 | .enter = cpuidle_sleep_enter, | ||
73 | .name = "C2", | ||
74 | .desc = "SuperH Sleep Mode [SF]", | ||
75 | .disabled = true, | ||
76 | }, | ||
77 | { | ||
78 | .exit_latency = 2300, | ||
79 | .target_residency = 1 * 2, | ||
80 | .power_usage = 1, | ||
81 | .flags = CPUIDLE_FLAG_TIME_VALID, | ||
82 | .enter = cpuidle_sleep_enter, | ||
83 | .name = "C3", | ||
84 | .desc = "SuperH Mobile Standby Mode [SF]", | ||
85 | .disabled = true, | ||
86 | }, | ||
87 | }, | ||
88 | .safe_state_index = 0, | ||
89 | .state_count = 3, | ||
59 | }; | 90 | }; |
60 | 91 | ||
61 | void sh_mobile_setup_cpuidle(void) | 92 | int __init sh_mobile_setup_cpuidle(void) |
62 | { | 93 | { |
63 | struct cpuidle_device *dev = &cpuidle_dev; | 94 | int ret; |
64 | struct cpuidle_driver *drv = &cpuidle_driver; | ||
65 | struct cpuidle_state *state; | ||
66 | int i; | ||
67 | 95 | ||
96 | if (sh_mobile_sleep_supported & SUSP_SH_SF) | ||
97 | cpuidle_driver.states[1].disabled = false; | ||
68 | 98 | ||
69 | for (i = 0; i < CPUIDLE_STATE_MAX; i++) { | 99 | if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) |
70 | drv->states[i].name[0] = '\0'; | 100 | cpuidle_driver.states[2].disabled = false; |
71 | drv->states[i].desc[0] = '\0'; | ||
72 | } | ||
73 | 101 | ||
74 | i = CPUIDLE_DRIVER_STATE_START; | 102 | return cpuidle_register(&cpuidle_driver); |
75 | |||
76 | state = &drv->states[i++]; | ||
77 | snprintf(state->name, CPUIDLE_NAME_LEN, "C1"); | ||
78 | strncpy(state->desc, "SuperH Sleep Mode", CPUIDLE_DESC_LEN); | ||
79 | state->exit_latency = 1; | ||
80 | state->target_residency = 1 * 2; | ||
81 | state->power_usage = 3; | ||
82 | state->flags = 0; | ||
83 | state->flags |= CPUIDLE_FLAG_TIME_VALID; | ||
84 | state->enter = cpuidle_sleep_enter; | ||
85 | |||
86 | drv->safe_state_index = i-1; | ||
87 | |||
88 | if (sh_mobile_sleep_supported & SUSP_SH_SF) { | ||
89 | state = &drv->states[i++]; | ||
90 | snprintf(state->name, CPUIDLE_NAME_LEN, "C2"); | ||
91 | strncpy(state->desc, "SuperH Sleep Mode [SF]", | ||
92 | CPUIDLE_DESC_LEN); | ||
93 | state->exit_latency = 100; | ||
94 | state->target_residency = 1 * 2; | ||
95 | state->power_usage = 1; | ||
96 | state->flags = 0; | ||
97 | state->flags |= CPUIDLE_FLAG_TIME_VALID; | ||
98 | state->enter = cpuidle_sleep_enter; | ||
99 | } | ||
100 | |||
101 | if (sh_mobile_sleep_supported & SUSP_SH_STANDBY) { | ||
102 | state = &drv->states[i++]; | ||
103 | snprintf(state->name, CPUIDLE_NAME_LEN, "C3"); | ||
104 | strncpy(state->desc, "SuperH Mobile Standby Mode [SF]", | ||
105 | CPUIDLE_DESC_LEN); | ||
106 | state->exit_latency = 2300; | ||
107 | state->target_residency = 1 * 2; | ||
108 | state->power_usage = 1; | ||
109 | state->flags = 0; | ||
110 | state->flags |= CPUIDLE_FLAG_TIME_VALID; | ||
111 | state->enter = cpuidle_sleep_enter; | ||
112 | } | ||
113 | |||
114 | drv->state_count = i; | ||
115 | dev->state_count = i; | ||
116 | |||
117 | cpuidle_register_driver(&cpuidle_driver); | ||
118 | |||
119 | cpuidle_register_device(dev); | ||
120 | } | 103 | } |
diff --git a/arch/sh/kernel/cpu/shmobile/pm.c b/arch/sh/kernel/cpu/shmobile/pm.c index 08d27fac8d08..ac37b7234f85 100644 --- a/arch/sh/kernel/cpu/shmobile/pm.c +++ b/arch/sh/kernel/cpu/shmobile/pm.c | |||
@@ -150,8 +150,7 @@ static const struct platform_suspend_ops sh_pm_ops = { | |||
150 | static int __init sh_pm_init(void) | 150 | static int __init sh_pm_init(void) |
151 | { | 151 | { |
152 | suspend_set_ops(&sh_pm_ops); | 152 | suspend_set_ops(&sh_pm_ops); |
153 | sh_mobile_setup_cpuidle(); | 153 | return sh_mobile_setup_cpuidle(); |
154 | return 0; | ||
155 | } | 154 | } |
156 | 155 | ||
157 | late_initcall(sh_pm_init); | 156 | late_initcall(sh_pm_init); |
diff --git a/arch/sh/kernel/cpufreq.c b/arch/sh/kernel/cpufreq.c deleted file mode 100644 index e68b45b6f3f9..000000000000 --- a/arch/sh/kernel/cpufreq.c +++ /dev/null | |||
@@ -1,201 +0,0 @@ | |||
1 | /* | ||
2 | * arch/sh/kernel/cpufreq.c | ||
3 | * | ||
4 | * cpufreq driver for the SuperH processors. | ||
5 | * | ||
6 | * Copyright (C) 2002 - 2012 Paul Mundt | ||
7 | * Copyright (C) 2002 M. R. Brown | ||
8 | * | ||
9 | * Clock framework bits from arch/avr32/mach-at32ap/cpufreq.c | ||
10 | * | ||
11 | * Copyright (C) 2004-2007 Atmel Corporation | ||
12 | * | ||
13 | * This file is subject to the terms and conditions of the GNU General Public | ||
14 | * License. See the file "COPYING" in the main directory of this archive | ||
15 | * for more details. | ||
16 | */ | ||
17 | #define pr_fmt(fmt) "cpufreq: " fmt | ||
18 | |||
19 | #include <linux/types.h> | ||
20 | #include <linux/cpufreq.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/err.h> | ||
25 | #include <linux/cpumask.h> | ||
26 | #include <linux/cpu.h> | ||
27 | #include <linux/smp.h> | ||
28 | #include <linux/sched.h> /* set_cpus_allowed() */ | ||
29 | #include <linux/clk.h> | ||
30 | #include <linux/percpu.h> | ||
31 | #include <linux/sh_clk.h> | ||
32 | |||
33 | static DEFINE_PER_CPU(struct clk, sh_cpuclk); | ||
34 | |||
35 | static unsigned int sh_cpufreq_get(unsigned int cpu) | ||
36 | { | ||
37 | return (clk_get_rate(&per_cpu(sh_cpuclk, cpu)) + 500) / 1000; | ||
38 | } | ||
39 | |||
40 | /* | ||
41 | * Here we notify other drivers of the proposed change and the final change. | ||
42 | */ | ||
43 | static int sh_cpufreq_target(struct cpufreq_policy *policy, | ||
44 | unsigned int target_freq, | ||
45 | unsigned int relation) | ||
46 | { | ||
47 | unsigned int cpu = policy->cpu; | ||
48 | struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); | ||
49 | cpumask_t cpus_allowed; | ||
50 | struct cpufreq_freqs freqs; | ||
51 | struct device *dev; | ||
52 | long freq; | ||
53 | |||
54 | if (!cpu_online(cpu)) | ||
55 | return -ENODEV; | ||
56 | |||
57 | cpus_allowed = current->cpus_allowed; | ||
58 | set_cpus_allowed_ptr(current, cpumask_of(cpu)); | ||
59 | |||
60 | BUG_ON(smp_processor_id() != cpu); | ||
61 | |||
62 | dev = get_cpu_device(cpu); | ||
63 | |||
64 | /* Convert target_freq from kHz to Hz */ | ||
65 | freq = clk_round_rate(cpuclk, target_freq * 1000); | ||
66 | |||
67 | if (freq < (policy->min * 1000) || freq > (policy->max * 1000)) | ||
68 | return -EINVAL; | ||
69 | |||
70 | dev_dbg(dev, "requested frequency %u Hz\n", target_freq * 1000); | ||
71 | |||
72 | freqs.cpu = cpu; | ||
73 | freqs.old = sh_cpufreq_get(cpu); | ||
74 | freqs.new = (freq + 500) / 1000; | ||
75 | freqs.flags = 0; | ||
76 | |||
77 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | ||
78 | set_cpus_allowed_ptr(current, &cpus_allowed); | ||
79 | clk_set_rate(cpuclk, freq); | ||
80 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | ||
81 | |||
82 | dev_dbg(dev, "set frequency %lu Hz\n", freq); | ||
83 | |||
84 | return 0; | ||
85 | } | ||
86 | |||
87 | static int sh_cpufreq_verify(struct cpufreq_policy *policy) | ||
88 | { | ||
89 | struct clk *cpuclk = &per_cpu(sh_cpuclk, policy->cpu); | ||
90 | struct cpufreq_frequency_table *freq_table; | ||
91 | |||
92 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; | ||
93 | if (freq_table) | ||
94 | return cpufreq_frequency_table_verify(policy, freq_table); | ||
95 | |||
96 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, | ||
97 | policy->cpuinfo.max_freq); | ||
98 | |||
99 | policy->min = (clk_round_rate(cpuclk, 1) + 500) / 1000; | ||
100 | policy->max = (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | ||
101 | |||
102 | cpufreq_verify_within_limits(policy, policy->cpuinfo.min_freq, | ||
103 | policy->cpuinfo.max_freq); | ||
104 | |||
105 | return 0; | ||
106 | } | ||
107 | |||
108 | static int sh_cpufreq_cpu_init(struct cpufreq_policy *policy) | ||
109 | { | ||
110 | unsigned int cpu = policy->cpu; | ||
111 | struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); | ||
112 | struct cpufreq_frequency_table *freq_table; | ||
113 | struct device *dev; | ||
114 | |||
115 | if (!cpu_online(cpu)) | ||
116 | return -ENODEV; | ||
117 | |||
118 | dev = get_cpu_device(cpu); | ||
119 | |||
120 | cpuclk = clk_get(dev, "cpu_clk"); | ||
121 | if (IS_ERR(cpuclk)) { | ||
122 | dev_err(dev, "couldn't get CPU clk\n"); | ||
123 | return PTR_ERR(cpuclk); | ||
124 | } | ||
125 | |||
126 | policy->cur = policy->min = policy->max = sh_cpufreq_get(cpu); | ||
127 | |||
128 | freq_table = cpuclk->nr_freqs ? cpuclk->freq_table : NULL; | ||
129 | if (freq_table) { | ||
130 | int result; | ||
131 | |||
132 | result = cpufreq_frequency_table_cpuinfo(policy, freq_table); | ||
133 | if (!result) | ||
134 | cpufreq_frequency_table_get_attr(freq_table, cpu); | ||
135 | } else { | ||
136 | dev_notice(dev, "no frequency table found, falling back " | ||
137 | "to rate rounding.\n"); | ||
138 | |||
139 | policy->cpuinfo.min_freq = | ||
140 | (clk_round_rate(cpuclk, 1) + 500) / 1000; | ||
141 | policy->cpuinfo.max_freq = | ||
142 | (clk_round_rate(cpuclk, ~0UL) + 500) / 1000; | ||
143 | } | ||
144 | |||
145 | policy->min = policy->cpuinfo.min_freq; | ||
146 | policy->max = policy->cpuinfo.max_freq; | ||
147 | |||
148 | policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; | ||
149 | |||
150 | dev_info(dev, "CPU Frequencies - Minimum %u.%03u MHz, " | ||
151 | "Maximum %u.%03u MHz.\n", | ||
152 | policy->min / 1000, policy->min % 1000, | ||
153 | policy->max / 1000, policy->max % 1000); | ||
154 | |||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | static int sh_cpufreq_cpu_exit(struct cpufreq_policy *policy) | ||
159 | { | ||
160 | unsigned int cpu = policy->cpu; | ||
161 | struct clk *cpuclk = &per_cpu(sh_cpuclk, cpu); | ||
162 | |||
163 | cpufreq_frequency_table_put_attr(cpu); | ||
164 | clk_put(cpuclk); | ||
165 | |||
166 | return 0; | ||
167 | } | ||
168 | |||
169 | static struct freq_attr *sh_freq_attr[] = { | ||
170 | &cpufreq_freq_attr_scaling_available_freqs, | ||
171 | NULL, | ||
172 | }; | ||
173 | |||
174 | static struct cpufreq_driver sh_cpufreq_driver = { | ||
175 | .owner = THIS_MODULE, | ||
176 | .name = "sh", | ||
177 | .get = sh_cpufreq_get, | ||
178 | .target = sh_cpufreq_target, | ||
179 | .verify = sh_cpufreq_verify, | ||
180 | .init = sh_cpufreq_cpu_init, | ||
181 | .exit = sh_cpufreq_cpu_exit, | ||
182 | .attr = sh_freq_attr, | ||
183 | }; | ||
184 | |||
185 | static int __init sh_cpufreq_module_init(void) | ||
186 | { | ||
187 | pr_notice("SuperH CPU frequency driver.\n"); | ||
188 | return cpufreq_register_driver(&sh_cpufreq_driver); | ||
189 | } | ||
190 | |||
191 | static void __exit sh_cpufreq_module_exit(void) | ||
192 | { | ||
193 | cpufreq_unregister_driver(&sh_cpufreq_driver); | ||
194 | } | ||
195 | |||
196 | module_init(sh_cpufreq_module_init); | ||
197 | module_exit(sh_cpufreq_module_exit); | ||
198 | |||
199 | MODULE_AUTHOR("Paul Mundt <lethal@linux-sh.org>"); | ||
200 | MODULE_DESCRIPTION("cpufreq driver for SuperH"); | ||
201 | MODULE_LICENSE("GPL"); | ||
diff --git a/arch/sh/kernel/dumpstack.c b/arch/sh/kernel/dumpstack.c index 7617dc4129ac..b959f5592604 100644 --- a/arch/sh/kernel/dumpstack.c +++ b/arch/sh/kernel/dumpstack.c | |||
@@ -158,9 +158,3 @@ void show_stack(struct task_struct *tsk, unsigned long *sp) | |||
158 | (unsigned long)task_stack_page(tsk)); | 158 | (unsigned long)task_stack_page(tsk)); |
159 | show_trace(tsk, sp, NULL); | 159 | show_trace(tsk, sp, NULL); |
160 | } | 160 | } |
161 | |||
162 | void dump_stack(void) | ||
163 | { | ||
164 | show_stack(NULL, NULL); | ||
165 | } | ||
166 | EXPORT_SYMBOL(dump_stack); | ||
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 3d5a1b387cc0..2ea4483fd722 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c | |||
@@ -24,98 +24,24 @@ | |||
24 | 24 | ||
25 | static void (*sh_idle)(void); | 25 | static void (*sh_idle)(void); |
26 | 26 | ||
27 | static int hlt_counter; | 27 | void default_idle(void) |
28 | |||
29 | static int __init nohlt_setup(char *__unused) | ||
30 | { | ||
31 | hlt_counter = 1; | ||
32 | return 1; | ||
33 | } | ||
34 | __setup("nohlt", nohlt_setup); | ||
35 | |||
36 | static int __init hlt_setup(char *__unused) | ||
37 | { | ||
38 | hlt_counter = 0; | ||
39 | return 1; | ||
40 | } | ||
41 | __setup("hlt", hlt_setup); | ||
42 | |||
43 | static inline int hlt_works(void) | ||
44 | { | ||
45 | return !hlt_counter; | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * On SMP it's slightly faster (but much more power-consuming!) | ||
50 | * to poll the ->work.need_resched flag instead of waiting for the | ||
51 | * cross-CPU IPI to arrive. Use this option with caution. | ||
52 | */ | ||
53 | static void poll_idle(void) | ||
54 | { | 28 | { |
29 | set_bl_bit(); | ||
55 | local_irq_enable(); | 30 | local_irq_enable(); |
56 | while (!need_resched()) | 31 | /* Isn't this racy ? */ |
57 | cpu_relax(); | 32 | cpu_sleep(); |
33 | clear_bl_bit(); | ||
58 | } | 34 | } |
59 | 35 | ||
60 | void default_idle(void) | 36 | void arch_cpu_idle_dead(void) |
61 | { | 37 | { |
62 | if (hlt_works()) { | 38 | play_dead(); |
63 | clear_thread_flag(TIF_POLLING_NRFLAG); | ||
64 | smp_mb__after_clear_bit(); | ||
65 | |||
66 | set_bl_bit(); | ||
67 | if (!need_resched()) { | ||
68 | local_irq_enable(); | ||
69 | cpu_sleep(); | ||
70 | } else | ||
71 | local_irq_enable(); | ||
72 | |||
73 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
74 | clear_bl_bit(); | ||
75 | } else | ||
76 | poll_idle(); | ||
77 | } | 39 | } |
78 | 40 | ||
79 | /* | 41 | void arch_cpu_idle(void) |
80 | * The idle thread. There's no useful work to be done, so just try to conserve | ||
81 | * power and have a low exit latency (ie sit in a loop waiting for somebody to | ||
82 | * say that they'd like to reschedule) | ||
83 | */ | ||
84 | void cpu_idle(void) | ||
85 | { | 42 | { |
86 | unsigned int cpu = smp_processor_id(); | 43 | if (cpuidle_idle_call()) |
87 | 44 | sh_idle(); | |
88 | set_thread_flag(TIF_POLLING_NRFLAG); | ||
89 | |||
90 | /* endless idle loop with no priority at all */ | ||
91 | while (1) { | ||
92 | tick_nohz_idle_enter(); | ||
93 | rcu_idle_enter(); | ||
94 | |||
95 | while (!need_resched()) { | ||
96 | check_pgt_cache(); | ||
97 | rmb(); | ||
98 | |||
99 | if (cpu_is_offline(cpu)) | ||
100 | play_dead(); | ||
101 | |||
102 | local_irq_disable(); | ||
103 | /* Don't trace irqs off for idle */ | ||
104 | stop_critical_timings(); | ||
105 | if (cpuidle_idle_call()) | ||
106 | sh_idle(); | ||
107 | /* | ||
108 | * Sanity check to ensure that sh_idle() returns | ||
109 | * with IRQs enabled | ||
110 | */ | ||
111 | WARN_ON(irqs_disabled()); | ||
112 | start_critical_timings(); | ||
113 | } | ||
114 | |||
115 | rcu_idle_exit(); | ||
116 | tick_nohz_idle_exit(); | ||
117 | schedule_preempt_disabled(); | ||
118 | } | ||
119 | } | 45 | } |
120 | 46 | ||
121 | void __init select_idle_routine(void) | 47 | void __init select_idle_routine(void) |
@@ -123,13 +49,8 @@ void __init select_idle_routine(void) | |||
123 | /* | 49 | /* |
124 | * If a platform has set its own idle routine, leave it alone. | 50 | * If a platform has set its own idle routine, leave it alone. |
125 | */ | 51 | */ |
126 | if (sh_idle) | 52 | if (!sh_idle) |
127 | return; | ||
128 | |||
129 | if (hlt_works()) | ||
130 | sh_idle = default_idle; | 53 | sh_idle = default_idle; |
131 | else | ||
132 | sh_idle = poll_idle; | ||
133 | } | 54 | } |
134 | 55 | ||
135 | void stop_this_cpu(void *unused) | 56 | void stop_this_cpu(void *unused) |
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 73eb66fc6253..ebd3933005b4 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -32,11 +32,7 @@ | |||
32 | void show_regs(struct pt_regs * regs) | 32 | void show_regs(struct pt_regs * regs) |
33 | { | 33 | { |
34 | printk("\n"); | 34 | printk("\n"); |
35 | printk("Pid : %d, Comm: \t\t%s\n", task_pid_nr(current), current->comm); | 35 | show_regs_print_info(KERN_DEFAULT); |
36 | printk("CPU : %d \t\t%s (%s %.*s)\n\n", | ||
37 | smp_processor_id(), print_tainted(), init_utsname()->release, | ||
38 | (int)strcspn(init_utsname()->version, " "), | ||
39 | init_utsname()->version); | ||
40 | 36 | ||
41 | print_symbol("PC is at %s\n", instruction_pointer(regs)); | 37 | print_symbol("PC is at %s\n", instruction_pointer(regs)); |
42 | print_symbol("PR is at %s\n", regs->pr); | 38 | print_symbol("PR is at %s\n", regs->pr); |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index e611c85144b1..174d124b419e 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -40,6 +40,7 @@ void show_regs(struct pt_regs *regs) | |||
40 | unsigned long long ah, al, bh, bl, ch, cl; | 40 | unsigned long long ah, al, bh, bl, ch, cl; |
41 | 41 | ||
42 | printk("\n"); | 42 | printk("\n"); |
43 | show_regs_print_info(KERN_DEFAULT); | ||
43 | 44 | ||
44 | ah = (regs->pc) >> 32; | 45 | ah = (regs->pc) >> 32; |
45 | al = (regs->pc) & 0xffffffff; | 46 | al = (regs->pc) & 0xffffffff; |
diff --git a/arch/sh/kernel/sh_bios.c b/arch/sh/kernel/sh_bios.c index 47475cca068a..fe584e516964 100644 --- a/arch/sh/kernel/sh_bios.c +++ b/arch/sh/kernel/sh_bios.c | |||
@@ -104,6 +104,7 @@ void sh_bios_vbr_reload(void) | |||
104 | ); | 104 | ); |
105 | } | 105 | } |
106 | 106 | ||
107 | #ifdef CONFIG_EARLY_PRINTK | ||
107 | /* | 108 | /* |
108 | * Print a string through the BIOS | 109 | * Print a string through the BIOS |
109 | */ | 110 | */ |
@@ -144,8 +145,6 @@ static struct console bios_console = { | |||
144 | .index = -1, | 145 | .index = -1, |
145 | }; | 146 | }; |
146 | 147 | ||
147 | static struct console *early_console; | ||
148 | |||
149 | static int __init setup_early_printk(char *buf) | 148 | static int __init setup_early_printk(char *buf) |
150 | { | 149 | { |
151 | int keep_early = 0; | 150 | int keep_early = 0; |
@@ -170,3 +169,4 @@ static int __init setup_early_printk(char *buf) | |||
170 | return 0; | 169 | return 0; |
171 | } | 170 | } |
172 | early_param("earlyprintk", setup_early_printk); | 171 | early_param("earlyprintk", setup_early_printk); |
172 | #endif | ||
diff --git a/arch/sh/kernel/smp.c b/arch/sh/kernel/smp.c index 2062aa88af41..45696451f0ea 100644 --- a/arch/sh/kernel/smp.c +++ b/arch/sh/kernel/smp.c | |||
@@ -203,7 +203,7 @@ asmlinkage void __cpuinit start_secondary(void) | |||
203 | set_cpu_online(cpu, true); | 203 | set_cpu_online(cpu, true); |
204 | per_cpu(cpu_state, cpu) = CPU_ONLINE; | 204 | per_cpu(cpu_state, cpu) = CPU_ONLINE; |
205 | 205 | ||
206 | cpu_idle(); | 206 | cpu_startup_entry(CPUHP_ONLINE); |
207 | } | 207 | } |
208 | 208 | ||
209 | extern struct { | 209 | extern struct { |
diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig index 5a43a871e097..dba285e86808 100644 --- a/arch/sh/mm/Kconfig +++ b/arch/sh/mm/Kconfig | |||
@@ -137,13 +137,6 @@ config ARCH_SPARSEMEM_ENABLE | |||
137 | config ARCH_SPARSEMEM_DEFAULT | 137 | config ARCH_SPARSEMEM_DEFAULT |
138 | def_bool y | 138 | def_bool y |
139 | 139 | ||
140 | config MAX_ACTIVE_REGIONS | ||
141 | int | ||
142 | default "6" if (CPU_SUBTYPE_SHX3 && SPARSEMEM) | ||
143 | default "2" if SPARSEMEM && (CPU_SUBTYPE_SH7722 || \ | ||
144 | CPU_SUBTYPE_SH7785) | ||
145 | default "1" | ||
146 | |||
147 | config ARCH_SELECT_MEMORY_MODEL | 140 | config ARCH_SELECT_MEMORY_MODEL |
148 | def_bool y | 141 | def_bool y |
149 | 142 | ||
diff --git a/arch/sh/mm/alignment.c b/arch/sh/mm/alignment.c index aea14855e656..ec2b25302427 100644 --- a/arch/sh/mm/alignment.c +++ b/arch/sh/mm/alignment.c | |||
@@ -140,7 +140,7 @@ static int alignment_proc_open(struct inode *inode, struct file *file) | |||
140 | static ssize_t alignment_proc_write(struct file *file, | 140 | static ssize_t alignment_proc_write(struct file *file, |
141 | const char __user *buffer, size_t count, loff_t *pos) | 141 | const char __user *buffer, size_t count, loff_t *pos) |
142 | { | 142 | { |
143 | int *data = PDE(file_inode(file))->data; | 143 | int *data = PDE_DATA(file_inode(file)); |
144 | char mode; | 144 | char mode; |
145 | 145 | ||
146 | if (count > 0) { | 146 | if (count > 0) { |
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 105794037143..20f9ead650d3 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -417,15 +417,13 @@ void __init mem_init(void) | |||
417 | 417 | ||
418 | for_each_online_node(nid) { | 418 | for_each_online_node(nid) { |
419 | pg_data_t *pgdat = NODE_DATA(nid); | 419 | pg_data_t *pgdat = NODE_DATA(nid); |
420 | unsigned long node_pages = 0; | ||
421 | void *node_high_memory; | 420 | void *node_high_memory; |
422 | 421 | ||
423 | num_physpages += pgdat->node_present_pages; | 422 | num_physpages += pgdat->node_present_pages; |
424 | 423 | ||
425 | if (pgdat->node_spanned_pages) | 424 | if (pgdat->node_spanned_pages) |
426 | node_pages = free_all_bootmem_node(pgdat); | 425 | totalram_pages += free_all_bootmem_node(pgdat); |
427 | 426 | ||
428 | totalram_pages += node_pages; | ||
429 | 427 | ||
430 | node_high_memory = (void *)__va((pgdat->node_start_pfn + | 428 | node_high_memory = (void *)__va((pgdat->node_start_pfn + |
431 | pgdat->node_spanned_pages) << | 429 | pgdat->node_spanned_pages) << |
@@ -501,31 +499,13 @@ void __init mem_init(void) | |||
501 | 499 | ||
502 | void free_initmem(void) | 500 | void free_initmem(void) |
503 | { | 501 | { |
504 | unsigned long addr; | 502 | free_initmem_default(0); |
505 | |||
506 | addr = (unsigned long)(&__init_begin); | ||
507 | for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) { | ||
508 | ClearPageReserved(virt_to_page(addr)); | ||
509 | init_page_count(virt_to_page(addr)); | ||
510 | free_page(addr); | ||
511 | totalram_pages++; | ||
512 | } | ||
513 | printk("Freeing unused kernel memory: %ldk freed\n", | ||
514 | ((unsigned long)&__init_end - | ||
515 | (unsigned long)&__init_begin) >> 10); | ||
516 | } | 503 | } |
517 | 504 | ||
518 | #ifdef CONFIG_BLK_DEV_INITRD | 505 | #ifdef CONFIG_BLK_DEV_INITRD |
519 | void free_initrd_mem(unsigned long start, unsigned long end) | 506 | void free_initrd_mem(unsigned long start, unsigned long end) |
520 | { | 507 | { |
521 | unsigned long p; | 508 | free_reserved_area(start, end, 0, "initrd"); |
522 | for (p = start; p < end; p += PAGE_SIZE) { | ||
523 | ClearPageReserved(virt_to_page(p)); | ||
524 | init_page_count(virt_to_page(p)); | ||
525 | free_page(p); | ||
526 | totalram_pages++; | ||
527 | } | ||
528 | printk("Freeing initrd memory: %ldk freed\n", (end - start) >> 10); | ||
529 | } | 509 | } |
530 | #endif | 510 | #endif |
531 | 511 | ||