Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] DAC960: add support for Mylex AcceleRAID 4/5/600

This patch adds support for a new class of DAC960 controllers. It's based
on the GPLed idac320 driver from IBM for Linux 2.4.18. That driver is a
fork of the 2.4.18 version of DAC960 that adds support for this new type of
controllers (internally called "GEM Series"), that differ from other DAC960
V2 firmware controllers only in the register offsets and removes support
for all others.

This patch instead integrates support for these controllers into the DAC960
driver.

Thanks to Anders Norrbring for pointing me to the idac320 driver and
testing this patch.

No Signed-Off: line because all code is either copy & pasted from IBM's
idac320 driver or support for other controllers in the 2.6 DAC960 driver.

Note: the really odd formating matches the rest of the DAC960 driver.

Cc: Dave Olien <dmo@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Christoph Hellwig and committed by
Linus Torvalds
5b76ffd5 c835a388

+449 -1
+132
drivers/block/DAC960.c
··· 3 3 Linux Driver for Mylex DAC960/AcceleRAID/eXtremeRAID PCI RAID Controllers 4 4 5 5 Copyright 1998-2001 by Leonard N. Zubkoff <lnz@dandelion.com> 6 + Portions Copyright 2002 by Mylex (An IBM Business Unit) 6 7 7 8 This program is free software; you may redistribute and/or modify it under 8 9 the terms of the GNU General Public License Version 2 as published by the ··· 533 532 spin_lock_irq(&Controller->queue_lock); 534 533 } 535 534 535 + /* 536 + DAC960_GEM_QueueCommand queues Command for DAC960 GEM Series Controllers. 537 + */ 538 + 539 + static void DAC960_GEM_QueueCommand(DAC960_Command_T *Command) 540 + { 541 + DAC960_Controller_T *Controller = Command->Controller; 542 + void __iomem *ControllerBaseAddress = Controller->BaseAddress; 543 + DAC960_V2_CommandMailbox_T *CommandMailbox = &Command->V2.CommandMailbox; 544 + DAC960_V2_CommandMailbox_T *NextCommandMailbox = 545 + Controller->V2.NextCommandMailbox; 546 + 547 + CommandMailbox->Common.CommandIdentifier = Command->CommandIdentifier; 548 + DAC960_GEM_WriteCommandMailbox(NextCommandMailbox, CommandMailbox); 549 + 550 + if (Controller->V2.PreviousCommandMailbox1->Words[0] == 0 || 551 + Controller->V2.PreviousCommandMailbox2->Words[0] == 0) 552 + DAC960_GEM_MemoryMailboxNewCommand(ControllerBaseAddress); 553 + 554 + Controller->V2.PreviousCommandMailbox2 = 555 + Controller->V2.PreviousCommandMailbox1; 556 + Controller->V2.PreviousCommandMailbox1 = NextCommandMailbox; 557 + 558 + if (++NextCommandMailbox > Controller->V2.LastCommandMailbox) 559 + NextCommandMailbox = Controller->V2.FirstCommandMailbox; 560 + 561 + Controller->V2.NextCommandMailbox = NextCommandMailbox; 562 + } 536 563 537 564 /* 538 565 DAC960_BA_QueueCommand queues Command for DAC960 BA Series Controllers. ··· 1493 1464 Controller->V2.FirstStatusMailboxDMA; 1494 1465 switch (Controller->HardwareType) 1495 1466 { 1467 + case DAC960_GEM_Controller: 1468 + while (DAC960_GEM_HardwareMailboxFullP(ControllerBaseAddress)) 1469 + udelay(1); 1470 + DAC960_GEM_WriteHardwareMailbox(ControllerBaseAddress, CommandMailboxDMA); 1471 + DAC960_GEM_HardwareMailboxNewCommand(ControllerBaseAddress); 1472 + while (!DAC960_GEM_HardwareMailboxStatusAvailableP(ControllerBaseAddress)) 1473 + udelay(1); 1474 + CommandStatus = DAC960_GEM_ReadCommandStatus(ControllerBaseAddress); 1475 + DAC960_GEM_AcknowledgeHardwareMailboxInterrupt(ControllerBaseAddress); 1476 + DAC960_GEM_AcknowledgeHardwareMailboxStatus(ControllerBaseAddress); 1477 + break; 1496 1478 case DAC960_BA_Controller: 1497 1479 while (DAC960_BA_HardwareMailboxFullP(ControllerBaseAddress)) 1498 1480 udelay(1); ··· 2667 2627 if (Controller->MemoryMappedAddress) { 2668 2628 switch(Controller->HardwareType) 2669 2629 { 2630 + case DAC960_GEM_Controller: 2631 + DAC960_GEM_DisableInterrupts(Controller->BaseAddress); 2632 + break; 2670 2633 case DAC960_BA_Controller: 2671 2634 DAC960_BA_DisableInterrupts(Controller->BaseAddress); 2672 2635 break; ··· 2748 2705 2749 2706 switch (Controller->HardwareType) 2750 2707 { 2708 + case DAC960_GEM_Controller: 2709 + Controller->PCI_Address = pci_resource_start(PCI_Device, 0); 2710 + break; 2751 2711 case DAC960_BA_Controller: 2752 2712 Controller->PCI_Address = pci_resource_start(PCI_Device, 0); 2753 2713 break; ··· 2802 2756 BaseAddress = Controller->BaseAddress; 2803 2757 switch (Controller->HardwareType) 2804 2758 { 2759 + case DAC960_GEM_Controller: 2760 + DAC960_GEM_DisableInterrupts(BaseAddress); 2761 + DAC960_GEM_AcknowledgeHardwareMailboxStatus(BaseAddress); 2762 + udelay(1000); 2763 + while (DAC960_GEM_InitializationInProgressP(BaseAddress)) 2764 + { 2765 + if (DAC960_GEM_ReadErrorStatus(BaseAddress, &ErrorStatus, 2766 + &Parameter0, &Parameter1) && 2767 + DAC960_ReportErrorStatus(Controller, ErrorStatus, 2768 + Parameter0, Parameter1)) 2769 + goto Failure; 2770 + udelay(10); 2771 + } 2772 + if (!DAC960_V2_EnableMemoryMailboxInterface(Controller)) 2773 + { 2774 + DAC960_Error("Unable to Enable Memory Mailbox Interface " 2775 + "for Controller at\n", Controller); 2776 + goto Failure; 2777 + } 2778 + DAC960_GEM_EnableInterrupts(BaseAddress); 2779 + Controller->QueueCommand = DAC960_GEM_QueueCommand; 2780 + Controller->ReadControllerConfiguration = 2781 + DAC960_V2_ReadControllerConfiguration; 2782 + Controller->ReadDeviceConfiguration = 2783 + DAC960_V2_ReadDeviceConfiguration; 2784 + Controller->ReportDeviceConfiguration = 2785 + DAC960_V2_ReportDeviceConfiguration; 2786 + Controller->QueueReadWriteCommand = 2787 + DAC960_V2_QueueReadWriteCommand; 2788 + break; 2805 2789 case DAC960_BA_Controller: 2806 2790 DAC960_BA_DisableInterrupts(BaseAddress); 2807 2791 DAC960_BA_AcknowledgeHardwareMailboxStatus(BaseAddress); ··· 5265 5189 wake_up(&Controller->CommandWaitQueue); 5266 5190 } 5267 5191 5192 + /* 5193 + DAC960_GEM_InterruptHandler handles hardware interrupts from DAC960 GEM Series 5194 + Controllers. 5195 + */ 5196 + 5197 + static irqreturn_t DAC960_GEM_InterruptHandler(int IRQ_Channel, 5198 + void *DeviceIdentifier, 5199 + struct pt_regs *InterruptRegisters) 5200 + { 5201 + DAC960_Controller_T *Controller = (DAC960_Controller_T *) DeviceIdentifier; 5202 + void __iomem *ControllerBaseAddress = Controller->BaseAddress; 5203 + DAC960_V2_StatusMailbox_T *NextStatusMailbox; 5204 + unsigned long flags; 5205 + 5206 + spin_lock_irqsave(&Controller->queue_lock, flags); 5207 + DAC960_GEM_AcknowledgeInterrupt(ControllerBaseAddress); 5208 + NextStatusMailbox = Controller->V2.NextStatusMailbox; 5209 + while (NextStatusMailbox->Fields.CommandIdentifier > 0) 5210 + { 5211 + DAC960_V2_CommandIdentifier_T CommandIdentifier = 5212 + NextStatusMailbox->Fields.CommandIdentifier; 5213 + DAC960_Command_T *Command = Controller->Commands[CommandIdentifier-1]; 5214 + Command->V2.CommandStatus = NextStatusMailbox->Fields.CommandStatus; 5215 + Command->V2.RequestSenseLength = 5216 + NextStatusMailbox->Fields.RequestSenseLength; 5217 + Command->V2.DataTransferResidue = 5218 + NextStatusMailbox->Fields.DataTransferResidue; 5219 + NextStatusMailbox->Words[0] = 0; 5220 + if (++NextStatusMailbox > Controller->V2.LastStatusMailbox) 5221 + NextStatusMailbox = Controller->V2.FirstStatusMailbox; 5222 + DAC960_V2_ProcessCompletedCommand(Command); 5223 + } 5224 + Controller->V2.NextStatusMailbox = NextStatusMailbox; 5225 + /* 5226 + Attempt to remove additional I/O Requests from the Controller's 5227 + I/O Request Queue and queue them to the Controller. 5228 + */ 5229 + DAC960_ProcessRequest(Controller); 5230 + spin_unlock_irqrestore(&Controller->queue_lock, flags); 5231 + return IRQ_HANDLED; 5232 + } 5268 5233 5269 5234 /* 5270 5235 DAC960_BA_InterruptHandler handles hardware interrupts from DAC960 BA Series ··· 7079 6962 7080 6963 #endif /* DAC960_GAM_MINOR */ 7081 6964 6965 + static struct DAC960_privdata DAC960_GEM_privdata = { 6966 + .HardwareType = DAC960_GEM_Controller, 6967 + .FirmwareType = DAC960_V2_Controller, 6968 + .InterruptHandler = DAC960_GEM_InterruptHandler, 6969 + .MemoryWindowSize = DAC960_GEM_RegisterWindowSize, 6970 + }; 6971 + 6972 + 7082 6973 static struct DAC960_privdata DAC960_BA_privdata = { 7083 6974 .HardwareType = DAC960_BA_Controller, 7084 6975 .FirmwareType = DAC960_V2_Controller, ··· 7130 7005 }; 7131 7006 7132 7007 static struct pci_device_id DAC960_id_table[] = { 7008 + { 7009 + .vendor = PCI_VENDOR_ID_MYLEX, 7010 + .device = PCI_DEVICE_ID_MYLEX_DAC960_GEM, 7011 + .subvendor = PCI_ANY_ID, 7012 + .subdevice = PCI_ANY_ID, 7013 + .driver_data = (unsigned long) &DAC960_GEM_privdata, 7014 + }, 7133 7015 { 7134 7016 .vendor = PCI_VENDOR_ID_MYLEX, 7135 7017 .device = PCI_DEVICE_ID_MYLEX_DAC960_BA,
+316 -1
drivers/block/DAC960.h
··· 2114 2114 DAC960_LA_Controller = 3, /* DAC1164P */ 2115 2115 DAC960_PG_Controller = 4, /* DAC960PTL/PJ/PG */ 2116 2116 DAC960_PD_Controller = 5, /* DAC960PU/PD/PL/P */ 2117 - DAC960_P_Controller = 6 /* DAC960PU/PD/PL/P */ 2117 + DAC960_P_Controller = 6, /* DAC960PU/PD/PL/P */ 2118 + DAC960_GEM_Controller = 7, /* AcceleRAID 4/5/600 */ 2118 2119 } 2119 2120 DAC960_HardwareType_T; 2120 2121 ··· 2539 2538 2540 2539 writel(u.wl[0], write_address); 2541 2540 writel(u.wl[1], write_address + 4); 2541 + } 2542 + 2543 + /* 2544 + Define the DAC960 GEM Series Controller Interface Register Offsets. 2545 + */ 2546 + 2547 + #define DAC960_GEM_RegisterWindowSize 0x600 2548 + 2549 + typedef enum 2550 + { 2551 + DAC960_GEM_InboundDoorBellRegisterReadSetOffset = 0x214, 2552 + DAC960_GEM_InboundDoorBellRegisterClearOffset = 0x218, 2553 + DAC960_GEM_OutboundDoorBellRegisterReadSetOffset = 0x224, 2554 + DAC960_GEM_OutboundDoorBellRegisterClearOffset = 0x228, 2555 + DAC960_GEM_InterruptStatusRegisterOffset = 0x208, 2556 + DAC960_GEM_InterruptMaskRegisterReadSetOffset = 0x22C, 2557 + DAC960_GEM_InterruptMaskRegisterClearOffset = 0x230, 2558 + DAC960_GEM_CommandMailboxBusAddressOffset = 0x510, 2559 + DAC960_GEM_CommandStatusOffset = 0x518, 2560 + DAC960_GEM_ErrorStatusRegisterReadSetOffset = 0x224, 2561 + DAC960_GEM_ErrorStatusRegisterClearOffset = 0x228, 2562 + } 2563 + DAC960_GEM_RegisterOffsets_T; 2564 + 2565 + /* 2566 + Define the structure of the DAC960 GEM Series Inbound Door Bell 2567 + */ 2568 + 2569 + typedef union DAC960_GEM_InboundDoorBellRegister 2570 + { 2571 + unsigned int All; 2572 + struct { 2573 + unsigned int :24; 2574 + boolean HardwareMailboxNewCommand:1; 2575 + boolean AcknowledgeHardwareMailboxStatus:1; 2576 + boolean GenerateInterrupt:1; 2577 + boolean ControllerReset:1; 2578 + boolean MemoryMailboxNewCommand:1; 2579 + unsigned int :3; 2580 + } Write; 2581 + struct { 2582 + unsigned int :24; 2583 + boolean HardwareMailboxFull:1; 2584 + boolean InitializationInProgress:1; 2585 + unsigned int :6; 2586 + } Read; 2587 + } 2588 + DAC960_GEM_InboundDoorBellRegister_T; 2589 + 2590 + /* 2591 + Define the structure of the DAC960 GEM Series Outbound Door Bell Register. 2592 + */ 2593 + typedef union DAC960_GEM_OutboundDoorBellRegister 2594 + { 2595 + unsigned int All; 2596 + struct { 2597 + unsigned int :24; 2598 + boolean AcknowledgeHardwareMailboxInterrupt:1; 2599 + boolean AcknowledgeMemoryMailboxInterrupt:1; 2600 + unsigned int :6; 2601 + } Write; 2602 + struct { 2603 + unsigned int :24; 2604 + boolean HardwareMailboxStatusAvailable:1; 2605 + boolean MemoryMailboxStatusAvailable:1; 2606 + unsigned int :6; 2607 + } Read; 2608 + } 2609 + DAC960_GEM_OutboundDoorBellRegister_T; 2610 + 2611 + /* 2612 + Define the structure of the DAC960 GEM Series Interrupt Mask Register. 2613 + */ 2614 + typedef union DAC960_GEM_InterruptMaskRegister 2615 + { 2616 + unsigned int All; 2617 + struct { 2618 + unsigned int :16; 2619 + unsigned int :8; 2620 + unsigned int HardwareMailboxInterrupt:1; 2621 + unsigned int MemoryMailboxInterrupt:1; 2622 + unsigned int :6; 2623 + } Bits; 2624 + } 2625 + DAC960_GEM_InterruptMaskRegister_T; 2626 + 2627 + /* 2628 + Define the structure of the DAC960 GEM Series Error Status Register. 2629 + */ 2630 + 2631 + typedef union DAC960_GEM_ErrorStatusRegister 2632 + { 2633 + unsigned int All; 2634 + struct { 2635 + unsigned int :24; 2636 + unsigned int :5; 2637 + boolean ErrorStatusPending:1; 2638 + unsigned int :2; 2639 + } Bits; 2640 + } 2641 + DAC960_GEM_ErrorStatusRegister_T; 2642 + 2643 + /* 2644 + Define inline functions to provide an abstraction for reading and writing the 2645 + DAC960 GEM Series Controller Interface Registers. 2646 + */ 2647 + 2648 + static inline 2649 + void DAC960_GEM_HardwareMailboxNewCommand(void __iomem *ControllerBaseAddress) 2650 + { 2651 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2652 + InboundDoorBellRegister.All = 0; 2653 + InboundDoorBellRegister.Write.HardwareMailboxNewCommand = true; 2654 + writel(InboundDoorBellRegister.All, 2655 + ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset); 2656 + } 2657 + 2658 + static inline 2659 + void DAC960_GEM_AcknowledgeHardwareMailboxStatus(void __iomem *ControllerBaseAddress) 2660 + { 2661 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2662 + InboundDoorBellRegister.All = 0; 2663 + InboundDoorBellRegister.Write.AcknowledgeHardwareMailboxStatus = true; 2664 + writel(InboundDoorBellRegister.All, 2665 + ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterClearOffset); 2666 + } 2667 + 2668 + static inline 2669 + void DAC960_GEM_GenerateInterrupt(void __iomem *ControllerBaseAddress) 2670 + { 2671 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2672 + InboundDoorBellRegister.All = 0; 2673 + InboundDoorBellRegister.Write.GenerateInterrupt = true; 2674 + writel(InboundDoorBellRegister.All, 2675 + ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset); 2676 + } 2677 + 2678 + static inline 2679 + void DAC960_GEM_ControllerReset(void __iomem *ControllerBaseAddress) 2680 + { 2681 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2682 + InboundDoorBellRegister.All = 0; 2683 + InboundDoorBellRegister.Write.ControllerReset = true; 2684 + writel(InboundDoorBellRegister.All, 2685 + ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset); 2686 + } 2687 + 2688 + static inline 2689 + void DAC960_GEM_MemoryMailboxNewCommand(void __iomem *ControllerBaseAddress) 2690 + { 2691 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2692 + InboundDoorBellRegister.All = 0; 2693 + InboundDoorBellRegister.Write.MemoryMailboxNewCommand = true; 2694 + writel(InboundDoorBellRegister.All, 2695 + ControllerBaseAddress + DAC960_GEM_InboundDoorBellRegisterReadSetOffset); 2696 + } 2697 + 2698 + static inline 2699 + boolean DAC960_GEM_HardwareMailboxFullP(void __iomem *ControllerBaseAddress) 2700 + { 2701 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2702 + InboundDoorBellRegister.All = 2703 + readl(ControllerBaseAddress + 2704 + DAC960_GEM_InboundDoorBellRegisterReadSetOffset); 2705 + return InboundDoorBellRegister.Read.HardwareMailboxFull; 2706 + } 2707 + 2708 + static inline 2709 + boolean DAC960_GEM_InitializationInProgressP(void __iomem *ControllerBaseAddress) 2710 + { 2711 + DAC960_GEM_InboundDoorBellRegister_T InboundDoorBellRegister; 2712 + InboundDoorBellRegister.All = 2713 + readl(ControllerBaseAddress + 2714 + DAC960_GEM_InboundDoorBellRegisterReadSetOffset); 2715 + return InboundDoorBellRegister.Read.InitializationInProgress; 2716 + } 2717 + 2718 + static inline 2719 + void DAC960_GEM_AcknowledgeHardwareMailboxInterrupt(void __iomem *ControllerBaseAddress) 2720 + { 2721 + DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister; 2722 + OutboundDoorBellRegister.All = 0; 2723 + OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt = true; 2724 + writel(OutboundDoorBellRegister.All, 2725 + ControllerBaseAddress + DAC960_GEM_OutboundDoorBellRegisterClearOffset); 2726 + } 2727 + 2728 + static inline 2729 + void DAC960_GEM_AcknowledgeMemoryMailboxInterrupt(void __iomem *ControllerBaseAddress) 2730 + { 2731 + DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister; 2732 + OutboundDoorBellRegister.All = 0; 2733 + OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt = true; 2734 + writel(OutboundDoorBellRegister.All, 2735 + ControllerBaseAddress + DAC960_GEM_OutboundDoorBellRegisterClearOffset); 2736 + } 2737 + 2738 + static inline 2739 + void DAC960_GEM_AcknowledgeInterrupt(void __iomem *ControllerBaseAddress) 2740 + { 2741 + DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister; 2742 + OutboundDoorBellRegister.All = 0; 2743 + OutboundDoorBellRegister.Write.AcknowledgeHardwareMailboxInterrupt = true; 2744 + OutboundDoorBellRegister.Write.AcknowledgeMemoryMailboxInterrupt = true; 2745 + writel(OutboundDoorBellRegister.All, 2746 + ControllerBaseAddress + DAC960_GEM_OutboundDoorBellRegisterClearOffset); 2747 + } 2748 + 2749 + static inline 2750 + boolean DAC960_GEM_HardwareMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) 2751 + { 2752 + DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister; 2753 + OutboundDoorBellRegister.All = 2754 + readl(ControllerBaseAddress + 2755 + DAC960_GEM_OutboundDoorBellRegisterReadSetOffset); 2756 + return OutboundDoorBellRegister.Read.HardwareMailboxStatusAvailable; 2757 + } 2758 + 2759 + static inline 2760 + boolean DAC960_GEM_MemoryMailboxStatusAvailableP(void __iomem *ControllerBaseAddress) 2761 + { 2762 + DAC960_GEM_OutboundDoorBellRegister_T OutboundDoorBellRegister; 2763 + OutboundDoorBellRegister.All = 2764 + readl(ControllerBaseAddress + 2765 + DAC960_GEM_OutboundDoorBellRegisterReadSetOffset); 2766 + return OutboundDoorBellRegister.Read.MemoryMailboxStatusAvailable; 2767 + } 2768 + 2769 + static inline 2770 + void DAC960_GEM_EnableInterrupts(void __iomem *ControllerBaseAddress) 2771 + { 2772 + DAC960_GEM_InterruptMaskRegister_T InterruptMaskRegister; 2773 + InterruptMaskRegister.All = 0; 2774 + InterruptMaskRegister.Bits.HardwareMailboxInterrupt = true; 2775 + InterruptMaskRegister.Bits.MemoryMailboxInterrupt = true; 2776 + writel(InterruptMaskRegister.All, 2777 + ControllerBaseAddress + DAC960_GEM_InterruptMaskRegisterClearOffset); 2778 + } 2779 + 2780 + static inline 2781 + void DAC960_GEM_DisableInterrupts(void __iomem *ControllerBaseAddress) 2782 + { 2783 + DAC960_GEM_InterruptMaskRegister_T InterruptMaskRegister; 2784 + InterruptMaskRegister.All = 0; 2785 + InterruptMaskRegister.Bits.HardwareMailboxInterrupt = true; 2786 + InterruptMaskRegister.Bits.MemoryMailboxInterrupt = true; 2787 + writel(InterruptMaskRegister.All, 2788 + ControllerBaseAddress + DAC960_GEM_InterruptMaskRegisterReadSetOffset); 2789 + } 2790 + 2791 + static inline 2792 + boolean DAC960_GEM_InterruptsEnabledP(void __iomem *ControllerBaseAddress) 2793 + { 2794 + DAC960_GEM_InterruptMaskRegister_T InterruptMaskRegister; 2795 + InterruptMaskRegister.All = 2796 + readl(ControllerBaseAddress + 2797 + DAC960_GEM_InterruptMaskRegisterReadSetOffset); 2798 + return !(InterruptMaskRegister.Bits.HardwareMailboxInterrupt || 2799 + InterruptMaskRegister.Bits.MemoryMailboxInterrupt); 2800 + } 2801 + 2802 + static inline 2803 + void DAC960_GEM_WriteCommandMailbox(DAC960_V2_CommandMailbox_T 2804 + *MemoryCommandMailbox, 2805 + DAC960_V2_CommandMailbox_T 2806 + *CommandMailbox) 2807 + { 2808 + memcpy(&MemoryCommandMailbox->Words[1], &CommandMailbox->Words[1], 2809 + sizeof(DAC960_V2_CommandMailbox_T) - sizeof(unsigned int)); 2810 + wmb(); 2811 + MemoryCommandMailbox->Words[0] = CommandMailbox->Words[0]; 2812 + mb(); 2813 + } 2814 + 2815 + static inline 2816 + void DAC960_GEM_WriteHardwareMailbox(void __iomem *ControllerBaseAddress, 2817 + dma_addr_t CommandMailboxDMA) 2818 + { 2819 + dma_addr_writeql(CommandMailboxDMA, 2820 + ControllerBaseAddress + 2821 + DAC960_GEM_CommandMailboxBusAddressOffset); 2822 + } 2823 + 2824 + static inline DAC960_V2_CommandIdentifier_T 2825 + DAC960_GEM_ReadCommandIdentifier(void __iomem *ControllerBaseAddress) 2826 + { 2827 + return readw(ControllerBaseAddress + DAC960_GEM_CommandStatusOffset); 2828 + } 2829 + 2830 + static inline DAC960_V2_CommandStatus_T 2831 + DAC960_GEM_ReadCommandStatus(void __iomem *ControllerBaseAddress) 2832 + { 2833 + return readw(ControllerBaseAddress + DAC960_GEM_CommandStatusOffset + 2); 2834 + } 2835 + 2836 + static inline boolean 2837 + DAC960_GEM_ReadErrorStatus(void __iomem *ControllerBaseAddress, 2838 + unsigned char *ErrorStatus, 2839 + unsigned char *Parameter0, 2840 + unsigned char *Parameter1) 2841 + { 2842 + DAC960_GEM_ErrorStatusRegister_T ErrorStatusRegister; 2843 + ErrorStatusRegister.All = 2844 + readl(ControllerBaseAddress + DAC960_GEM_ErrorStatusRegisterReadSetOffset); 2845 + if (!ErrorStatusRegister.Bits.ErrorStatusPending) return false; 2846 + ErrorStatusRegister.Bits.ErrorStatusPending = false; 2847 + *ErrorStatus = ErrorStatusRegister.All; 2848 + *Parameter0 = 2849 + readb(ControllerBaseAddress + DAC960_GEM_CommandMailboxBusAddressOffset + 0); 2850 + *Parameter1 = 2851 + readb(ControllerBaseAddress + DAC960_GEM_CommandMailboxBusAddressOffset + 1); 2852 + writel(0x03000000, ControllerBaseAddress + 2853 + DAC960_GEM_ErrorStatusRegisterClearOffset); 2854 + return true; 2542 2855 } 2543 2856 2544 2857 /*
+1
include/linux/pci_ids.h
··· 854 854 #define PCI_DEVICE_ID_MYLEX_DAC960_LA 0x0020 855 855 #define PCI_DEVICE_ID_MYLEX_DAC960_LP 0x0050 856 856 #define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 857 + #define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 857 858 858 859 #define PCI_VENDOR_ID_PICOP 0x1066 859 860 #define PCI_DEVICE_ID_PICOP_PT86C52X 0x0001