diff options
author | Bruce Losure <blosure@sgi.com> | 2005-04-25 22:41:00 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2005-05-03 15:01:07 -0400 |
commit | ce0a3956b32650e229b68964c4400bbdc5ad3ca1 (patch) | |
tree | 79ea53b8321964c903f1379c48ba5c4917992c46 /arch/ia64 | |
parent | ae40aae9b9b8e336714ebb3f16410da6e69d6ac8 (diff) |
[IA64-SGI] Altix patch to add bricktype knowledge to tiocx
Here is a patch to enable the SGI tiocx bus driver to distingush between
FPGA-attached h/w and non-FPGA-attached h/w.
Signed-off-by: Bruce Losure <blosure@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/sn/kernel/tiocx.c | 41 |
1 files changed, 32 insertions, 9 deletions
diff --git a/arch/ia64/sn/kernel/tiocx.c b/arch/ia64/sn/kernel/tiocx.c index 128ccf23973a..ab9b5f35c2a7 100644 --- a/arch/ia64/sn/kernel/tiocx.c +++ b/arch/ia64/sn/kernel/tiocx.c | |||
@@ -21,6 +21,8 @@ | |||
21 | #include <asm/sn/types.h> | 21 | #include <asm/sn/types.h> |
22 | #include <asm/sn/shubio.h> | 22 | #include <asm/sn/shubio.h> |
23 | #include <asm/sn/tiocx.h> | 23 | #include <asm/sn/tiocx.h> |
24 | #include <asm/sn/l1.h> | ||
25 | #include <asm/sn/module.h> | ||
24 | #include "tio.h" | 26 | #include "tio.h" |
25 | #include "xtalk/xwidgetdev.h" | 27 | #include "xtalk/xwidgetdev.h" |
26 | #include "xtalk/hubdev.h" | 28 | #include "xtalk/hubdev.h" |
@@ -308,14 +310,12 @@ void tiocx_irq_free(struct sn_irq_info *sn_irq_info) | |||
308 | } | 310 | } |
309 | } | 311 | } |
310 | 312 | ||
311 | uint64_t | 313 | uint64_t tiocx_dma_addr(uint64_t addr) |
312 | tiocx_dma_addr(uint64_t addr) | ||
313 | { | 314 | { |
314 | return PHYS_TO_TIODMA(addr); | 315 | return PHYS_TO_TIODMA(addr); |
315 | } | 316 | } |
316 | 317 | ||
317 | uint64_t | 318 | uint64_t tiocx_swin_base(int nasid) |
318 | tiocx_swin_base(int nasid) | ||
319 | { | 319 | { |
320 | return TIO_SWIN_BASE(nasid, TIOCX_CORELET); | 320 | return TIO_SWIN_BASE(nasid, TIOCX_CORELET); |
321 | } | 321 | } |
@@ -366,7 +366,29 @@ static void tio_corelet_reset(nasid_t nasid, int corelet) | |||
366 | udelay(2000); | 366 | udelay(2000); |
367 | } | 367 | } |
368 | 368 | ||
369 | static int fpga_attached(nasid_t nasid) | 369 | static int tiocx_btchar_get(int nasid) |
370 | { | ||
371 | moduleid_t module_id; | ||
372 | geoid_t geoid; | ||
373 | int cnodeid; | ||
374 | |||
375 | cnodeid = nasid_to_cnodeid(nasid); | ||
376 | geoid = cnodeid_get_geoid(cnodeid); | ||
377 | module_id = geo_module(geoid); | ||
378 | return MODULE_GET_BTCHAR(module_id); | ||
379 | } | ||
380 | |||
381 | static int is_fpga_brick(int nasid) | ||
382 | { | ||
383 | switch (tiocx_btchar_get(nasid)) { | ||
384 | case L1_BRICKTYPE_SA: | ||
385 | case L1_BRICKTYPE_ATHENA: | ||
386 | return 1; | ||
387 | } | ||
388 | return 0; | ||
389 | } | ||
390 | |||
391 | static int bitstream_loaded(nasid_t nasid) | ||
370 | { | 392 | { |
371 | uint64_t cx_credits; | 393 | uint64_t cx_credits; |
372 | 394 | ||
@@ -383,7 +405,7 @@ static int tiocx_reload(struct cx_dev *cx_dev) | |||
383 | int mfg_num = CX_DEV_NONE; | 405 | int mfg_num = CX_DEV_NONE; |
384 | nasid_t nasid = cx_dev->cx_id.nasid; | 406 | nasid_t nasid = cx_dev->cx_id.nasid; |
385 | 407 | ||
386 | if (fpga_attached(nasid)) { | 408 | if (bitstream_loaded(nasid)) { |
387 | uint64_t cx_id; | 409 | uint64_t cx_id; |
388 | 410 | ||
389 | cx_id = | 411 | cx_id = |
@@ -414,9 +436,10 @@ static ssize_t show_cxdev_control(struct device *dev, char *buf) | |||
414 | { | 436 | { |
415 | struct cx_dev *cx_dev = to_cx_dev(dev); | 437 | struct cx_dev *cx_dev = to_cx_dev(dev); |
416 | 438 | ||
417 | return sprintf(buf, "0x%x 0x%x 0x%x\n", | 439 | return sprintf(buf, "0x%x 0x%x 0x%x %d\n", |
418 | cx_dev->cx_id.nasid, | 440 | cx_dev->cx_id.nasid, |
419 | cx_dev->cx_id.part_num, cx_dev->cx_id.mfg_num); | 441 | cx_dev->cx_id.part_num, cx_dev->cx_id.mfg_num, |
442 | tiocx_btchar_get(cx_dev->cx_id.nasid)); | ||
420 | } | 443 | } |
421 | 444 | ||
422 | static ssize_t store_cxdev_control(struct device *dev, const char *buf, | 445 | static ssize_t store_cxdev_control(struct device *dev, const char *buf, |
@@ -462,7 +485,7 @@ static int __init tiocx_init(void) | |||
462 | if ((nasid = cnodeid_to_nasid(cnodeid)) < 0) | 485 | if ((nasid = cnodeid_to_nasid(cnodeid)) < 0) |
463 | break; /* No more nasids .. bail out of loop */ | 486 | break; /* No more nasids .. bail out of loop */ |
464 | 487 | ||
465 | if (nasid & 0x1) { /* TIO's are always odd */ | 488 | if ((nasid & 0x1) && is_fpga_brick(nasid)) { |
466 | struct hubdev_info *hubdev; | 489 | struct hubdev_info *hubdev; |
467 | struct xwidget_info *widgetp; | 490 | struct xwidget_info *widgetp; |
468 | 491 | ||