diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-07-27 14:31:10 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-07-31 16:35:24 -0400 |
commit | 07cc0c9e65d3e262f871ea357dd77b41950b1ca5 (patch) | |
tree | fa797fa236da6e03c7b778cdc364ac1c3e03b52f /arch/mips/kernel/rtlx.c | |
parent | c3a005f4b6a7752608e75d016ef8d07c55285e48 (diff) |
[MIPS] MT: Enable coexistence of AP/SP with VSMP and SMTC.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/rtlx.c')
-rw-r--r-- | arch/mips/kernel/rtlx.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 8cf24d716d41..5c040060560e 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -40,12 +40,11 @@ | |||
40 | #include <asm/atomic.h> | 40 | #include <asm/atomic.h> |
41 | #include <asm/cpu.h> | 41 | #include <asm/cpu.h> |
42 | #include <asm/processor.h> | 42 | #include <asm/processor.h> |
43 | #include <asm/mips_mt.h> | ||
43 | #include <asm/system.h> | 44 | #include <asm/system.h> |
44 | #include <asm/vpe.h> | 45 | #include <asm/vpe.h> |
45 | #include <asm/rtlx.h> | 46 | #include <asm/rtlx.h> |
46 | 47 | ||
47 | #define RTLX_TARG_VPE 1 | ||
48 | |||
49 | static struct rtlx_info *rtlx; | 48 | static struct rtlx_info *rtlx; |
50 | static int major; | 49 | static int major; |
51 | static char module_name[] = "rtlx"; | 50 | static char module_name[] = "rtlx"; |
@@ -165,10 +164,10 @@ int rtlx_open(int index, int can_sleep) | |||
165 | } | 164 | } |
166 | 165 | ||
167 | if (rtlx == NULL) { | 166 | if (rtlx == NULL) { |
168 | if( (p = vpe_get_shared(RTLX_TARG_VPE)) == NULL) { | 167 | if( (p = vpe_get_shared(tclimit)) == NULL) { |
169 | if (can_sleep) { | 168 | if (can_sleep) { |
170 | __wait_event_interruptible(channel_wqs[index].lx_queue, | 169 | __wait_event_interruptible(channel_wqs[index].lx_queue, |
171 | (p = vpe_get_shared(RTLX_TARG_VPE)), | 170 | (p = vpe_get_shared(tclimit)), |
172 | ret); | 171 | ret); |
173 | if (ret) | 172 | if (ret) |
174 | goto out_fail; | 173 | goto out_fail; |
@@ -477,6 +476,19 @@ static int rtlx_module_init(void) | |||
477 | struct device *dev; | 476 | struct device *dev; |
478 | int i, err; | 477 | int i, err; |
479 | 478 | ||
479 | if (!cpu_has_mipsmt) { | ||
480 | printk("VPE loader: not a MIPS MT capable processor\n"); | ||
481 | return -ENODEV; | ||
482 | } | ||
483 | |||
484 | if (tclimit == 0) { | ||
485 | printk(KERN_WARNING "No TCs reserved for AP/SP, not " | ||
486 | "initializing RTLX.\nPass maxtcs=<n> argument as kernel " | ||
487 | "argument\n"); | ||
488 | |||
489 | return -ENODEV; | ||
490 | } | ||
491 | |||
480 | major = register_chrdev(0, module_name, &rtlx_fops); | 492 | major = register_chrdev(0, module_name, &rtlx_fops); |
481 | if (major < 0) { | 493 | if (major < 0) { |
482 | printk(register_chrdev_failed); | 494 | printk(register_chrdev_failed); |
@@ -501,7 +513,7 @@ static int rtlx_module_init(void) | |||
501 | /* set up notifiers */ | 513 | /* set up notifiers */ |
502 | notify.start = starting; | 514 | notify.start = starting; |
503 | notify.stop = stopping; | 515 | notify.stop = stopping; |
504 | vpe_notify(RTLX_TARG_VPE, ¬ify); | 516 | vpe_notify(tclimit, ¬ify); |
505 | 517 | ||
506 | if (cpu_has_vint) | 518 | if (cpu_has_vint) |
507 | set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch); | 519 | set_vi_handler(MIPS_CPU_RTLX_IRQ, rtlx_dispatch); |