32 #include <linux/kernel.h>
34 #include <linux/types.h>
35 #include <linux/pci.h>
37 #include <linux/slab.h>
41 #include <linux/time.h>
50 unsigned long bellbits, bellbits_shifted;
51 int our_interrupt = 0;
68 if (handle & 0x40000000)
112 spin_unlock_irqrestore(&dev->
sync_fib->event_lock, sflags);
122 spin_unlock_irqrestore(&dev->
sync_lock, sflags);
143 static void aac_src_disable_interrupt(
struct aac_dev *dev)
153 static void aac_src_enable_interrupt_message(
struct aac_dev *dev)
275 static void aac_src_interrupt_adapter(
struct aac_dev *dev)
332 static void aac_src_start_adapter(
struct aac_dev *dev)
354 static int aac_src_check_health(
struct aac_dev *dev)
368 return (status >> 16) & 0xFF;
386 static int aac_src_deliver_message(
struct fib *
fib)
390 unsigned long qflags;
398 spin_unlock_irqrestore(q->
lock, qflags);
402 fibsize = (hdr_size + 127) / 128 - 1;
434 src_writel(dev, MUnit.IQ_H, (address >> 32) & 0xffffffff);
435 src_writel(dev, MUnit.IQ_L, address & 0xffffffff);
466 dev->
base)->u.tupelo.IndexRegs;
475 static int aac_srcv_ioremap(
struct aac_dev *dev,
u32 size)
486 dev->
base)->u.denali.IndexRegs;
490 static int aac_src_restart_adapter(
struct aac_dev *dev,
int bled)
497 dev->
name, dev->
id, bled);
499 0, 0, 0, 0, 0, 0, &var, &reset_mask,
NULL,
NULL,
NULL);
500 if (bled || (var != 0x00000001))
527 dev->
a_ops.adapter_enable_int = aac_src_enable_interrupt_message;
528 dev->
a_ops.adapter_intr = aac_src_intr_message;
529 dev->
a_ops.adapter_deliver = aac_src_deliver_message;
548 int instance = dev->
id;
551 dev->
a_ops.adapter_ioremap = aac_src_ioremap;
561 dev->
a_ops.adapter_sync_cmd = src_sync_cmd;
562 dev->
a_ops.adapter_enable_int = aac_src_disable_interrupt;
564 !aac_src_restart_adapter(dev, 0))
570 if (status & KERNEL_PANIC) {
571 if (aac_src_restart_adapter(dev, aac_src_check_health(dev)))
579 if (status & SELF_TEST_FAILED) {
581 dev->
name, instance);
589 dev->
name, instance);
599 (status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) ||
601 printk(
KERN_ERR "%s%d: adapter kernel failed to start, init status = %lx.\n",
602 dev->
name, instance, status);
606 ((status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC)) ||
608 ((startup_timeout > 60)
609 ? (startup_timeout - 60)
610 : (startup_timeout / 2))))) {
611 if (
likely(!aac_src_restart_adapter(dev,
612 aac_src_check_health(dev))))
623 dev->
a_ops.adapter_interrupt = aac_src_interrupt_adapter;
624 dev->
a_ops.adapter_disable_int = aac_src_disable_interrupt;
625 dev->
a_ops.adapter_notify = aac_src_notify_adapter;
626 dev->
a_ops.adapter_sync_cmd = src_sync_cmd;
627 dev->
a_ops.adapter_check_health = aac_src_check_health;
628 dev->
a_ops.adapter_restart = aac_src_restart_adapter;
667 aac_src_start_adapter(dev);
687 int instance = dev->
id;
690 dev->
a_ops.adapter_ioremap = aac_srcv_ioremap;
700 dev->
a_ops.adapter_sync_cmd = src_sync_cmd;
701 dev->
a_ops.adapter_enable_int = aac_src_disable_interrupt;
703 !aac_src_restart_adapter(dev, 0))
709 if (status & KERNEL_PANIC) {
710 if (aac_src_restart_adapter(dev, aac_src_check_health(dev)))
718 if (status & SELF_TEST_FAILED) {
735 (status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) ||
737 printk(
KERN_ERR "%s%d: adapter kernel failed to start, init status = %lx.\n",
738 dev->
name, instance, status);
742 ((status & (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC)) ||
744 ((startup_timeout > 60)
745 ? (startup_timeout - 60)
746 : (startup_timeout / 2))))) {
747 if (
likely(!aac_src_restart_adapter(dev, aac_src_check_health(dev))))
758 dev->
a_ops.adapter_interrupt = aac_src_interrupt_adapter;
759 dev->
a_ops.adapter_disable_int = aac_src_disable_interrupt;
760 dev->
a_ops.adapter_notify = aac_src_notify_adapter;
761 dev->
a_ops.adapter_sync_cmd = src_sync_cmd;
762 dev->
a_ops.adapter_check_health = aac_src_check_health;
763 dev->
a_ops.adapter_restart = aac_src_restart_adapter;
798 aac_src_start_adapter(dev);