Commit 7e315ffd authored by Ching Huang's avatar Ching Huang Committed by Martin K. Petersen

arcmsr: adds code to support new Areca adapter ARC1203

Support Areca's new PCIe to SATA RAID adapter ARC1203.
Signed-off-by: default avatarChing Huang <ching2048@areca.com.tw>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: default avatarHannes Reinicke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent d662ad24
...@@ -74,6 +74,9 @@ struct device_attribute; ...@@ -74,6 +74,9 @@ struct device_attribute;
#ifndef PCI_DEVICE_ID_ARECA_1214 #ifndef PCI_DEVICE_ID_ARECA_1214
#define PCI_DEVICE_ID_ARECA_1214 0x1214 #define PCI_DEVICE_ID_ARECA_1214 0x1214
#endif #endif
#ifndef PCI_DEVICE_ID_ARECA_1203
#define PCI_DEVICE_ID_ARECA_1203 0x1203
#endif
/* /*
********************************************************************************** **********************************************************************************
** **
...@@ -245,6 +248,12 @@ struct FIRMWARE_INFO ...@@ -245,6 +248,12 @@ struct FIRMWARE_INFO
/* window of "instruction flags" from iop to driver */ /* window of "instruction flags" from iop to driver */
#define ARCMSR_IOP2DRV_DOORBELL 0x00020408 #define ARCMSR_IOP2DRV_DOORBELL 0x00020408
#define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C #define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C
/* window of "instruction flags" from iop to driver */
#define ARCMSR_IOP2DRV_DOORBELL_1203 0x00021870
#define ARCMSR_IOP2DRV_DOORBELL_MASK_1203 0x00021874
/* window of "instruction flags" from driver to iop */
#define ARCMSR_DRV2IOP_DOORBELL_1203 0x00021878
#define ARCMSR_DRV2IOP_DOORBELL_MASK_1203 0x0002187C
/* ARECA FLAG LANGUAGE */ /* ARECA FLAG LANGUAGE */
/* ioctl transfer */ /* ioctl transfer */
#define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001 #define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001
......
...@@ -114,6 +114,7 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb); ...@@ -114,6 +114,7 @@ static void arcmsr_hardware_reset(struct AdapterControlBlock *acb);
static const char *arcmsr_info(struct Scsi_Host *); static const char *arcmsr_info(struct Scsi_Host *);
static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb); static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb);
static void arcmsr_free_irq(struct pci_dev *, struct AdapterControlBlock *); static void arcmsr_free_irq(struct pci_dev *, struct AdapterControlBlock *);
static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb);
static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, int queue_depth) static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, int queue_depth)
{ {
if (queue_depth > ARCMSR_MAX_CMD_PERLUN) if (queue_depth > ARCMSR_MAX_CMD_PERLUN)
...@@ -157,6 +158,8 @@ static struct pci_device_id arcmsr_device_id_table[] = { ...@@ -157,6 +158,8 @@ static struct pci_device_id arcmsr_device_id_table[] = {
.driver_data = ACB_ADAPTER_TYPE_B}, .driver_data = ACB_ADAPTER_TYPE_B},
{PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1202), {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1202),
.driver_data = ACB_ADAPTER_TYPE_B}, .driver_data = ACB_ADAPTER_TYPE_B},
{PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1203),
.driver_data = ACB_ADAPTER_TYPE_B},
{PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1210), {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1210),
.driver_data = ACB_ADAPTER_TYPE_A}, .driver_data = ACB_ADAPTER_TYPE_A},
{PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1214), {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1214),
...@@ -2621,7 +2624,7 @@ static bool arcmsr_hbaA_get_config(struct AdapterControlBlock *acb) ...@@ -2621,7 +2624,7 @@ static bool arcmsr_hbaA_get_config(struct AdapterControlBlock *acb)
} }
static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
{ {
struct MessageUnit_B *reg = acb->pmuB; struct MessageUnit_B *reg;
struct pci_dev *pdev = acb->pdev; struct pci_dev *pdev = acb->pdev;
void *dma_coherent; void *dma_coherent;
dma_addr_t dma_coherent_handle; dma_addr_t dma_coherent_handle;
...@@ -2649,10 +2652,17 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) ...@@ -2649,10 +2652,17 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
acb->dma_coherent2 = dma_coherent; acb->dma_coherent2 = dma_coherent;
reg = (struct MessageUnit_B *)dma_coherent; reg = (struct MessageUnit_B *)dma_coherent;
acb->pmuB = reg; acb->pmuB = reg;
if (acb->pdev->device == PCI_DEVICE_ID_ARECA_1203) {
reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_1203);
reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK_1203);
reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_1203);
reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK_1203);
} else {
reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL); reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK); reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL); reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK); reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
}
reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER); reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
reg->message_rbuffer = MEM_BASE1(ARCMSR_MESSAGE_RBUFFER); reg->message_rbuffer = MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER); reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
...@@ -2660,6 +2670,12 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb) ...@@ -2660,6 +2670,12 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
iop_firm_version = (char __iomem *)(&reg->message_rwbuffer[17]); /*firm_version,17,68-83*/ iop_firm_version = (char __iomem *)(&reg->message_rwbuffer[17]); /*firm_version,17,68-83*/
iop_device_map = (char __iomem *)(&reg->message_rwbuffer[21]); /*firm_version,21,84-99*/ iop_device_map = (char __iomem *)(&reg->message_rwbuffer[21]); /*firm_version,21,84-99*/
arcmsr_wait_firmware_ready(acb);
writel(ARCMSR_MESSAGE_START_DRIVER_MODE, reg->drv2iop_doorbell);
if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
printk(KERN_ERR "arcmsr%d: can't set driver mode.\n", acb->host->host_no);
goto err_free_dma;
}
writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell); writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell);
if (!arcmsr_hbaB_wait_msgint_ready(acb)) { if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \ printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \
...@@ -4002,6 +4018,7 @@ static const char *arcmsr_info(struct Scsi_Host *host) ...@@ -4002,6 +4018,7 @@ static const char *arcmsr_info(struct Scsi_Host *host)
case PCI_DEVICE_ID_ARECA_1160: case PCI_DEVICE_ID_ARECA_1160:
case PCI_DEVICE_ID_ARECA_1170: case PCI_DEVICE_ID_ARECA_1170:
case PCI_DEVICE_ID_ARECA_1201: case PCI_DEVICE_ID_ARECA_1201:
case PCI_DEVICE_ID_ARECA_1203:
case PCI_DEVICE_ID_ARECA_1220: case PCI_DEVICE_ID_ARECA_1220:
case PCI_DEVICE_ID_ARECA_1230: case PCI_DEVICE_ID_ARECA_1230:
case PCI_DEVICE_ID_ARECA_1260: case PCI_DEVICE_ID_ARECA_1260:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment