aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-09-08 18:39:30 -0400
committerDavid S. Miller <davem@davemloft.net>2008-09-08 18:39:30 -0400
commit98d86c091534f35c4bab294451ae6bccab8e9075 (patch)
tree98c9f0b80bb078405cf173f1d5cc91c72e77082d /arch/sparc64
parentd875a4b0ffad754e6d89fa561ea7dcdd79c9508b (diff)
parent4d084617fb0d025c42c242362d1f27d337e2d407 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Conflicts: arch/sparc/kernel/of_device.c
Diffstat (limited to 'arch/sparc64')
-rw-r--r--arch/sparc64/Kconfig1
-rw-r--r--arch/sparc64/kernel/of_device.c20
-rw-r--r--arch/sparc64/kernel/smp.c14
-rw-r--r--arch/sparc64/mm/init.c2
4 files changed, 22 insertions, 15 deletions
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index 4a90809b40fb..5446e2a499b1 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -254,6 +254,7 @@ endmenu
254 254
255config NUMA 255config NUMA
256 bool "NUMA support" 256 bool "NUMA support"
257 depends on SMP
257 258
258config NODES_SHIFT 259config NODES_SHIFT
259 int 260 int
diff --git a/arch/sparc64/kernel/of_device.c b/arch/sparc64/kernel/of_device.c
index c15bcdf75c0d..5c4fbc23aeea 100644
--- a/arch/sparc64/kernel/of_device.c
+++ b/arch/sparc64/kernel/of_device.c
@@ -119,7 +119,7 @@ struct of_bus {
119 int *addrc, int *sizec); 119 int *addrc, int *sizec);
120 int (*map)(u32 *addr, const u32 *range, 120 int (*map)(u32 *addr, const u32 *range,
121 int na, int ns, int pna); 121 int na, int ns, int pna);
122 unsigned int (*get_flags)(const u32 *addr); 122 unsigned long (*get_flags)(const u32 *addr, unsigned long);
123}; 123};
124 124
125/* 125/*
@@ -179,8 +179,10 @@ static int of_bus_default_map(u32 *addr, const u32 *range,
179 return 0; 179 return 0;
180} 180}
181 181
182static unsigned int of_bus_default_get_flags(const u32 *addr) 182static unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags)
183{ 183{
184 if (flags)
185 return flags;
184 return IORESOURCE_MEM; 186 return IORESOURCE_MEM;
185} 187}
186 188
@@ -272,17 +274,21 @@ static int of_bus_pci_map(u32 *addr, const u32 *range,
272 return 0; 274 return 0;
273} 275}
274 276
275static unsigned int of_bus_pci_get_flags(const u32 *addr) 277static unsigned long of_bus_pci_get_flags(const u32 *addr, unsigned long flags)
276{ 278{
277 unsigned int flags = 0;
278 u32 w = addr[0]; 279 u32 w = addr[0];
279 280
281 /* For PCI, we override whatever child busses may have used. */
282 flags = 0;
280 switch((w >> 24) & 0x03) { 283 switch((w >> 24) & 0x03) {
281 case 0x01: 284 case 0x01:
282 flags |= IORESOURCE_IO; 285 flags |= IORESOURCE_IO;
286 break;
287
283 case 0x02: /* 32 bits */ 288 case 0x02: /* 32 bits */
284 case 0x03: /* 64 bits */ 289 case 0x03: /* 64 bits */
285 flags |= IORESOURCE_MEM; 290 flags |= IORESOURCE_MEM;
291 break;
286 } 292 }
287 if (w & 0x40000000) 293 if (w & 0x40000000)
288 flags |= IORESOURCE_PREFETCH; 294 flags |= IORESOURCE_PREFETCH;
@@ -510,10 +516,10 @@ static void __init build_device_resources(struct of_device *op,
510 int pna, pns; 516 int pna, pns;
511 517
512 size = of_read_addr(reg + na, ns); 518 size = of_read_addr(reg + na, ns);
513 flags = bus->get_flags(reg);
514
515 memcpy(addr, reg, na * 4); 519 memcpy(addr, reg, na * 4);
516 520
521 flags = bus->get_flags(addr, 0);
522
517 if (use_1to1_mapping(pp)) { 523 if (use_1to1_mapping(pp)) {
518 result = of_read_addr(addr, na); 524 result = of_read_addr(addr, na);
519 goto build_res; 525 goto build_res;
@@ -538,6 +544,8 @@ static void __init build_device_resources(struct of_device *op,
538 dna, dns, pna)) 544 dna, dns, pna))
539 break; 545 break;
540 546
547 flags = pbus->get_flags(addr, flags);
548
541 dna = pna; 549 dna = pna;
542 dns = pns; 550 dns = pns;
543 dbus = pbus; 551 dbus = pbus;
diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c
index 743ccad61c60..2be166c544ca 100644
--- a/arch/sparc64/kernel/smp.c
+++ b/arch/sparc64/kernel/smp.c
@@ -80,8 +80,6 @@ void smp_bogo(struct seq_file *m)
80 i, cpu_data(i).clock_tick); 80 i, cpu_data(i).clock_tick);
81} 81}
82 82
83static __cacheline_aligned_in_smp DEFINE_SPINLOCK(call_lock);
84
85extern void setup_sparc64_timer(void); 83extern void setup_sparc64_timer(void);
86 84
87static volatile unsigned long callin_flag = 0; 85static volatile unsigned long callin_flag = 0;
@@ -120,9 +118,9 @@ void __cpuinit smp_callin(void)
120 while (!cpu_isset(cpuid, smp_commenced_mask)) 118 while (!cpu_isset(cpuid, smp_commenced_mask))
121 rmb(); 119 rmb();
122 120
123 spin_lock(&call_lock); 121 ipi_call_lock();
124 cpu_set(cpuid, cpu_online_map); 122 cpu_set(cpuid, cpu_online_map);
125 spin_unlock(&call_lock); 123 ipi_call_unlock();
126 124
127 /* idle thread is expected to have preempt disabled */ 125 /* idle thread is expected to have preempt disabled */
128 preempt_disable(); 126 preempt_disable();
@@ -1305,10 +1303,6 @@ int __cpu_disable(void)
1305 c->core_id = 0; 1303 c->core_id = 0;
1306 c->proc_id = -1; 1304 c->proc_id = -1;
1307 1305
1308 spin_lock(&call_lock);
1309 cpu_clear(cpu, cpu_online_map);
1310 spin_unlock(&call_lock);
1311
1312 smp_wmb(); 1306 smp_wmb();
1313 1307
1314 /* Make sure no interrupts point to this cpu. */ 1308 /* Make sure no interrupts point to this cpu. */
@@ -1318,6 +1312,10 @@ int __cpu_disable(void)
1318 mdelay(1); 1312 mdelay(1);
1319 local_irq_disable(); 1313 local_irq_disable();
1320 1314
1315 ipi_call_lock();
1316 cpu_clear(cpu, cpu_online_map);
1317 ipi_call_unlock();
1318
1321 return 0; 1319 return 0;
1322} 1320}
1323 1321
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c
index 7c3c81f60a6e..4fb9de00fc8a 100644
--- a/arch/sparc64/mm/init.c
+++ b/arch/sparc64/mm/init.c
@@ -1875,7 +1875,7 @@ static int pavail_rescan_ents __initdata;
1875 * memory list again, and make sure it provides at least as much 1875 * memory list again, and make sure it provides at least as much
1876 * memory as 'pavail' does. 1876 * memory as 'pavail' does.
1877 */ 1877 */
1878static void setup_valid_addr_bitmap_from_pavail(void) 1878static void __init setup_valid_addr_bitmap_from_pavail(void)
1879{ 1879{
1880 int i; 1880 int i;
1881 1881