Lines Matching +full:aac +full:- +full:mode

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Adaptec AAC series RAID controller driver
9 * Copyright (c) 2000-2010 Adaptec, Inc.
10 * 2010-2015 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
11 * 2016-2017 Microsemi Corp. (aacraid@microsemi.com)
46 if (likely(intstat & ~(dev->OIMR))) { in aac_rx_intr_producer()
49 aac_printf(dev, readl (&dev->IndexRegs->Mailbox[5])); in aac_rx_intr_producer()
55 aac_command_normal(&dev->queues->queue[HostNormCmdQueue]); in aac_rx_intr_producer()
59 aac_response_normal(&dev->queues->queue[HostNormRespQueue]); in aac_rx_intr_producer()
113 * aac_rx_disable_interrupt - Disable interrupts
119 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xff); in aac_rx_disable_interrupt()
123 * aac_rx_enable_interrupt_producer - Enable interrupts
129 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xfb); in aac_rx_enable_interrupt_producer()
133 * aac_rx_enable_interrupt_message - Enable interrupts
139 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xf7); in aac_rx_enable_interrupt_message()
143 * rx_sync_cmd - send a command and wait
171 writel(command, &dev->IndexRegs->Mailbox[0]); in rx_sync_cmd()
173 * Write the parameters into Mailboxes 1 - 6 in rx_sync_cmd()
175 writel(p1, &dev->IndexRegs->Mailbox[1]); in rx_sync_cmd()
176 writel(p2, &dev->IndexRegs->Mailbox[2]); in rx_sync_cmd()
177 writel(p3, &dev->IndexRegs->Mailbox[3]); in rx_sync_cmd()
178 writel(p4, &dev->IndexRegs->Mailbox[4]); in rx_sync_cmd()
186 rx_writeb(dev, MUnit.OIMR, dev->OIMR = 0xff); in rx_sync_cmd()
227 return -ETIMEDOUT; in rx_sync_cmd()
233 *status = readl(&dev->IndexRegs->Mailbox[0]); in rx_sync_cmd()
235 *r1 = readl(&dev->IndexRegs->Mailbox[1]); in rx_sync_cmd()
237 *r2 = readl(&dev->IndexRegs->Mailbox[2]); in rx_sync_cmd()
239 *r3 = readl(&dev->IndexRegs->Mailbox[3]); in rx_sync_cmd()
241 *r4 = readl(&dev->IndexRegs->Mailbox[4]); in rx_sync_cmd()
255 * aac_rx_interrupt_adapter - interrupt adapter
267 * aac_rx_notify_adapter - send an event to the adapter
306 * aac_rx_start_adapter - activate adapter
309 * Start up processing on an i960 based AAC adapter
316 init = dev->init; in aac_rx_start_adapter()
317 init->r7.host_elapsed_seconds = cpu_to_le32(ktime_get_real_seconds()); in aac_rx_start_adapter()
319 rx_sync_cmd(dev, INIT_STRUCT_BASE_ADDRESS, (u32)(ulong)dev->init_pa, in aac_rx_start_adapter()
338 return -1; in aac_rx_check_health()
353 buffer = dma_alloc_coherent(&dev->pdev->dev, 512, &baddr, in aac_rx_check_health()
355 ret = -2; in aac_rx_check_health()
358 post = dma_alloc_coherent(&dev->pdev->dev, in aac_rx_check_health()
362 dma_free_coherent(&dev->pdev->dev, 512, buffer, baddr); in aac_rx_check_health()
366 post->Post_Command = cpu_to_le32(COMMAND_POST_RESULTS); in aac_rx_check_health()
367 post->Post_Address = cpu_to_le32(baddr); in aac_rx_check_health()
371 dma_free_coherent(&dev->pdev->dev, sizeof(struct POSTSTATUS), in aac_rx_check_health()
377 dma_free_coherent(&dev->pdev->dev, 512, buffer, baddr); in aac_rx_check_health()
384 return -3; in aac_rx_check_health()
399 struct aac_dev *dev = fib->dev; in aac_rx_deliver_producer()
400 struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; in aac_rx_deliver_producer()
404 aac_queue_get( dev, &Index, AdapNormCmdQueue, fib->hw_fib_va, 1, fib, &nointr); in aac_rx_deliver_producer()
406 atomic_inc(&q->numpending); in aac_rx_deliver_producer()
407 *(q->headers.producer) = cpu_to_le32(Index + 1); in aac_rx_deliver_producer()
422 struct aac_dev *dev = fib->dev; in aac_rx_deliver_message()
423 struct aac_queue *q = &dev->queues->queue[AdapNormCmdQueue]; in aac_rx_deliver_message()
429 atomic_inc(&q->numpending); in aac_rx_deliver_message()
436 if (--count == 0) { in aac_rx_deliver_message()
437 atomic_dec(&q->numpending); in aac_rx_deliver_message()
438 return -ETIMEDOUT; in aac_rx_deliver_message()
442 device = dev->base + Index; in aac_rx_deliver_message()
443 addr = fib->hw_fib_pa; in aac_rx_deliver_message()
448 writel(le16_to_cpu(fib->hw_fib_va->header.Size), device); in aac_rx_deliver_message()
462 iounmap(dev->regs.rx); in aac_rx_ioremap()
465 dev->base = dev->regs.rx = ioremap(dev->base_start, size); in aac_rx_ioremap()
466 if (dev->base == NULL) in aac_rx_ioremap()
467 return -1; in aac_rx_ioremap()
468 dev->IndexRegs = &dev->regs.rx->IndexRegs; in aac_rx_ioremap()
476 if (!(dev->supplement_adapter_info.supported_options2 & in aac_rx_restart_adapter()
477 AAC_OPTION_MU_RESET) || (bled >= 0) || (bled == -2)) { in aac_rx_restart_adapter()
480 dev->name, dev->id, bled); in aac_rx_restart_adapter()
485 bled = -EINVAL; in aac_rx_restart_adapter()
487 if (bled && (bled != -ETIMEDOUT)) in aac_rx_restart_adapter()
491 if (bled && (bled != -ETIMEDOUT)) in aac_rx_restart_adapter()
492 return -EINVAL; in aac_rx_restart_adapter()
500 return -EINVAL; in aac_rx_restart_adapter()
503 return -ENODEV; in aac_rx_restart_adapter()
510 * aac_rx_select_comm - Select communications method
519 dev->a_ops.adapter_enable_int = aac_rx_enable_interrupt_producer; in aac_rx_select_comm()
520 dev->a_ops.adapter_intr = aac_rx_intr_producer; in aac_rx_select_comm()
521 dev->a_ops.adapter_deliver = aac_rx_deliver_producer; in aac_rx_select_comm()
524 dev->a_ops.adapter_enable_int = aac_rx_enable_interrupt_message; in aac_rx_select_comm()
525 dev->a_ops.adapter_intr = aac_rx_intr_message; in aac_rx_select_comm()
526 dev->a_ops.adapter_deliver = aac_rx_deliver_message; in aac_rx_select_comm()
535 * _aac_rx_init - initialize an i960 based AAC card
538 * Allocate and set up resources for the i960 based AAC variants. The
548 int instance = dev->id; in _aac_rx_init()
549 const char * name = dev->name; in _aac_rx_init()
551 if (aac_adapter_ioremap(dev, dev->base_size)) { in _aac_rx_init()
557 dev->a_ops.adapter_sync_cmd = rx_sync_cmd; in _aac_rx_init()
558 dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt; in _aac_rx_init()
559 dev->OIMR = status = rx_readb (dev, MUnit.OIMR); in _aac_rx_init()
561 if (((status & 0x0c) != 0x0c) || dev->init_reset) { in _aac_rx_init()
562 dev->init_reset = false; in _aac_rx_init()
585 printk(KERN_ERR "%s%d: adapter self-test failed.\n", dev->name, instance); in _aac_rx_init()
592 printk(KERN_ERR "%s%d: adapter monitor panic.\n", dev->name, instance); in _aac_rx_init()
605 dev->name, instance, status); in _aac_rx_init()
612 ? (startup_timeout - 60) in _aac_rx_init()
626 dev->a_ops.adapter_interrupt = aac_rx_interrupt_adapter; in _aac_rx_init()
627 dev->a_ops.adapter_disable_int = aac_rx_disable_interrupt; in _aac_rx_init()
628 dev->a_ops.adapter_notify = aac_rx_notify_adapter; in _aac_rx_init()
629 dev->a_ops.adapter_sync_cmd = rx_sync_cmd; in _aac_rx_init()
630 dev->a_ops.adapter_check_health = aac_rx_check_health; in _aac_rx_init()
631 dev->a_ops.adapter_restart = aac_rx_restart_adapter; in _aac_rx_init()
632 dev->a_ops.adapter_start = aac_rx_start_adapter; in _aac_rx_init()
645 aac_adapter_comm(dev, dev->comm_interface); in _aac_rx_init()
646 dev->sync_mode = 0; /* sync. mode not supported */ in _aac_rx_init()
647 dev->msi = aac_msi && !pci_enable_msi(dev->pdev); in _aac_rx_init()
648 if (request_irq(dev->pdev->irq, dev->a_ops.adapter_intr, in _aac_rx_init()
650 if (dev->msi) in _aac_rx_init()
651 pci_disable_msi(dev->pdev); in _aac_rx_init()
656 dev->dbg_base = dev->base_start; in _aac_rx_init()
657 dev->dbg_base_mapped = dev->base; in _aac_rx_init()
658 dev->dbg_size = dev->base_size; in _aac_rx_init()
671 return -1; in _aac_rx_init()
679 dev->a_ops.adapter_ioremap = aac_rx_ioremap; in aac_rx_init()
680 dev->a_ops.adapter_comm = aac_rx_select_comm; in aac_rx_init()