diff options
-rw-r--r-- | drivers/scsi/arcmsr/arcmsr.h | 32 | ||||
-rw-r--r-- | drivers/scsi/arcmsr/arcmsr_attr.c | 6 | ||||
-rw-r--r-- | drivers/scsi/arcmsr/arcmsr_hba.c | 170 |
3 files changed, 103 insertions, 105 deletions
diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h index ace7a15b413e..3c38cd8d7117 100644 --- a/drivers/scsi/arcmsr/arcmsr.h +++ b/drivers/scsi/arcmsr/arcmsr.h | |||
@@ -141,14 +141,14 @@ struct CMD_MESSAGE_FIELD | |||
141 | #define IS_SG64_ADDR 0x01000000 /* bit24 */ | 141 | #define IS_SG64_ADDR 0x01000000 /* bit24 */ |
142 | struct SG32ENTRY | 142 | struct SG32ENTRY |
143 | { | 143 | { |
144 | uint32_t length; | 144 | __le32 length; |
145 | uint32_t address; | 145 | __le32 address; |
146 | }; | 146 | }; |
147 | struct SG64ENTRY | 147 | struct SG64ENTRY |
148 | { | 148 | { |
149 | uint32_t length; | 149 | __le32 length; |
150 | uint32_t address; | 150 | __le32 address; |
151 | uint32_t addresshigh; | 151 | __le32 addresshigh; |
152 | }; | 152 | }; |
153 | struct SGENTRY_UNION | 153 | struct SGENTRY_UNION |
154 | { | 154 | { |
@@ -339,13 +339,13 @@ struct MessageUnit_B | |||
339 | uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; | 339 | uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; |
340 | uint32_t postq_index; | 340 | uint32_t postq_index; |
341 | uint32_t doneq_index; | 341 | uint32_t doneq_index; |
342 | uint32_t *drv2iop_doorbell_reg; | 342 | uint32_t __iomem *drv2iop_doorbell_reg; |
343 | uint32_t *drv2iop_doorbell_mask_reg; | 343 | uint32_t __iomem *drv2iop_doorbell_mask_reg; |
344 | uint32_t *iop2drv_doorbell_reg; | 344 | uint32_t __iomem *iop2drv_doorbell_reg; |
345 | uint32_t *iop2drv_doorbell_mask_reg; | 345 | uint32_t __iomem *iop2drv_doorbell_mask_reg; |
346 | uint32_t *msgcode_rwbuffer_reg; | 346 | uint32_t __iomem *msgcode_rwbuffer_reg; |
347 | uint32_t *ioctl_wbuffer_reg; | 347 | uint32_t __iomem *ioctl_wbuffer_reg; |
348 | uint32_t *ioctl_rbuffer_reg; | 348 | uint32_t __iomem *ioctl_rbuffer_reg; |
349 | }; | 349 | }; |
350 | 350 | ||
351 | struct MessageUnit | 351 | struct MessageUnit |
@@ -374,7 +374,11 @@ struct AdapterControlBlock | |||
374 | /* Offset is used in making arc cdb physical to virtual calculations */ | 374 | /* Offset is used in making arc cdb physical to virtual calculations */ |
375 | uint32_t outbound_int_enable; | 375 | uint32_t outbound_int_enable; |
376 | 376 | ||
377 | struct MessageUnit * pmu; | 377 | union { |
378 | struct MessageUnit * pmu; | ||
379 | struct MessageUnit_A __iomem * pmuA; | ||
380 | struct MessageUnit_B * pmuB; | ||
381 | }; | ||
378 | /* message unit ATU inbound base address0 */ | 382 | /* message unit ATU inbound base address0 */ |
379 | 383 | ||
380 | uint32_t acb_flags; | 384 | uint32_t acb_flags; |
@@ -558,7 +562,7 @@ struct SENSE_DATA | |||
558 | 562 | ||
559 | extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *); | 563 | extern void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *); |
560 | extern void arcmsr_iop_message_read(struct AdapterControlBlock *); | 564 | extern void arcmsr_iop_message_read(struct AdapterControlBlock *); |
561 | extern struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *); | 565 | extern struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *); |
562 | extern struct class_device_attribute *arcmsr_host_attrs[]; | 566 | extern struct class_device_attribute *arcmsr_host_attrs[]; |
563 | extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *); | 567 | extern int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *); |
564 | void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb); | 568 | void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb); |
diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c index d04d1aa28fa4..7d7b0a554276 100644 --- a/drivers/scsi/arcmsr/arcmsr_attr.c +++ b/drivers/scsi/arcmsr/arcmsr_attr.c | |||
@@ -85,13 +85,13 @@ static ssize_t arcmsr_sysfs_iop_message_read(struct kobject *kobj, | |||
85 | allxfer_len++; | 85 | allxfer_len++; |
86 | } | 86 | } |
87 | if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { | 87 | if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { |
88 | struct QBUFFER *prbuffer; | 88 | struct QBUFFER __iomem *prbuffer; |
89 | uint8_t *iop_data; | 89 | uint8_t __iomem *iop_data; |
90 | int32_t iop_len; | 90 | int32_t iop_len; |
91 | 91 | ||
92 | acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; | 92 | acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; |
93 | prbuffer = arcmsr_get_iop_rqbuffer(acb); | 93 | prbuffer = arcmsr_get_iop_rqbuffer(acb); |
94 | iop_data = (uint8_t *)prbuffer->data; | 94 | iop_data = prbuffer->data; |
95 | iop_len = readl(&prbuffer->data_len); | 95 | iop_len = readl(&prbuffer->data_len); |
96 | while (iop_len > 0) { | 96 | while (iop_len > 0) { |
97 | acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data); | 97 | acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data); |
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index f7a252885a5c..aaee028dd901 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c | |||
@@ -236,8 +236,8 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) | |||
236 | uint32_t intmask_org; | 236 | uint32_t intmask_org; |
237 | int i, j; | 237 | int i, j; |
238 | 238 | ||
239 | acb->pmu = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); | 239 | acb->pmuA = ioremap(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0)); |
240 | if (!acb->pmu) { | 240 | if (!acb->pmuA) { |
241 | printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", | 241 | printk(KERN_NOTICE "arcmsr%d: memory mapping region fail \n", |
242 | acb->host->host_no); | 242 | acb->host->host_no); |
243 | } | 243 | } |
@@ -287,7 +287,7 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) | |||
287 | 287 | ||
288 | struct pci_dev *pdev = acb->pdev; | 288 | struct pci_dev *pdev = acb->pdev; |
289 | struct MessageUnit_B *reg; | 289 | struct MessageUnit_B *reg; |
290 | void *mem_base0, *mem_base1; | 290 | void __iomem *mem_base0, *mem_base1; |
291 | void *dma_coherent; | 291 | void *dma_coherent; |
292 | dma_addr_t dma_coherent_handle, dma_addr; | 292 | dma_addr_t dma_coherent_handle, dma_addr; |
293 | uint32_t intmask_org; | 293 | uint32_t intmask_org; |
@@ -328,25 +328,20 @@ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb) | |||
328 | 328 | ||
329 | reg = (struct MessageUnit_B *)(dma_coherent + | 329 | reg = (struct MessageUnit_B *)(dma_coherent + |
330 | ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock)); | 330 | ARCMSR_MAX_FREECCB_NUM * sizeof(struct CommandControlBlock)); |
331 | acb->pmu = (struct MessageUnit *)reg; | 331 | acb->pmuB = reg; |
332 | mem_base0 = ioremap(pci_resource_start(pdev, 0), | 332 | mem_base0 = ioremap(pci_resource_start(pdev, 0), |
333 | pci_resource_len(pdev, 0)); | 333 | pci_resource_len(pdev, 0)); |
334 | mem_base1 = ioremap(pci_resource_start(pdev, 2), | 334 | mem_base1 = ioremap(pci_resource_start(pdev, 2), |
335 | pci_resource_len(pdev, 2)); | 335 | pci_resource_len(pdev, 2)); |
336 | reg->drv2iop_doorbell_reg = (uint32_t *)((char *)mem_base0 + | 336 | reg->drv2iop_doorbell_reg = mem_base0 + ARCMSR_DRV2IOP_DOORBELL; |
337 | ARCMSR_DRV2IOP_DOORBELL); | 337 | reg->drv2iop_doorbell_mask_reg = mem_base0 + |
338 | reg->drv2iop_doorbell_mask_reg = (uint32_t *)((char *)mem_base0 + | 338 | ARCMSR_DRV2IOP_DOORBELL_MASK; |
339 | ARCMSR_DRV2IOP_DOORBELL_MASK); | 339 | reg->iop2drv_doorbell_reg = mem_base0 + ARCMSR_IOP2DRV_DOORBELL; |
340 | reg->iop2drv_doorbell_reg = (uint32_t *)((char *)mem_base0 + | 340 | reg->iop2drv_doorbell_mask_reg = mem_base0 + |
341 | ARCMSR_IOP2DRV_DOORBELL); | 341 | ARCMSR_IOP2DRV_DOORBELL_MASK; |
342 | reg->iop2drv_doorbell_mask_reg = (uint32_t *)((char *)mem_base0 + | 342 | reg->ioctl_wbuffer_reg = mem_base1 + ARCMSR_IOCTL_WBUFFER; |
343 | ARCMSR_IOP2DRV_DOORBELL_MASK); | 343 | reg->ioctl_rbuffer_reg = mem_base1 + ARCMSR_IOCTL_RBUFFER; |
344 | reg->ioctl_wbuffer_reg = (uint32_t *)((char *)mem_base1 + | 344 | reg->msgcode_rwbuffer_reg = mem_base1 + ARCMSR_MSGCODE_RWBUFFER; |
345 | ARCMSR_IOCTL_WBUFFER); | ||
346 | reg->ioctl_rbuffer_reg = (uint32_t *)((char *)mem_base1 + | ||
347 | ARCMSR_IOCTL_RBUFFER); | ||
348 | reg->msgcode_rwbuffer_reg = (uint32_t *)((char *)mem_base1 + | ||
349 | ARCMSR_MSGCODE_RWBUFFER); | ||
350 | 345 | ||
351 | acb->vir2phy_offset = (unsigned long)ccb_tmp -(unsigned long)dma_addr; | 346 | acb->vir2phy_offset = (unsigned long)ccb_tmp -(unsigned long)dma_addr; |
352 | for (i = 0; i < ARCMSR_MAX_TARGETID; i++) | 347 | for (i = 0; i < ARCMSR_MAX_TARGETID; i++) |
@@ -467,7 +462,7 @@ static int arcmsr_probe(struct pci_dev *pdev, | |||
467 | 462 | ||
468 | static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb) | 463 | static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb) |
469 | { | 464 | { |
470 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 465 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
471 | uint32_t Index; | 466 | uint32_t Index; |
472 | uint8_t Retries = 0x00; | 467 | uint8_t Retries = 0x00; |
473 | 468 | ||
@@ -488,7 +483,7 @@ static uint8_t arcmsr_hba_wait_msgint_ready(struct AdapterControlBlock *acb) | |||
488 | 483 | ||
489 | static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb) | 484 | static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb) |
490 | { | 485 | { |
491 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 486 | struct MessageUnit_B *reg = acb->pmuB; |
492 | uint32_t Index; | 487 | uint32_t Index; |
493 | uint8_t Retries = 0x00; | 488 | uint8_t Retries = 0x00; |
494 | 489 | ||
@@ -509,7 +504,7 @@ static uint8_t arcmsr_hbb_wait_msgint_ready(struct AdapterControlBlock *acb) | |||
509 | 504 | ||
510 | static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb) | 505 | static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb) |
511 | { | 506 | { |
512 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 507 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
513 | 508 | ||
514 | writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, ®->inbound_msgaddr0); | 509 | writel(ARCMSR_INBOUND_MESG0_ABORT_CMD, ®->inbound_msgaddr0); |
515 | if (arcmsr_hba_wait_msgint_ready(acb)) | 510 | if (arcmsr_hba_wait_msgint_ready(acb)) |
@@ -520,7 +515,7 @@ static void arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb) | |||
520 | 515 | ||
521 | static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb) | 516 | static void arcmsr_abort_hbb_allcmd(struct AdapterControlBlock *acb) |
522 | { | 517 | { |
523 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 518 | struct MessageUnit_B *reg = acb->pmuB; |
524 | 519 | ||
525 | writel(ARCMSR_MESSAGE_ABORT_CMD, reg->drv2iop_doorbell_reg); | 520 | writel(ARCMSR_MESSAGE_ABORT_CMD, reg->drv2iop_doorbell_reg); |
526 | if (arcmsr_hbb_wait_msgint_ready(acb)) | 521 | if (arcmsr_hbb_wait_msgint_ready(acb)) |
@@ -566,7 +561,7 @@ static void arcmsr_ccb_complete(struct CommandControlBlock *ccb, int stand_flag) | |||
566 | 561 | ||
567 | static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) | 562 | static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) |
568 | { | 563 | { |
569 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 564 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
570 | int retry_count = 30; | 565 | int retry_count = 30; |
571 | 566 | ||
572 | writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, ®->inbound_msgaddr0); | 567 | writel(ARCMSR_INBOUND_MESG0_FLUSH_CACHE, ®->inbound_msgaddr0); |
@@ -583,7 +578,7 @@ static void arcmsr_flush_hba_cache(struct AdapterControlBlock *acb) | |||
583 | 578 | ||
584 | static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb) | 579 | static void arcmsr_flush_hbb_cache(struct AdapterControlBlock *acb) |
585 | { | 580 | { |
586 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 581 | struct MessageUnit_B *reg = acb->pmuB; |
587 | int retry_count = 30; | 582 | int retry_count = 30; |
588 | 583 | ||
589 | writel(ARCMSR_MESSAGE_FLUSH_CACHE, reg->drv2iop_doorbell_reg); | 584 | writel(ARCMSR_MESSAGE_FLUSH_CACHE, reg->drv2iop_doorbell_reg); |
@@ -637,7 +632,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb) | |||
637 | switch (acb->adapter_type) { | 632 | switch (acb->adapter_type) { |
638 | 633 | ||
639 | case ACB_ADAPTER_TYPE_A : { | 634 | case ACB_ADAPTER_TYPE_A : { |
640 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 635 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
641 | orig_mask = readl(®->outbound_intmask)|\ | 636 | orig_mask = readl(®->outbound_intmask)|\ |
642 | ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE; | 637 | ARCMSR_MU_OUTBOUND_MESSAGE0_INTMASKENABLE; |
643 | writel(orig_mask|ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE, \ | 638 | writel(orig_mask|ARCMSR_MU_OUTBOUND_ALL_INTMASKENABLE, \ |
@@ -646,7 +641,7 @@ static u32 arcmsr_disable_outbound_ints(struct AdapterControlBlock *acb) | |||
646 | break; | 641 | break; |
647 | 642 | ||
648 | case ACB_ADAPTER_TYPE_B : { | 643 | case ACB_ADAPTER_TYPE_B : { |
649 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 644 | struct MessageUnit_B *reg = acb->pmuB; |
650 | orig_mask = readl(reg->iop2drv_doorbell_mask_reg) & \ | 645 | orig_mask = readl(reg->iop2drv_doorbell_mask_reg) & \ |
651 | (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); | 646 | (~ARCMSR_IOP2DRV_MESSAGE_CMD_DONE); |
652 | writel(0, reg->iop2drv_doorbell_mask_reg); | 647 | writel(0, reg->iop2drv_doorbell_mask_reg); |
@@ -748,14 +743,13 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) | |||
748 | switch (acb->adapter_type) { | 743 | switch (acb->adapter_type) { |
749 | 744 | ||
750 | case ACB_ADAPTER_TYPE_A: { | 745 | case ACB_ADAPTER_TYPE_A: { |
751 | struct MessageUnit_A __iomem *reg = \ | 746 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
752 | (struct MessageUnit_A *)acb->pmu; | ||
753 | uint32_t outbound_intstatus; | 747 | uint32_t outbound_intstatus; |
754 | outbound_intstatus = readl(®->outbound_intstatus) & \ | 748 | outbound_intstatus = readl(®->outbound_intstatus) & |
755 | acb->outbound_int_enable; | 749 | acb->outbound_int_enable; |
756 | /*clear and abort all outbound posted Q*/ | 750 | /*clear and abort all outbound posted Q*/ |
757 | writel(outbound_intstatus, ®->outbound_intstatus);/*clear interrupt*/ | 751 | writel(outbound_intstatus, ®->outbound_intstatus);/*clear interrupt*/ |
758 | while (((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) \ | 752 | while (((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) |
759 | && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { | 753 | && (i++ < ARCMSR_MAX_OUTSTANDING_CMD)) { |
760 | arcmsr_drain_donequeue(acb, flag_ccb); | 754 | arcmsr_drain_donequeue(acb, flag_ccb); |
761 | } | 755 | } |
@@ -763,7 +757,7 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) | |||
763 | break; | 757 | break; |
764 | 758 | ||
765 | case ACB_ADAPTER_TYPE_B: { | 759 | case ACB_ADAPTER_TYPE_B: { |
766 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 760 | struct MessageUnit_B *reg = acb->pmuB; |
767 | /*clear all outbound posted Q*/ | 761 | /*clear all outbound posted Q*/ |
768 | for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { | 762 | for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { |
769 | if ((flag_ccb = readl(®->done_qbuffer[i])) != 0) { | 763 | if ((flag_ccb = readl(®->done_qbuffer[i])) != 0) { |
@@ -859,7 +853,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, \ | |||
859 | switch (acb->adapter_type) { | 853 | switch (acb->adapter_type) { |
860 | 854 | ||
861 | case ACB_ADAPTER_TYPE_A : { | 855 | case ACB_ADAPTER_TYPE_A : { |
862 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 856 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
863 | mask = intmask_org & ~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE | | 857 | mask = intmask_org & ~(ARCMSR_MU_OUTBOUND_POSTQUEUE_INTMASKENABLE | |
864 | ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE); | 858 | ARCMSR_MU_OUTBOUND_DOORBELL_INTMASKENABLE); |
865 | writel(mask, ®->outbound_intmask); | 859 | writel(mask, ®->outbound_intmask); |
@@ -868,7 +862,7 @@ static void arcmsr_enable_outbound_ints(struct AdapterControlBlock *acb, \ | |||
868 | break; | 862 | break; |
869 | 863 | ||
870 | case ACB_ADAPTER_TYPE_B : { | 864 | case ACB_ADAPTER_TYPE_B : { |
871 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 865 | struct MessageUnit_B *reg = acb->pmuB; |
872 | mask = intmask_org | (ARCMSR_IOP2DRV_DATA_WRITE_OK | \ | 866 | mask = intmask_org | (ARCMSR_IOP2DRV_DATA_WRITE_OK | \ |
873 | ARCMSR_IOP2DRV_DATA_READ_OK | ARCMSR_IOP2DRV_CDB_DONE); | 867 | ARCMSR_IOP2DRV_DATA_READ_OK | ARCMSR_IOP2DRV_CDB_DONE); |
874 | writel(mask, reg->iop2drv_doorbell_mask_reg); | 868 | writel(mask, reg->iop2drv_doorbell_mask_reg); |
@@ -882,7 +876,7 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb, | |||
882 | { | 876 | { |
883 | struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&ccb->arcmsr_cdb; | 877 | struct ARCMSR_CDB *arcmsr_cdb = (struct ARCMSR_CDB *)&ccb->arcmsr_cdb; |
884 | int8_t *psge = (int8_t *)&arcmsr_cdb->u; | 878 | int8_t *psge = (int8_t *)&arcmsr_cdb->u; |
885 | uint32_t address_lo, address_hi; | 879 | __le32 address_lo, address_hi; |
886 | int arccdbsize = 0x30; | 880 | int arccdbsize = 0x30; |
887 | int nseg; | 881 | int nseg; |
888 | 882 | ||
@@ -900,7 +894,8 @@ static void arcmsr_build_ccb(struct AdapterControlBlock *acb, | |||
900 | BUG_ON(nseg < 0); | 894 | BUG_ON(nseg < 0); |
901 | 895 | ||
902 | if (nseg) { | 896 | if (nseg) { |
903 | int length, i, cdb_sgcount = 0; | 897 | __le32 length; |
898 | int i, cdb_sgcount = 0; | ||
904 | struct scatterlist *sg; | 899 | struct scatterlist *sg; |
905 | 900 | ||
906 | /* map stor port SG list to our iop SG List. */ | 901 | /* map stor port SG list to our iop SG List. */ |
@@ -947,7 +942,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr | |||
947 | 942 | ||
948 | switch (acb->adapter_type) { | 943 | switch (acb->adapter_type) { |
949 | case ACB_ADAPTER_TYPE_A: { | 944 | case ACB_ADAPTER_TYPE_A: { |
950 | struct MessageUnit_A *reg = (struct MessageUnit_A *)acb->pmu; | 945 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
951 | 946 | ||
952 | if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) | 947 | if (arcmsr_cdb->Flags & ARCMSR_CDB_FLAG_SGL_BSIZE) |
953 | writel(cdb_shifted_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE, | 948 | writel(cdb_shifted_phyaddr | ARCMSR_CCBPOST_FLAG_SGL_BSIZE, |
@@ -959,7 +954,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr | |||
959 | break; | 954 | break; |
960 | 955 | ||
961 | case ACB_ADAPTER_TYPE_B: { | 956 | case ACB_ADAPTER_TYPE_B: { |
962 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 957 | struct MessageUnit_B *reg = acb->pmuB; |
963 | uint32_t ending_index, index = reg->postq_index; | 958 | uint32_t ending_index, index = reg->postq_index; |
964 | 959 | ||
965 | ending_index = ((index + 1) % ARCMSR_MAX_HBB_POSTQUEUE); | 960 | ending_index = ((index + 1) % ARCMSR_MAX_HBB_POSTQUEUE); |
@@ -982,7 +977,7 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr | |||
982 | 977 | ||
983 | static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb) | 978 | static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb) |
984 | { | 979 | { |
985 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 980 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
986 | acb->acb_flags &= ~ACB_F_MSG_START_BGRB; | 981 | acb->acb_flags &= ~ACB_F_MSG_START_BGRB; |
987 | writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, ®->inbound_msgaddr0); | 982 | writel(ARCMSR_INBOUND_MESG0_STOP_BGRB, ®->inbound_msgaddr0); |
988 | 983 | ||
@@ -995,7 +990,7 @@ static void arcmsr_stop_hba_bgrb(struct AdapterControlBlock *acb) | |||
995 | 990 | ||
996 | static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb) | 991 | static void arcmsr_stop_hbb_bgrb(struct AdapterControlBlock *acb) |
997 | { | 992 | { |
998 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 993 | struct MessageUnit_B *reg = acb->pmuB; |
999 | acb->acb_flags &= ~ACB_F_MSG_START_BGRB; | 994 | acb->acb_flags &= ~ACB_F_MSG_START_BGRB; |
1000 | writel(ARCMSR_MESSAGE_STOP_BGRB, reg->drv2iop_doorbell_reg); | 995 | writel(ARCMSR_MESSAGE_STOP_BGRB, reg->drv2iop_doorbell_reg); |
1001 | 996 | ||
@@ -1033,13 +1028,13 @@ void arcmsr_iop_message_read(struct AdapterControlBlock *acb) | |||
1033 | { | 1028 | { |
1034 | switch (acb->adapter_type) { | 1029 | switch (acb->adapter_type) { |
1035 | case ACB_ADAPTER_TYPE_A: { | 1030 | case ACB_ADAPTER_TYPE_A: { |
1036 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1031 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1037 | writel(ARCMSR_INBOUND_DRIVER_DATA_READ_OK, ®->inbound_doorbell); | 1032 | writel(ARCMSR_INBOUND_DRIVER_DATA_READ_OK, ®->inbound_doorbell); |
1038 | } | 1033 | } |
1039 | break; | 1034 | break; |
1040 | 1035 | ||
1041 | case ACB_ADAPTER_TYPE_B: { | 1036 | case ACB_ADAPTER_TYPE_B: { |
1042 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1037 | struct MessageUnit_B *reg = acb->pmuB; |
1043 | writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg); | 1038 | writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg); |
1044 | } | 1039 | } |
1045 | break; | 1040 | break; |
@@ -1050,7 +1045,7 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb) | |||
1050 | { | 1045 | { |
1051 | switch (acb->adapter_type) { | 1046 | switch (acb->adapter_type) { |
1052 | case ACB_ADAPTER_TYPE_A: { | 1047 | case ACB_ADAPTER_TYPE_A: { |
1053 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1048 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1054 | /* | 1049 | /* |
1055 | ** push inbound doorbell tell iop, driver data write ok | 1050 | ** push inbound doorbell tell iop, driver data write ok |
1056 | ** and wait reply on next hwinterrupt for next Qbuffer post | 1051 | ** and wait reply on next hwinterrupt for next Qbuffer post |
@@ -1060,7 +1055,7 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb) | |||
1060 | break; | 1055 | break; |
1061 | 1056 | ||
1062 | case ACB_ADAPTER_TYPE_B: { | 1057 | case ACB_ADAPTER_TYPE_B: { |
1063 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1058 | struct MessageUnit_B *reg = acb->pmuB; |
1064 | /* | 1059 | /* |
1065 | ** push inbound doorbell tell iop, driver data write ok | 1060 | ** push inbound doorbell tell iop, driver data write ok |
1066 | ** and wait reply on next hwinterrupt for next Qbuffer post | 1061 | ** and wait reply on next hwinterrupt for next Qbuffer post |
@@ -1071,41 +1066,41 @@ static void arcmsr_iop_message_wrote(struct AdapterControlBlock *acb) | |||
1071 | } | 1066 | } |
1072 | } | 1067 | } |
1073 | 1068 | ||
1074 | struct QBUFFER *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb) | 1069 | struct QBUFFER __iomem *arcmsr_get_iop_rqbuffer(struct AdapterControlBlock *acb) |
1075 | { | 1070 | { |
1076 | static struct QBUFFER *qbuffer; | 1071 | static struct QBUFFER __iomem *qbuffer; |
1077 | 1072 | ||
1078 | switch (acb->adapter_type) { | 1073 | switch (acb->adapter_type) { |
1079 | 1074 | ||
1080 | case ACB_ADAPTER_TYPE_A: { | 1075 | case ACB_ADAPTER_TYPE_A: { |
1081 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1076 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1082 | qbuffer = (struct QBUFFER __iomem *) ®->message_rbuffer; | 1077 | qbuffer = (struct QBUFFER __iomem *)®->message_rbuffer; |
1083 | } | 1078 | } |
1084 | break; | 1079 | break; |
1085 | 1080 | ||
1086 | case ACB_ADAPTER_TYPE_B: { | 1081 | case ACB_ADAPTER_TYPE_B: { |
1087 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1082 | struct MessageUnit_B *reg = acb->pmuB; |
1088 | qbuffer = (struct QBUFFER __iomem *) reg->ioctl_rbuffer_reg; | 1083 | qbuffer = (struct QBUFFER __iomem *)reg->ioctl_rbuffer_reg; |
1089 | } | 1084 | } |
1090 | break; | 1085 | break; |
1091 | } | 1086 | } |
1092 | return qbuffer; | 1087 | return qbuffer; |
1093 | } | 1088 | } |
1094 | 1089 | ||
1095 | static struct QBUFFER *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb) | 1090 | static struct QBUFFER __iomem *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb) |
1096 | { | 1091 | { |
1097 | static struct QBUFFER *pqbuffer; | 1092 | static struct QBUFFER __iomem *pqbuffer; |
1098 | 1093 | ||
1099 | switch (acb->adapter_type) { | 1094 | switch (acb->adapter_type) { |
1100 | 1095 | ||
1101 | case ACB_ADAPTER_TYPE_A: { | 1096 | case ACB_ADAPTER_TYPE_A: { |
1102 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1097 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1103 | pqbuffer = (struct QBUFFER *) ®->message_wbuffer; | 1098 | pqbuffer = (struct QBUFFER __iomem *) ®->message_wbuffer; |
1104 | } | 1099 | } |
1105 | break; | 1100 | break; |
1106 | 1101 | ||
1107 | case ACB_ADAPTER_TYPE_B: { | 1102 | case ACB_ADAPTER_TYPE_B: { |
1108 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1103 | struct MessageUnit_B *reg = acb->pmuB; |
1109 | pqbuffer = (struct QBUFFER __iomem *)reg->ioctl_wbuffer_reg; | 1104 | pqbuffer = (struct QBUFFER __iomem *)reg->ioctl_wbuffer_reg; |
1110 | } | 1105 | } |
1111 | break; | 1106 | break; |
@@ -1115,15 +1110,15 @@ static struct QBUFFER *arcmsr_get_iop_wqbuffer(struct AdapterControlBlock *acb) | |||
1115 | 1110 | ||
1116 | static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb) | 1111 | static void arcmsr_iop2drv_data_wrote_handle(struct AdapterControlBlock *acb) |
1117 | { | 1112 | { |
1118 | struct QBUFFER *prbuffer; | 1113 | struct QBUFFER __iomem *prbuffer; |
1119 | struct QBUFFER *pQbuffer; | 1114 | struct QBUFFER *pQbuffer; |
1120 | uint8_t *iop_data; | 1115 | uint8_t __iomem *iop_data; |
1121 | int32_t my_empty_len, iop_len, rqbuf_firstindex, rqbuf_lastindex; | 1116 | int32_t my_empty_len, iop_len, rqbuf_firstindex, rqbuf_lastindex; |
1122 | 1117 | ||
1123 | rqbuf_lastindex = acb->rqbuf_lastindex; | 1118 | rqbuf_lastindex = acb->rqbuf_lastindex; |
1124 | rqbuf_firstindex = acb->rqbuf_firstindex; | 1119 | rqbuf_firstindex = acb->rqbuf_firstindex; |
1125 | prbuffer = arcmsr_get_iop_rqbuffer(acb); | 1120 | prbuffer = arcmsr_get_iop_rqbuffer(acb); |
1126 | iop_data = (uint8_t *)prbuffer->data; | 1121 | iop_data = (uint8_t __iomem *)prbuffer->data; |
1127 | iop_len = prbuffer->data_len; | 1122 | iop_len = prbuffer->data_len; |
1128 | my_empty_len = (rqbuf_firstindex - rqbuf_lastindex -1)&(ARCMSR_MAX_QBUFFER -1); | 1123 | my_empty_len = (rqbuf_firstindex - rqbuf_lastindex -1)&(ARCMSR_MAX_QBUFFER -1); |
1129 | 1124 | ||
@@ -1151,8 +1146,8 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) | |||
1151 | acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED; | 1146 | acb->acb_flags |= ACB_F_MESSAGE_WQBUFFER_READED; |
1152 | if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) { | 1147 | if (acb->wqbuf_firstindex != acb->wqbuf_lastindex) { |
1153 | uint8_t *pQbuffer; | 1148 | uint8_t *pQbuffer; |
1154 | struct QBUFFER *pwbuffer; | 1149 | struct QBUFFER __iomem *pwbuffer; |
1155 | uint8_t *iop_data; | 1150 | uint8_t __iomem *iop_data; |
1156 | int32_t allxfer_len = 0; | 1151 | int32_t allxfer_len = 0; |
1157 | 1152 | ||
1158 | acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); | 1153 | acb->acb_flags &= (~ACB_F_MESSAGE_WQBUFFER_READED); |
@@ -1181,7 +1176,7 @@ static void arcmsr_iop2drv_data_read_handle(struct AdapterControlBlock *acb) | |||
1181 | static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) | 1176 | static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) |
1182 | { | 1177 | { |
1183 | uint32_t outbound_doorbell; | 1178 | uint32_t outbound_doorbell; |
1184 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1179 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1185 | 1180 | ||
1186 | outbound_doorbell = readl(®->outbound_doorbell); | 1181 | outbound_doorbell = readl(®->outbound_doorbell); |
1187 | writel(outbound_doorbell, ®->outbound_doorbell); | 1182 | writel(outbound_doorbell, ®->outbound_doorbell); |
@@ -1197,7 +1192,7 @@ static void arcmsr_hba_doorbell_isr(struct AdapterControlBlock *acb) | |||
1197 | static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) | 1192 | static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) |
1198 | { | 1193 | { |
1199 | uint32_t flag_ccb; | 1194 | uint32_t flag_ccb; |
1200 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1195 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1201 | 1196 | ||
1202 | while ((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) { | 1197 | while ((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) { |
1203 | arcmsr_drain_donequeue(acb, flag_ccb); | 1198 | arcmsr_drain_donequeue(acb, flag_ccb); |
@@ -1208,7 +1203,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb) | |||
1208 | { | 1203 | { |
1209 | uint32_t index; | 1204 | uint32_t index; |
1210 | uint32_t flag_ccb; | 1205 | uint32_t flag_ccb; |
1211 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1206 | struct MessageUnit_B *reg = acb->pmuB; |
1212 | 1207 | ||
1213 | index = reg->doneq_index; | 1208 | index = reg->doneq_index; |
1214 | 1209 | ||
@@ -1224,7 +1219,7 @@ static void arcmsr_hbb_postqueue_isr(struct AdapterControlBlock *acb) | |||
1224 | static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) | 1219 | static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) |
1225 | { | 1220 | { |
1226 | uint32_t outbound_intstatus; | 1221 | uint32_t outbound_intstatus; |
1227 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1222 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1228 | 1223 | ||
1229 | outbound_intstatus = readl(®->outbound_intstatus) & \ | 1224 | outbound_intstatus = readl(®->outbound_intstatus) & \ |
1230 | acb->outbound_int_enable; | 1225 | acb->outbound_int_enable; |
@@ -1244,7 +1239,7 @@ static int arcmsr_handle_hba_isr(struct AdapterControlBlock *acb) | |||
1244 | static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) | 1239 | static int arcmsr_handle_hbb_isr(struct AdapterControlBlock *acb) |
1245 | { | 1240 | { |
1246 | uint32_t outbound_doorbell; | 1241 | uint32_t outbound_doorbell; |
1247 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1242 | struct MessageUnit_B *reg = acb->pmuB; |
1248 | 1243 | ||
1249 | outbound_doorbell = readl(reg->iop2drv_doorbell_reg) & \ | 1244 | outbound_doorbell = readl(reg->iop2drv_doorbell_reg) & \ |
1250 | acb->outbound_int_enable; | 1245 | acb->outbound_int_enable; |
@@ -1305,8 +1300,8 @@ void arcmsr_post_ioctldata2iop(struct AdapterControlBlock *acb) | |||
1305 | { | 1300 | { |
1306 | int32_t wqbuf_firstindex, wqbuf_lastindex; | 1301 | int32_t wqbuf_firstindex, wqbuf_lastindex; |
1307 | uint8_t *pQbuffer; | 1302 | uint8_t *pQbuffer; |
1308 | struct QBUFFER *pwbuffer; | 1303 | struct QBUFFER __iomem *pwbuffer; |
1309 | uint8_t *iop_data; | 1304 | uint8_t __iomem *iop_data; |
1310 | int32_t allxfer_len = 0; | 1305 | int32_t allxfer_len = 0; |
1311 | 1306 | ||
1312 | pwbuffer = arcmsr_get_iop_wqbuffer(acb); | 1307 | pwbuffer = arcmsr_get_iop_wqbuffer(acb); |
@@ -1380,13 +1375,13 @@ static int arcmsr_iop_message_xfer(struct AdapterControlBlock *acb, \ | |||
1380 | } | 1375 | } |
1381 | if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { | 1376 | if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { |
1382 | 1377 | ||
1383 | struct QBUFFER *prbuffer; | 1378 | struct QBUFFER __iomem *prbuffer; |
1384 | uint8_t *iop_data; | 1379 | uint8_t __iomem *iop_data; |
1385 | int32_t iop_len; | 1380 | int32_t iop_len; |
1386 | 1381 | ||
1387 | acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; | 1382 | acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; |
1388 | prbuffer = arcmsr_get_iop_rqbuffer(acb); | 1383 | prbuffer = arcmsr_get_iop_rqbuffer(acb); |
1389 | iop_data = (uint8_t *)prbuffer->data; | 1384 | iop_data = prbuffer->data; |
1390 | iop_len = readl(&prbuffer->data_len); | 1385 | iop_len = readl(&prbuffer->data_len); |
1391 | while (iop_len > 0) { | 1386 | while (iop_len > 0) { |
1392 | acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data); | 1387 | acb->rqbuffer[acb->rqbuf_lastindex] = readb(iop_data); |
@@ -1669,11 +1664,11 @@ static int arcmsr_queue_command(struct scsi_cmnd *cmd, | |||
1669 | 1664 | ||
1670 | static void arcmsr_get_hba_config(struct AdapterControlBlock *acb) | 1665 | static void arcmsr_get_hba_config(struct AdapterControlBlock *acb) |
1671 | { | 1666 | { |
1672 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1667 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1673 | char *acb_firm_model = acb->firm_model; | 1668 | char *acb_firm_model = acb->firm_model; |
1674 | char *acb_firm_version = acb->firm_version; | 1669 | char *acb_firm_version = acb->firm_version; |
1675 | char *iop_firm_model = (char *) (®->message_rwbuffer[15]); | 1670 | char __iomem *iop_firm_model = (char __iomem *)(®->message_rwbuffer[15]); |
1676 | char *iop_firm_version = (char *) (®->message_rwbuffer[17]); | 1671 | char __iomem *iop_firm_version = (char __iomem *)(®->message_rwbuffer[17]); |
1677 | int count; | 1672 | int count; |
1678 | 1673 | ||
1679 | writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); | 1674 | writel(ARCMSR_INBOUND_MESG0_GET_CONFIG, ®->inbound_msgaddr0); |
@@ -1710,13 +1705,13 @@ static void arcmsr_get_hba_config(struct AdapterControlBlock *acb) | |||
1710 | 1705 | ||
1711 | static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb) | 1706 | static void arcmsr_get_hbb_config(struct AdapterControlBlock *acb) |
1712 | { | 1707 | { |
1713 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1708 | struct MessageUnit_B *reg = acb->pmuB; |
1714 | uint32_t *lrwbuffer = reg->msgcode_rwbuffer_reg; | 1709 | uint32_t __iomem *lrwbuffer = reg->msgcode_rwbuffer_reg; |
1715 | char *acb_firm_model = acb->firm_model; | 1710 | char *acb_firm_model = acb->firm_model; |
1716 | char *acb_firm_version = acb->firm_version; | 1711 | char *acb_firm_version = acb->firm_version; |
1717 | char *iop_firm_model = (char *) (&lrwbuffer[15]); | 1712 | char __iomem *iop_firm_model = (char __iomem *)(&lrwbuffer[15]); |
1718 | /*firm_model,15,60-67*/ | 1713 | /*firm_model,15,60-67*/ |
1719 | char *iop_firm_version = (char *) (&lrwbuffer[17]); | 1714 | char __iomem *iop_firm_version = (char __iomem *)(&lrwbuffer[17]); |
1720 | /*firm_version,17,68-83*/ | 1715 | /*firm_version,17,68-83*/ |
1721 | int count; | 1716 | int count; |
1722 | 1717 | ||
@@ -1777,7 +1772,7 @@ static void arcmsr_get_firmware_spec(struct AdapterControlBlock *acb) | |||
1777 | static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb, | 1772 | static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb, |
1778 | struct CommandControlBlock *poll_ccb) | 1773 | struct CommandControlBlock *poll_ccb) |
1779 | { | 1774 | { |
1780 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1775 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1781 | struct CommandControlBlock *ccb; | 1776 | struct CommandControlBlock *ccb; |
1782 | uint32_t flag_ccb, outbound_intstatus, poll_ccb_done = 0, poll_count = 0; | 1777 | uint32_t flag_ccb, outbound_intstatus, poll_ccb_done = 0, poll_count = 0; |
1783 | 1778 | ||
@@ -1826,7 +1821,7 @@ static void arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb, | |||
1826 | static void arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, \ | 1821 | static void arcmsr_polling_hbb_ccbdone(struct AdapterControlBlock *acb, \ |
1827 | struct CommandControlBlock *poll_ccb) | 1822 | struct CommandControlBlock *poll_ccb) |
1828 | { | 1823 | { |
1829 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1824 | struct MessageUnit_B *reg = acb->pmuB; |
1830 | struct CommandControlBlock *ccb; | 1825 | struct CommandControlBlock *ccb; |
1831 | uint32_t flag_ccb, poll_ccb_done = 0, poll_count = 0; | 1826 | uint32_t flag_ccb, poll_ccb_done = 0, poll_count = 0; |
1832 | int index; | 1827 | int index; |
@@ -1918,8 +1913,7 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) | |||
1918 | 1913 | ||
1919 | case ACB_ADAPTER_TYPE_A: { | 1914 | case ACB_ADAPTER_TYPE_A: { |
1920 | if (ccb_phyaddr_hi32 != 0) { | 1915 | if (ccb_phyaddr_hi32 != 0) { |
1921 | struct MessageUnit_A __iomem *reg = \ | 1916 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1922 | (struct MessageUnit_A *)acb->pmu; | ||
1923 | uint32_t intmask_org; | 1917 | uint32_t intmask_org; |
1924 | intmask_org = arcmsr_disable_outbound_ints(acb); | 1918 | intmask_org = arcmsr_disable_outbound_ints(acb); |
1925 | writel(ARCMSR_SIGNATURE_SET_CONFIG, \ | 1919 | writel(ARCMSR_SIGNATURE_SET_CONFIG, \ |
@@ -1940,9 +1934,9 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) | |||
1940 | 1934 | ||
1941 | case ACB_ADAPTER_TYPE_B: { | 1935 | case ACB_ADAPTER_TYPE_B: { |
1942 | unsigned long post_queue_phyaddr; | 1936 | unsigned long post_queue_phyaddr; |
1943 | uint32_t *rwbuffer; | 1937 | uint32_t __iomem *rwbuffer; |
1944 | 1938 | ||
1945 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1939 | struct MessageUnit_B *reg = acb->pmuB; |
1946 | uint32_t intmask_org; | 1940 | uint32_t intmask_org; |
1947 | intmask_org = arcmsr_disable_outbound_ints(acb); | 1941 | intmask_org = arcmsr_disable_outbound_ints(acb); |
1948 | reg->postq_index = 0; | 1942 | reg->postq_index = 0; |
@@ -1994,7 +1988,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) | |||
1994 | switch (acb->adapter_type) { | 1988 | switch (acb->adapter_type) { |
1995 | 1989 | ||
1996 | case ACB_ADAPTER_TYPE_A: { | 1990 | case ACB_ADAPTER_TYPE_A: { |
1997 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 1991 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
1998 | do { | 1992 | do { |
1999 | firmware_state = readl(®->outbound_msgaddr1); | 1993 | firmware_state = readl(®->outbound_msgaddr1); |
2000 | } while ((firmware_state & ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK) == 0); | 1994 | } while ((firmware_state & ARCMSR_OUTBOUND_MESG1_FIRMWARE_OK) == 0); |
@@ -2002,7 +1996,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) | |||
2002 | break; | 1996 | break; |
2003 | 1997 | ||
2004 | case ACB_ADAPTER_TYPE_B: { | 1998 | case ACB_ADAPTER_TYPE_B: { |
2005 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 1999 | struct MessageUnit_B *reg = acb->pmuB; |
2006 | do { | 2000 | do { |
2007 | firmware_state = readl(reg->iop2drv_doorbell_reg); | 2001 | firmware_state = readl(reg->iop2drv_doorbell_reg); |
2008 | } while ((firmware_state & ARCMSR_MESSAGE_FIRMWARE_OK) == 0); | 2002 | } while ((firmware_state & ARCMSR_MESSAGE_FIRMWARE_OK) == 0); |
@@ -2013,7 +2007,7 @@ static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb) | |||
2013 | 2007 | ||
2014 | static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb) | 2008 | static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb) |
2015 | { | 2009 | { |
2016 | struct MessageUnit_A __iomem *reg = (struct MessageUnit_A *)acb->pmu; | 2010 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
2017 | acb->acb_flags |= ACB_F_MSG_START_BGRB; | 2011 | acb->acb_flags |= ACB_F_MSG_START_BGRB; |
2018 | writel(ARCMSR_INBOUND_MESG0_START_BGRB, ®->inbound_msgaddr0); | 2012 | writel(ARCMSR_INBOUND_MESG0_START_BGRB, ®->inbound_msgaddr0); |
2019 | if (arcmsr_hba_wait_msgint_ready(acb)) { | 2013 | if (arcmsr_hba_wait_msgint_ready(acb)) { |
@@ -2024,7 +2018,7 @@ static void arcmsr_start_hba_bgrb(struct AdapterControlBlock *acb) | |||
2024 | 2018 | ||
2025 | static void arcmsr_start_hbb_bgrb(struct AdapterControlBlock *acb) | 2019 | static void arcmsr_start_hbb_bgrb(struct AdapterControlBlock *acb) |
2026 | { | 2020 | { |
2027 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 2021 | struct MessageUnit_B *reg = acb->pmuB; |
2028 | acb->acb_flags |= ACB_F_MSG_START_BGRB; | 2022 | acb->acb_flags |= ACB_F_MSG_START_BGRB; |
2029 | writel(ARCMSR_MESSAGE_START_BGRB, reg->drv2iop_doorbell_reg); | 2023 | writel(ARCMSR_MESSAGE_START_BGRB, reg->drv2iop_doorbell_reg); |
2030 | if (arcmsr_hbb_wait_msgint_ready(acb)) { | 2024 | if (arcmsr_hbb_wait_msgint_ready(acb)) { |
@@ -2049,7 +2043,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb) | |||
2049 | { | 2043 | { |
2050 | switch (acb->adapter_type) { | 2044 | switch (acb->adapter_type) { |
2051 | case ACB_ADAPTER_TYPE_A: { | 2045 | case ACB_ADAPTER_TYPE_A: { |
2052 | struct MessageUnit_A *reg = (struct MessageUnit_A *)acb->pmu; | 2046 | struct MessageUnit_A __iomem *reg = acb->pmuA; |
2053 | uint32_t outbound_doorbell; | 2047 | uint32_t outbound_doorbell; |
2054 | /* empty doorbell Qbuffer if door bell ringed */ | 2048 | /* empty doorbell Qbuffer if door bell ringed */ |
2055 | outbound_doorbell = readl(®->outbound_doorbell); | 2049 | outbound_doorbell = readl(®->outbound_doorbell); |
@@ -2060,7 +2054,7 @@ static void arcmsr_clear_doorbell_queue_buffer(struct AdapterControlBlock *acb) | |||
2060 | break; | 2054 | break; |
2061 | 2055 | ||
2062 | case ACB_ADAPTER_TYPE_B: { | 2056 | case ACB_ADAPTER_TYPE_B: { |
2063 | struct MessageUnit_B *reg = (struct MessageUnit_B *)acb->pmu; | 2057 | struct MessageUnit_B *reg = acb->pmuB; |
2064 | /*clear interrupt and message state*/ | 2058 | /*clear interrupt and message state*/ |
2065 | writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell_reg); | 2059 | writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell_reg); |
2066 | writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg); | 2060 | writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell_reg); |