aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/io_init.c2
-rw-r--r--arch/ia64/sn/kernel/irq.c2
-rw-r--r--arch/ia64/sn/kernel/setup.c32
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_proc_fs.c2
-rw-r--r--arch/ia64/sn/kernel/tiocx.c64
-rw-r--r--arch/ia64/sn/kernel/xpc_main.c4
-rw-r--r--arch/ia64/sn/kernel/xpnet.c6
-rw-r--r--arch/ia64/sn/pci/tioca_provider.c8
8 files changed, 70 insertions, 50 deletions
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index 4564ed0b5ff3..906622d9f933 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -431,7 +431,7 @@ void sn_bus_store_sysdata(struct pci_dev *dev)
431{ 431{
432 struct sysdata_el *element; 432 struct sysdata_el *element;
433 433
434 element = kcalloc(1, sizeof(struct sysdata_el), GFP_KERNEL); 434 element = kzalloc(sizeof(struct sysdata_el), GFP_KERNEL);
435 if (!element) { 435 if (!element) {
436 dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__); 436 dev_dbg(dev, "%s: out of memory!\n", __FUNCTION__);
437 return; 437 return;
diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
index 9fc74631ba8a..01d18b7b5bb3 100644
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -23,7 +23,7 @@ static void force_interrupt(int irq);
23static void register_intr_pda(struct sn_irq_info *sn_irq_info); 23static void register_intr_pda(struct sn_irq_info *sn_irq_info);
24static void unregister_intr_pda(struct sn_irq_info *sn_irq_info); 24static void unregister_intr_pda(struct sn_irq_info *sn_irq_info);
25 25
26extern int sn_force_interrupt_flag; 26int sn_force_interrupt_flag = 1;
27extern int sn_ioif_inited; 27extern int sn_ioif_inited;
28static struct list_head **sn_irq_lh; 28static struct list_head **sn_irq_lh;
29static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */ 29static spinlock_t sn_irq_info_lock = SPIN_LOCK_UNLOCKED; /* non-IRQ lock */
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index a594aca959e6..6f8c5883716b 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -49,6 +49,7 @@
49#include <asm/sn/clksupport.h> 49#include <asm/sn/clksupport.h>
50#include <asm/sn/sn_sal.h> 50#include <asm/sn/sn_sal.h>
51#include <asm/sn/geo.h> 51#include <asm/sn/geo.h>
52#include <asm/sn/sn_feature_sets.h>
52#include "xtalk/xwidgetdev.h" 53#include "xtalk/xwidgetdev.h"
53#include "xtalk/hubdev.h" 54#include "xtalk/hubdev.h"
54#include <asm/sn/klconfig.h> 55#include <asm/sn/klconfig.h>
@@ -56,7 +57,7 @@
56 57
57DEFINE_PER_CPU(struct pda_s, pda_percpu); 58DEFINE_PER_CPU(struct pda_s, pda_percpu);
58 59
59#define MAX_PHYS_MEMORY (1UL << 49) /* 1 TB */ 60#define MAX_PHYS_MEMORY (1UL << IA64_MAX_PHYS_BITS) /* Max physical address supported */
60 61
61lboard_t *root_lboard[MAX_COMPACT_NODES]; 62lboard_t *root_lboard[MAX_COMPACT_NODES];
62 63
@@ -97,6 +98,7 @@ EXPORT_SYMBOL(sn_region_size);
97int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */ 98int sn_prom_type; /* 0=hardware, 1=medusa/realprom, 2=medusa/fakeprom */
98 99
99short physical_node_map[MAX_PHYSNODE_ID]; 100short physical_node_map[MAX_PHYSNODE_ID];
101static unsigned long sn_prom_features[MAX_PROM_FEATURE_SETS];
100 102
101EXPORT_SYMBOL(physical_node_map); 103EXPORT_SYMBOL(physical_node_map);
102 104
@@ -271,7 +273,10 @@ void __init sn_setup(char **cmdline_p)
271 u32 version = sn_sal_rev(); 273 u32 version = sn_sal_rev();
272 extern void sn_cpu_init(void); 274 extern void sn_cpu_init(void);
273 275
274 ia64_sn_plat_set_error_handling_features(); 276 ia64_sn_plat_set_error_handling_features(); // obsolete
277 ia64_sn_set_os_feature(OSF_MCA_SLV_TO_OS_INIT_SLV);
278 ia64_sn_set_os_feature(OSF_FEAT_LOG_SBES);
279
275 280
276#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE) 281#if defined(CONFIG_VT) && defined(CONFIG_VGA_CONSOLE)
277 /* 282 /*
@@ -314,16 +319,6 @@ void __init sn_setup(char **cmdline_p)
314 319
315 printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); 320 printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF);
316 321
317 /*
318 * Confirm the SAL we're running on is recent enough...
319 */
320 if (version < SN_SAL_MIN_VERSION) {
321 printk(KERN_ERR "This kernel needs SGI SAL version >= "
322 "%x.%02x\n", SN_SAL_MIN_VERSION >> 8,
323 SN_SAL_MIN_VERSION & 0x00FF);
324 panic("PROM version too old\n");
325 }
326
327 master_nasid = boot_get_nasid(); 322 master_nasid = boot_get_nasid();
328 323
329 status = 324 status =
@@ -480,6 +475,10 @@ void __init sn_cpu_init(void)
480 if (nodepdaindr[0] == NULL) 475 if (nodepdaindr[0] == NULL)
481 return; 476 return;
482 477
478 for (i = 0; i < MAX_PROM_FEATURE_SETS; i++)
479 if (ia64_sn_get_prom_feature_set(i, &sn_prom_features[i]) != 0)
480 break;
481
483 cpuid = smp_processor_id(); 482 cpuid = smp_processor_id();
484 cpuphyid = get_sapicid(); 483 cpuphyid = get_sapicid();
485 484
@@ -651,3 +650,12 @@ nasid_slice_to_cpuid(int nasid, int slice)
651 650
652 return -1; 651 return -1;
653} 652}
653
654int sn_prom_feature_available(int id)
655{
656 if (id >= BITS_PER_LONG * MAX_PROM_FEATURE_SETS)
657 return 0;
658 return test_bit(id, sn_prom_features);
659}
660EXPORT_SYMBOL(sn_prom_feature_available);
661
diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
index 51bf82720d99..a06719d752a0 100644
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
@@ -52,7 +52,7 @@ static int licenseID_open(struct inode *inode, struct file *file)
52 * the bridge chip. The hardware will then send an interrupt message if the 52 * the bridge chip. The hardware will then send an interrupt message if the
53 * interrupt line is active. This mimics a level sensitive interrupt. 53 * interrupt line is active. This mimics a level sensitive interrupt.
54 */ 54 */
55int sn_force_interrupt_flag = 1; 55extern int sn_force_interrupt_flag;
56 56
57static int sn_force_interrupt_show(struct seq_file *s, void *p) 57static int sn_force_interrupt_show(struct seq_file *s, void *p)
58{ 58{
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c
index 254fe15c064b..e0819ec53116 100644
--- a/arch/ia64/sn/kernel/tiocx.c
+++ b/arch/ia64/sn/kernel/tiocx.c
@@ -183,15 +183,16 @@ int cx_driver_unregister(struct cx_drv *cx_driver)
183 * @part_num: device's part number 183 * @part_num: device's part number
184 * @mfg_num: device's manufacturer number 184 * @mfg_num: device's manufacturer number
185 * @hubdev: hub info associated with this device 185 * @hubdev: hub info associated with this device
186 * @bt: board type of the device
186 * 187 *
187 */ 188 */
188int 189int
189cx_device_register(nasid_t nasid, int part_num, int mfg_num, 190cx_device_register(nasid_t nasid, int part_num, int mfg_num,
190 struct hubdev_info *hubdev) 191 struct hubdev_info *hubdev, int bt)
191{ 192{
192 struct cx_dev *cx_dev; 193 struct cx_dev *cx_dev;
193 194
194 cx_dev = kcalloc(1, sizeof(struct cx_dev), GFP_KERNEL); 195 cx_dev = kzalloc(sizeof(struct cx_dev), GFP_KERNEL);
195 DBG("cx_dev= 0x%p\n", cx_dev); 196 DBG("cx_dev= 0x%p\n", cx_dev);
196 if (cx_dev == NULL) 197 if (cx_dev == NULL)
197 return -ENOMEM; 198 return -ENOMEM;
@@ -200,6 +201,7 @@ cx_device_register(nasid_t nasid, int part_num, int mfg_num,
200 cx_dev->cx_id.mfg_num = mfg_num; 201 cx_dev->cx_id.mfg_num = mfg_num;
201 cx_dev->cx_id.nasid = nasid; 202 cx_dev->cx_id.nasid = nasid;
202 cx_dev->hubdev = hubdev; 203 cx_dev->hubdev = hubdev;
204 cx_dev->bt = bt;
203 205
204 cx_dev->dev.parent = NULL; 206 cx_dev->dev.parent = NULL;
205 cx_dev->dev.bus = &tiocx_bus_type; 207 cx_dev->dev.bus = &tiocx_bus_type;
@@ -238,7 +240,8 @@ static int cx_device_reload(struct cx_dev *cx_dev)
238{ 240{
239 cx_device_unregister(cx_dev); 241 cx_device_unregister(cx_dev);
240 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num, 242 return cx_device_register(cx_dev->cx_id.nasid, cx_dev->cx_id.part_num,
241 cx_dev->cx_id.mfg_num, cx_dev->hubdev); 243 cx_dev->cx_id.mfg_num, cx_dev->hubdev,
244 cx_dev->bt);
242} 245}
243 246
244static inline uint64_t tiocx_intr_alloc(nasid_t nasid, int widget, 247static inline uint64_t tiocx_intr_alloc(nasid_t nasid, int widget,
@@ -365,26 +368,20 @@ static void tio_corelet_reset(nasid_t nasid, int corelet)
365 udelay(2000); 368 udelay(2000);
366} 369}
367 370
368static int tiocx_btchar_get(int nasid) 371static int is_fpga_tio(int nasid, int *bt)
369{ 372{
370 moduleid_t module_id; 373 int ioboard_type;
371 geoid_t geoid;
372 int cnodeid;
373
374 cnodeid = nasid_to_cnodeid(nasid);
375 geoid = cnodeid_get_geoid(cnodeid);
376 module_id = geo_module(geoid);
377 return MODULE_GET_BTCHAR(module_id);
378}
379 374
380static int is_fpga_brick(int nasid) 375 ioboard_type = ia64_sn_sysctl_ioboard_get(nasid);
381{ 376
382 switch (tiocx_btchar_get(nasid)) { 377 switch (ioboard_type) {
383 case L1_BRICKTYPE_SA: 378 case L1_BRICKTYPE_SA:
384 case L1_BRICKTYPE_ATHENA: 379 case L1_BRICKTYPE_ATHENA:
385 case L1_BRICKTYPE_DAYTONA: 380 case L1_BOARDTYPE_DAYTONA:
381 *bt = ioboard_type;
386 return 1; 382 return 1;
387 } 383 }
384
388 return 0; 385 return 0;
389} 386}
390 387
@@ -407,16 +404,22 @@ static int tiocx_reload(struct cx_dev *cx_dev)
407 404
408 if (bitstream_loaded(nasid)) { 405 if (bitstream_loaded(nasid)) {
409 uint64_t cx_id; 406 uint64_t cx_id;
410 407 int rv;
411 cx_id = 408
412 *(volatile uint64_t *)(TIO_SWIN_BASE(nasid, TIOCX_CORELET) + 409 rv = ia64_sn_sysctl_tio_clock_reset(nasid);
410 if (rv) {
411 printk(KERN_ALERT "CX port JTAG reset failed.\n");
412 } else {
413 cx_id = *(volatile uint64_t *)
414 (TIO_SWIN_BASE(nasid, TIOCX_CORELET) +
413 WIDGET_ID); 415 WIDGET_ID);
414 part_num = XWIDGET_PART_NUM(cx_id); 416 part_num = XWIDGET_PART_NUM(cx_id);
415 mfg_num = XWIDGET_MFG_NUM(cx_id); 417 mfg_num = XWIDGET_MFG_NUM(cx_id);
416 DBG("part= 0x%x, mfg= 0x%x\n", part_num, mfg_num); 418 DBG("part= 0x%x, mfg= 0x%x\n", part_num, mfg_num);
417 /* just ignore it if it's a CE */ 419 /* just ignore it if it's a CE */
418 if (part_num == TIO_CE_ASIC_PARTNUM) 420 if (part_num == TIO_CE_ASIC_PARTNUM)
419 return 0; 421 return 0;
422 }
420 } 423 }
421 424
422 cx_dev->cx_id.part_num = part_num; 425 cx_dev->cx_id.part_num = part_num;
@@ -436,10 +439,10 @@ static ssize_t show_cxdev_control(struct device *dev, struct device_attribute *a
436{ 439{
437 struct cx_dev *cx_dev = to_cx_dev(dev); 440 struct cx_dev *cx_dev = to_cx_dev(dev);
438 441
439 return sprintf(buf, "0x%x 0x%x 0x%x %d\n", 442 return sprintf(buf, "0x%x 0x%x 0x%x 0x%x\n",
440 cx_dev->cx_id.nasid, 443 cx_dev->cx_id.nasid,
441 cx_dev->cx_id.part_num, cx_dev->cx_id.mfg_num, 444 cx_dev->cx_id.part_num, cx_dev->cx_id.mfg_num,
442 tiocx_btchar_get(cx_dev->cx_id.nasid)); 445 cx_dev->bt);
443} 446}
444 447
445static ssize_t store_cxdev_control(struct device *dev, struct device_attribute *attr, const char *buf, 448static ssize_t store_cxdev_control(struct device *dev, struct device_attribute *attr, const char *buf,
@@ -488,11 +491,12 @@ static int __init tiocx_init(void)
488 491
489 for (cnodeid = 0; cnodeid < MAX_COMPACT_NODES; cnodeid++) { 492 for (cnodeid = 0; cnodeid < MAX_COMPACT_NODES; cnodeid++) {
490 nasid_t nasid; 493 nasid_t nasid;
494 int bt;
491 495
492 if ((nasid = cnodeid_to_nasid(cnodeid)) < 0) 496 if ((nasid = cnodeid_to_nasid(cnodeid)) < 0)
493 break; /* No more nasids .. bail out of loop */ 497 break; /* No more nasids .. bail out of loop */
494 498
495 if ((nasid & 0x1) && is_fpga_brick(nasid)) { 499 if ((nasid & 0x1) && is_fpga_tio(nasid, &bt)) {
496 struct hubdev_info *hubdev; 500 struct hubdev_info *hubdev;
497 struct xwidget_info *widgetp; 501 struct xwidget_info *widgetp;
498 502
@@ -512,7 +516,7 @@ static int __init tiocx_init(void)
512 516
513 if (cx_device_register 517 if (cx_device_register
514 (nasid, widgetp->xwi_hwid.part_num, 518 (nasid, widgetp->xwi_hwid.part_num,
515 widgetp->xwi_hwid.mfg_num, hubdev) < 0) 519 widgetp->xwi_hwid.mfg_num, hubdev, bt) < 0)
516 return -ENXIO; 520 return -ENXIO;
517 else 521 else
518 found_tiocx_device++; 522 found_tiocx_device++;
diff --git a/arch/ia64/sn/kernel/xpc_main.c b/arch/ia64/sn/kernel/xpc_main.c
index bb1d5cf30440..ed7c21586e98 100644
--- a/arch/ia64/sn/kernel/xpc_main.c
+++ b/arch/ia64/sn/kernel/xpc_main.c
@@ -885,6 +885,10 @@ xpc_init(void)
885 pid_t pid; 885 pid_t pid;
886 886
887 887
888 if (!ia64_platform_is("sn2")) {
889 return -ENODEV;
890 }
891
888 /* 892 /*
889 * xpc_remote_copy_buffer is used as a temporary buffer for bte_copy'ng 893 * xpc_remote_copy_buffer is used as a temporary buffer for bte_copy'ng
890 * both a partition's reserved page and its XPC variables. Its size was 894 * both a partition's reserved page and its XPC variables. Its size was
diff --git a/arch/ia64/sn/kernel/xpnet.c b/arch/ia64/sn/kernel/xpnet.c
index 78c13d676fa6..e5c6d3c0a8e9 100644
--- a/arch/ia64/sn/kernel/xpnet.c
+++ b/arch/ia64/sn/kernel/xpnet.c
@@ -130,7 +130,7 @@ struct net_device *xpnet_device;
130 */ 130 */
131static u64 xpnet_broadcast_partitions; 131static u64 xpnet_broadcast_partitions;
132/* protect above */ 132/* protect above */
133static spinlock_t xpnet_broadcast_lock = SPIN_LOCK_UNLOCKED; 133static DEFINE_SPINLOCK(xpnet_broadcast_lock);
134 134
135/* 135/*
136 * Since the Block Transfer Engine (BTE) is being used for the transfer 136 * Since the Block Transfer Engine (BTE) is being used for the transfer
@@ -636,6 +636,10 @@ xpnet_init(void)
636 int result = -ENOMEM; 636 int result = -ENOMEM;
637 637
638 638
639 if (!ia64_platform_is("sn2")) {
640 return -ENODEV;
641 }
642
639 dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME); 643 dev_info(xpnet, "registering network device %s\n", XPNET_DEVICE_NAME);
640 644
641 /* 645 /*
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c
index 9b8dbce2b7b6..46b646a6d345 100644
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -149,7 +149,7 @@ tioca_gart_init(struct tioca_kernel *tioca_kern)
149 tioca_kern->ca_pcigart_entries = 149 tioca_kern->ca_pcigart_entries =
150 tioca_kern->ca_pciap_size / tioca_kern->ca_ap_pagesize; 150 tioca_kern->ca_pciap_size / tioca_kern->ca_ap_pagesize;
151 tioca_kern->ca_pcigart_pagemap = 151 tioca_kern->ca_pcigart_pagemap =
152 kcalloc(1, tioca_kern->ca_pcigart_entries / 8, GFP_KERNEL); 152 kzalloc(tioca_kern->ca_pcigart_entries / 8, GFP_KERNEL);
153 if (!tioca_kern->ca_pcigart_pagemap) { 153 if (!tioca_kern->ca_pcigart_pagemap) {
154 free_pages((unsigned long)tioca_kern->ca_gart, 154 free_pages((unsigned long)tioca_kern->ca_gart,
155 get_order(tioca_kern->ca_gart_size)); 155 get_order(tioca_kern->ca_gart_size));
@@ -392,7 +392,7 @@ tioca_dma_mapped(struct pci_dev *pdev, uint64_t paddr, size_t req_size)
392 * allocate a map struct 392 * allocate a map struct
393 */ 393 */
394 394
395 ca_dmamap = kcalloc(1, sizeof(struct tioca_dmamap), GFP_ATOMIC); 395 ca_dmamap = kzalloc(sizeof(struct tioca_dmamap), GFP_ATOMIC);
396 if (!ca_dmamap) 396 if (!ca_dmamap)
397 goto map_return; 397 goto map_return;
398 398
@@ -600,7 +600,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
600 * Allocate kernel bus soft and copy from prom. 600 * Allocate kernel bus soft and copy from prom.
601 */ 601 */
602 602
603 tioca_common = kcalloc(1, sizeof(struct tioca_common), GFP_KERNEL); 603 tioca_common = kzalloc(sizeof(struct tioca_common), GFP_KERNEL);
604 if (!tioca_common) 604 if (!tioca_common)
605 return NULL; 605 return NULL;
606 606
@@ -609,7 +609,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont
609 609
610 /* init kernel-private area */ 610 /* init kernel-private area */
611 611
612 tioca_kern = kcalloc(1, sizeof(struct tioca_kernel), GFP_KERNEL); 612 tioca_kern = kzalloc(sizeof(struct tioca_kernel), GFP_KERNEL);
613 if (!tioca_kern) { 613 if (!tioca_kern) {
614 kfree(tioca_common); 614 kfree(tioca_common);
615 return NULL; 615 return NULL;