aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 14:52:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 14:52:16 -0400
commit626f380d0b264a1e40237f5a2a3dffc5d14f256e (patch)
tree456889d94d219628c225ccef3ad4f2af0475cbf4
parent32708e8e95265505d9627b3bc9ed16566e0dca1c (diff)
parentbb38c222e07cbe252cfbd99cd6a9c834b0a2639a (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: sh: Fix up HAVE_PERF_COUNTERS typo. sh: Fix up more dma-mapping fallout. sh: SH7786 SMP support. sh: Wire up the uncached fixmap on sh64 as well. sh: Use local TLB flush in set_pte_phys(). sh: Provide cpu_idle_wait() to fix up cpuidle/SMP build.
-rw-r--r--arch/sh/Kconfig12
-rw-r--r--arch/sh/include/asm/dma-mapping.h12
-rw-r--r--arch/sh/include/asm/system.h1
-rw-r--r--arch/sh/kernel/cpu/sh4a/Makefile6
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c29
-rw-r--r--arch/sh/kernel/idle.c23
-rw-r--r--arch/sh/mm/init.c4
7 files changed, 52 insertions, 35 deletions
diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig
index ac1c620d1c7d..e2bdd7b94fd9 100644
--- a/arch/sh/Kconfig
+++ b/arch/sh/Kconfig
@@ -15,7 +15,7 @@ config SUPERH
15 select HAVE_IOREMAP_PROT if MMU 15 select HAVE_IOREMAP_PROT if MMU
16 select HAVE_ARCH_TRACEHOOK 16 select HAVE_ARCH_TRACEHOOK
17 select HAVE_DMA_API_DEBUG 17 select HAVE_DMA_API_DEBUG
18 select HAVE_PERF_COUNTER 18 select HAVE_PERF_COUNTERS
19 select RTC_LIB 19 select RTC_LIB
20 select GENERIC_ATOMIC64 20 select GENERIC_ATOMIC64
21 help 21 help
@@ -71,6 +71,9 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
71config GENERIC_IRQ_PROBE 71config GENERIC_IRQ_PROBE
72 def_bool y 72 def_bool y
73 73
74config IRQ_PER_CPU
75 def_bool y
76
74config GENERIC_GPIO 77config GENERIC_GPIO
75 def_bool n 78 def_bool n
76 79
@@ -151,6 +154,9 @@ config ARCH_NO_VIRT_TO_BUS
151config ARCH_HAS_DEFAULT_IDLE 154config ARCH_HAS_DEFAULT_IDLE
152 def_bool y 155 def_bool y
153 156
157config ARCH_HAS_CPU_IDLE_WAIT
158 def_bool y
159
154config IO_TRAPPED 160config IO_TRAPPED
155 bool 161 bool
156 162
@@ -411,6 +417,8 @@ config CPU_SUBTYPE_SH7786
411 select CPU_HAS_PTEAEX 417 select CPU_HAS_PTEAEX
412 select ARCH_SPARSEMEM_ENABLE 418 select ARCH_SPARSEMEM_ENABLE
413 select SYS_SUPPORTS_NUMA 419 select SYS_SUPPORTS_NUMA
420 select SYS_SUPPORTS_SMP
421 select GENERIC_CLOCKEVENTS_BROADCAST if SMP
414 422
415config CPU_SUBTYPE_SHX3 423config CPU_SUBTYPE_SHX3
416 bool "Support SH-X3 processor" 424 bool "Support SH-X3 processor"
@@ -648,7 +656,7 @@ config NR_CPUS
648 int "Maximum number of CPUs (2-32)" 656 int "Maximum number of CPUs (2-32)"
649 range 2 32 657 range 2 32
650 depends on SMP 658 depends on SMP
651 default "4" if CPU_SHX3 659 default "4" if CPU_SUBTYPE_SHX3
652 default "2" 660 default "2"
653 help 661 help
654 This allows you to specify the maximum number of CPUs which this 662 This allows you to specify the maximum number of CPUs which this
diff --git a/arch/sh/include/asm/dma-mapping.h b/arch/sh/include/asm/dma-mapping.h
index ea9d4f41c9d2..69d56dd4c968 100644
--- a/arch/sh/include/asm/dma-mapping.h
+++ b/arch/sh/include/asm/dma-mapping.h
@@ -97,7 +97,7 @@ static inline void dma_unmap_page(struct device *dev, dma_addr_t dma_address,
97 dma_unmap_single(dev, dma_address, size, dir); 97 dma_unmap_single(dev, dma_address, size, dir);
98} 98}
99 99
100static inline void dma_sync_single(struct device *dev, dma_addr_t dma_handle, 100static inline void __dma_sync_single(struct device *dev, dma_addr_t dma_handle,
101 size_t size, enum dma_data_direction dir) 101 size_t size, enum dma_data_direction dir)
102{ 102{
103#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT) 103#if defined(CONFIG_PCI) && !defined(CONFIG_SH_PCIDMA_NONCOHERENT)
@@ -119,7 +119,7 @@ static inline void dma_sync_single_range(struct device *dev,
119 dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir); 119 dma_cache_sync(dev, phys_to_virt(dma_handle) + offset, size, dir);
120} 120}
121 121
122static inline void dma_sync_sg(struct device *dev, struct scatterlist *sg, 122static inline void __dma_sync_sg(struct device *dev, struct scatterlist *sg,
123 int nelems, enum dma_data_direction dir) 123 int nelems, enum dma_data_direction dir)
124{ 124{
125 int i; 125 int i;
@@ -137,7 +137,7 @@ static inline void dma_sync_single_for_cpu(struct device *dev,
137 dma_addr_t dma_handle, size_t size, 137 dma_addr_t dma_handle, size_t size,
138 enum dma_data_direction dir) 138 enum dma_data_direction dir)
139{ 139{
140 dma_sync_single(dev, dma_handle, size, dir); 140 __dma_sync_single(dev, dma_handle, size, dir);
141 debug_dma_sync_single_for_cpu(dev, dma_handle, size, dir); 141 debug_dma_sync_single_for_cpu(dev, dma_handle, size, dir);
142} 142}
143 143
@@ -146,7 +146,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
146 size_t size, 146 size_t size,
147 enum dma_data_direction dir) 147 enum dma_data_direction dir)
148{ 148{
149 dma_sync_single(dev, dma_handle, size, dir); 149 __dma_sync_single(dev, dma_handle, size, dir);
150 debug_dma_sync_single_for_device(dev, dma_handle, size, dir); 150 debug_dma_sync_single_for_device(dev, dma_handle, size, dir);
151} 151}
152 152
@@ -177,7 +177,7 @@ static inline void dma_sync_sg_for_cpu(struct device *dev,
177 struct scatterlist *sg, int nelems, 177 struct scatterlist *sg, int nelems,
178 enum dma_data_direction dir) 178 enum dma_data_direction dir)
179{ 179{
180 dma_sync_sg(dev, sg, nelems, dir); 180 __dma_sync_sg(dev, sg, nelems, dir);
181 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); 181 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir);
182} 182}
183 183
@@ -185,7 +185,7 @@ static inline void dma_sync_sg_for_device(struct device *dev,
185 struct scatterlist *sg, int nelems, 185 struct scatterlist *sg, int nelems,
186 enum dma_data_direction dir) 186 enum dma_data_direction dir)
187{ 187{
188 dma_sync_sg(dev, sg, nelems, dir); 188 __dma_sync_sg(dev, sg, nelems, dir);
189 debug_dma_sync_sg_for_device(dev, sg, nelems, dir); 189 debug_dma_sync_sg_for_device(dev, sg, nelems, dir);
190} 190}
191 191
diff --git a/arch/sh/include/asm/system.h b/arch/sh/include/asm/system.h
index a88895e6dcb0..ab79e1f4fbe0 100644
--- a/arch/sh/include/asm/system.h
+++ b/arch/sh/include/asm/system.h
@@ -154,6 +154,7 @@ extern struct dentry *sh_debugfs_root;
154 154
155void per_cpu_trap_init(void); 155void per_cpu_trap_init(void);
156void default_idle(void); 156void default_idle(void);
157void cpu_idle_wait(void);
157 158
158asmlinkage void break_point_trap(void); 159asmlinkage void break_point_trap(void);
159 160
diff --git a/arch/sh/kernel/cpu/sh4a/Makefile b/arch/sh/kernel/cpu/sh4a/Makefile
index 96ea09ca8cc1..ebdd391d5f42 100644
--- a/arch/sh/kernel/cpu/sh4a/Makefile
+++ b/arch/sh/kernel/cpu/sh4a/Makefile
@@ -16,7 +16,7 @@ obj-$(CONFIG_CPU_SUBTYPE_SH7366) += setup-sh7366.o
16obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o 16obj-$(CONFIG_CPU_SUBTYPE_SHX3) += setup-shx3.o
17 17
18# SMP setup 18# SMP setup
19smp-$(CONFIG_CPU_SUBTYPE_SHX3) := smp-shx3.o 19smp-$(CONFIG_CPU_SHX3) := smp-shx3.o
20 20
21# Primary on-chip clocks (common) 21# Primary on-chip clocks (common)
22clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o 22clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o
@@ -38,6 +38,6 @@ pinmux-$(CONFIG_CPU_SUBTYPE_SH7724) := pinmux-sh7724.o
38pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o 38pinmux-$(CONFIG_CPU_SUBTYPE_SH7785) := pinmux-sh7785.o
39pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o 39pinmux-$(CONFIG_CPU_SUBTYPE_SH7786) := pinmux-sh7786.o
40 40
41obj-y += $(clock-y) 41obj-y += $(clock-y)
42obj-$(CONFIG_SMP) += $(smp-y) 42obj-$(CONFIG_SMP) += $(smp-y)
43obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y) 43obj-$(CONFIG_GENERIC_GPIO) += $(pinmux-y)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 93e0d2c017e8..b70049470a0b 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -595,9 +595,8 @@ enum {
595 HSPI, 595 HSPI,
596 GPIO0, GPIO1, 596 GPIO0, GPIO1,
597 Thermal, 597 Thermal,
598 INTC0, INTC1, INTC2, INTC3, INTC4, INTC5, INTC6, INTC7, 598 INTICI0, INTICI1, INTICI2, INTICI3,
599 599 INTICI4, INTICI5, INTICI6, INTICI7,
600 /* interrupt groups */
601}; 600};
602 601
603static struct intc_vect vectors[] __initdata = { 602static struct intc_vect vectors[] __initdata = {
@@ -638,10 +637,12 @@ static struct intc_vect vectors[] __initdata = {
638 INTC_VECT(HSPI, 0xe80), 637 INTC_VECT(HSPI, 0xe80),
639 INTC_VECT(GPIO0, 0xea0), INTC_VECT(GPIO1, 0xec0), 638 INTC_VECT(GPIO0, 0xea0), INTC_VECT(GPIO1, 0xec0),
640 INTC_VECT(Thermal, 0xee0), 639 INTC_VECT(Thermal, 0xee0),
640 INTC_VECT(INTICI0, 0xf00), INTC_VECT(INTICI1, 0xf20),
641 INTC_VECT(INTICI2, 0xf40), INTC_VECT(INTICI3, 0xf60),
642 INTC_VECT(INTICI4, 0xf80), INTC_VECT(INTICI5, 0xfa0),
643 INTC_VECT(INTICI6, 0xfc0), INTC_VECT(INTICI7, 0xfe0),
641}; 644};
642 645
643/* FIXME: Main CPU support only now */
644#if 1 /* Main CPU */
645#define CnINTMSK0 0xfe410030 646#define CnINTMSK0 0xfe410030
646#define CnINTMSK1 0xfe410040 647#define CnINTMSK1 0xfe410040
647#define CnINTMSKCLR0 0xfe410050 648#define CnINTMSKCLR0 0xfe410050
@@ -654,21 +655,6 @@ static struct intc_vect vectors[] __initdata = {
654#define CnINT2MSKCR1 0xfe410a34 655#define CnINT2MSKCR1 0xfe410a34
655#define CnINT2MSKCR2 0xfe410a38 656#define CnINT2MSKCR2 0xfe410a38
656#define CnINT2MSKCR3 0xfe410a3c 657#define CnINT2MSKCR3 0xfe410a3c
657#else /* Sub CPU */
658#define CnINTMSK0 0xfe410034
659#define CnINTMSK1 0xfe410044
660#define CnINTMSKCLR0 0xfe410054
661#define CnINTMSKCLR1 0xfe410064
662#define CnINT2MSKR0 0xfe410b20
663#define CnINT2MSKR1 0xfe410b24
664#define CnINT2MSKR2 0xfe410b28
665#define CnINT2MSKR3 0xfe410b2c
666#define CnINT2MSKCR0 0xfe410b30
667#define CnINT2MSKCR1 0xfe410b34
668#define CnINT2MSKCR2 0xfe410b38
669#define CnINT2MSKCR3 0xfe410b3c
670#endif
671
672#define INTMSK2 0xfe410068 658#define INTMSK2 0xfe410068
673#define INTMSKCLR2 0xfe41006c 659#define INTMSKCLR2 0xfe41006c
674 660
@@ -753,6 +739,9 @@ static struct intc_prio_reg prio_registers[] __initdata = {
753 GPIO1, Thermal } }, 739 GPIO1, Thermal } },
754 { 0xfe41085c, 0, 32, 8, /* INT2PRI23 */ { 0, 0, 0, 0 } }, 740 { 0xfe41085c, 0, 32, 8, /* INT2PRI23 */ { 0, 0, 0, 0 } },
755 { 0xfe410860, 0, 32, 8, /* INT2PRI24 */ { 0, 0, 0, 0 } }, 741 { 0xfe410860, 0, 32, 8, /* INT2PRI24 */ { 0, 0, 0, 0 } },
742 { 0xfe410090, 0xfe4100a0, 32, 4, /* CnICIPRI / CnICIPRICLR */
743 { INTICI7, INTICI6, INTICI5, INTICI4,
744 INTICI3, INTICI2, INTICI1, INTICI0 }, INTC_SMP(4, 2) },
756}; 745};
757 746
758static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL, 747static DECLARE_INTC_DESC(intc_desc, "sh7786", vectors, NULL,
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c
index f35ed0348850..27ff2dc093c7 100644
--- a/arch/sh/kernel/idle.c
+++ b/arch/sh/kernel/idle.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * The idle loop for all SuperH platforms. 2 * The idle loop for all SuperH platforms.
3 * 3 *
4 * Copyright (C) 2002 - 2008 Paul Mundt 4 * Copyright (C) 2002 - 2009 Paul Mundt
5 * 5 *
6 * This file is subject to the terms and conditions of the GNU General Public 6 * This file is subject to the terms and conditions of the GNU General Public
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
@@ -15,6 +15,7 @@
15#include <linux/preempt.h> 15#include <linux/preempt.h>
16#include <linux/thread_info.h> 16#include <linux/thread_info.h>
17#include <linux/irqflags.h> 17#include <linux/irqflags.h>
18#include <linux/smp.h>
18#include <asm/pgalloc.h> 19#include <asm/pgalloc.h>
19#include <asm/system.h> 20#include <asm/system.h>
20#include <asm/atomic.h> 21#include <asm/atomic.h>
@@ -79,3 +80,23 @@ void cpu_idle(void)
79 check_pgt_cache(); 80 check_pgt_cache();
80 } 81 }
81} 82}
83
84static void do_nothing(void *unused)
85{
86}
87
88/*
89 * cpu_idle_wait - Used to ensure that all the CPUs discard old value of
90 * pm_idle and update to new pm_idle value. Required while changing pm_idle
91 * handler on SMP systems.
92 *
93 * Caller must have changed pm_idle to the new value before the call. Old
94 * pm_idle value will not be used by any CPU after the return of this function.
95 */
96void cpu_idle_wait(void)
97{
98 smp_mb();
99 /* kick all the CPUs so that they exit out of pm_idle */
100 smp_call_function(do_nothing, NULL, 1);
101}
102EXPORT_SYMBOL_GPL(cpu_idle_wait);
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index ee8e6bbe882c..fe532aeaa16d 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -70,7 +70,7 @@ static void set_pte_phys(unsigned long addr, unsigned long phys, pgprot_t prot)
70 } 70 }
71 71
72 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot)); 72 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, prot));
73 flush_tlb_one(get_asid(), addr); 73 local_flush_tlb_one(get_asid(), addr);
74} 74}
75 75
76/* 76/*
@@ -177,10 +177,8 @@ void __init paging_init(void)
177 177
178 free_area_init_nodes(max_zone_pfns); 178 free_area_init_nodes(max_zone_pfns);
179 179
180#ifdef CONFIG_SUPERH32
181 /* Set up the uncached fixmap */ 180 /* Set up the uncached fixmap */
182 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start)); 181 set_fixmap_nocache(FIX_UNCACHED, __pa(&__uncached_start));
183#endif
184} 182}
185 183
186static struct kcore_list kcore_mem, kcore_vmalloc; 184static struct kcore_list kcore_mem, kcore_vmalloc;