diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-21 14:51:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-21 14:51:42 -0500 |
commit | cdc194705d26fdd7fc5446b5d830f2bbe2b22c30 (patch) | |
tree | 91a643f38d490e092855792576a7e903a419cfe1 /drivers/scsi/sun3_scsi.c | |
parent | 772c8f6f3bbd3ceb94a89373473083e3e1113554 (diff) | |
parent | d1da522fb8a70b8c527d4ad15f9e62218cc00f2c (diff) |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley:
"This update includes the usual round of major driver updates (ncr5380,
ufs, lpfc, be2iscsi, hisi_sas, storvsc, cxlflash, aacraid,
megaraid_sas, ...).
There's also an assortment of minor fixes and the major update of
switching a bunch of drivers to pci_alloc_irq_vectors from Christoph"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (188 commits)
scsi: megaraid_sas: handle dma_addr_t right on 32-bit
scsi: megaraid_sas: array overflow in megasas_dump_frame()
scsi: snic: switch to pci_irq_alloc_vectors
scsi: megaraid_sas: driver version upgrade
scsi: megaraid_sas: Change RAID_1_10_RMW_CMDS to RAID_1_PEER_CMDS and set value to 2
scsi: megaraid_sas: Indentation and smatch warning fixes
scsi: megaraid_sas: Cleanup VD_EXT_DEBUG and SPAN_DEBUG related debug prints
scsi: megaraid_sas: Increase internal command pool
scsi: megaraid_sas: Use synchronize_irq to wait for IRQs to complete
scsi: megaraid_sas: Bail out the driver load if ld_list_query fails
scsi: megaraid_sas: Change build_mpt_mfi_pass_thru to return void
scsi: megaraid_sas: During OCR, if get_ctrl_info fails do not continue with OCR
scsi: megaraid_sas: Do not set fp_possible if TM capable for non-RW syspdIO, change fp_possible to bool
scsi: megaraid_sas: Remove unused pd_index from megasas_build_ld_nonrw_fusion
scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero
scsi: megaraid_sas: max_fw_cmds are decremented twice, remove duplicate
scsi: megaraid_sas: update can_queue only if the new value is less
scsi: megaraid_sas: Change max_cmd from u32 to u16 in all functions
scsi: megaraid_sas: set pd_after_lb from MR_BuildRaidContext and initialize pDevHandle to MR_DEVHANDLE_INVALID
scsi: megaraid_sas: latest controller OCR capability from FW before sending shutdown DCMD
...
Diffstat (limited to 'drivers/scsi/sun3_scsi.c')
-rw-r--r-- | drivers/scsi/sun3_scsi.c | 83 |
1 files changed, 79 insertions, 4 deletions
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c index bcf7d05d1aab..e64b0c542f95 100644 --- a/drivers/scsi/sun3_scsi.c +++ b/drivers/scsi/sun3_scsi.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/dvma.h> | 34 | #include <asm/dvma.h> |
35 | 35 | ||
36 | #include <scsi/scsi_host.h> | 36 | #include <scsi/scsi_host.h> |
37 | #include "sun3_scsi.h" | ||
38 | 37 | ||
39 | /* minimum number of bytes to do dma on */ | 38 | /* minimum number of bytes to do dma on */ |
40 | #define DMA_MIN_SIZE 129 | 39 | #define DMA_MIN_SIZE 129 |
@@ -56,11 +55,87 @@ | |||
56 | #define NCR5380_dma_send_setup sun3scsi_dma_count | 55 | #define NCR5380_dma_send_setup sun3scsi_dma_count |
57 | #define NCR5380_dma_residual sun3scsi_dma_residual | 56 | #define NCR5380_dma_residual sun3scsi_dma_residual |
58 | 57 | ||
59 | #define NCR5380_acquire_dma_irq(instance) (1) | ||
60 | #define NCR5380_release_dma_irq(instance) | ||
61 | |||
62 | #include "NCR5380.h" | 58 | #include "NCR5380.h" |
63 | 59 | ||
60 | /* dma regs start at regbase + 8, directly after the NCR regs */ | ||
61 | struct sun3_dma_regs { | ||
62 | unsigned short dma_addr_hi; /* vme only */ | ||
63 | unsigned short dma_addr_lo; /* vme only */ | ||
64 | unsigned short dma_count_hi; /* vme only */ | ||
65 | unsigned short dma_count_lo; /* vme only */ | ||
66 | unsigned short udc_data; /* udc dma data reg (obio only) */ | ||
67 | unsigned short udc_addr; /* uda dma addr reg (obio only) */ | ||
68 | unsigned short fifo_data; /* fifo data reg, | ||
69 | * holds extra byte on odd dma reads | ||
70 | */ | ||
71 | unsigned short fifo_count; | ||
72 | unsigned short csr; /* control/status reg */ | ||
73 | unsigned short bpack_hi; /* vme only */ | ||
74 | unsigned short bpack_lo; /* vme only */ | ||
75 | unsigned short ivect; /* vme only */ | ||
76 | unsigned short fifo_count_hi; /* vme only */ | ||
77 | }; | ||
78 | |||
79 | /* ucd chip specific regs - live in dvma space */ | ||
80 | struct sun3_udc_regs { | ||
81 | unsigned short rsel; /* select regs to load */ | ||
82 | unsigned short addr_hi; /* high word of addr */ | ||
83 | unsigned short addr_lo; /* low word */ | ||
84 | unsigned short count; /* words to be xfer'd */ | ||
85 | unsigned short mode_hi; /* high word of channel mode */ | ||
86 | unsigned short mode_lo; /* low word of channel mode */ | ||
87 | }; | ||
88 | |||
89 | /* addresses of the udc registers */ | ||
90 | #define UDC_MODE 0x38 | ||
91 | #define UDC_CSR 0x2e /* command/status */ | ||
92 | #define UDC_CHN_HI 0x26 /* chain high word */ | ||
93 | #define UDC_CHN_LO 0x22 /* chain lo word */ | ||
94 | #define UDC_CURA_HI 0x1a /* cur reg A high */ | ||
95 | #define UDC_CURA_LO 0x0a /* cur reg A low */ | ||
96 | #define UDC_CURB_HI 0x12 /* cur reg B high */ | ||
97 | #define UDC_CURB_LO 0x02 /* cur reg B low */ | ||
98 | #define UDC_MODE_HI 0x56 /* mode reg high */ | ||
99 | #define UDC_MODE_LO 0x52 /* mode reg low */ | ||
100 | #define UDC_COUNT 0x32 /* words to xfer */ | ||
101 | |||
102 | /* some udc commands */ | ||
103 | #define UDC_RESET 0 | ||
104 | #define UDC_CHN_START 0xa0 /* start chain */ | ||
105 | #define UDC_INT_ENABLE 0x32 /* channel 1 int on */ | ||
106 | |||
107 | /* udc mode words */ | ||
108 | #define UDC_MODE_HIWORD 0x40 | ||
109 | #define UDC_MODE_LSEND 0xc2 | ||
110 | #define UDC_MODE_LRECV 0xd2 | ||
111 | |||
112 | /* udc reg selections */ | ||
113 | #define UDC_RSEL_SEND 0x282 | ||
114 | #define UDC_RSEL_RECV 0x182 | ||
115 | |||
116 | /* bits in csr reg */ | ||
117 | #define CSR_DMA_ACTIVE 0x8000 | ||
118 | #define CSR_DMA_CONFLICT 0x4000 | ||
119 | #define CSR_DMA_BUSERR 0x2000 | ||
120 | |||
121 | #define CSR_FIFO_EMPTY 0x400 /* fifo flushed? */ | ||
122 | #define CSR_SDB_INT 0x200 /* sbc interrupt pending */ | ||
123 | #define CSR_DMA_INT 0x100 /* dma interrupt pending */ | ||
124 | |||
125 | #define CSR_LEFT 0xc0 | ||
126 | #define CSR_LEFT_3 0xc0 | ||
127 | #define CSR_LEFT_2 0x80 | ||
128 | #define CSR_LEFT_1 0x40 | ||
129 | #define CSR_PACK_ENABLE 0x20 | ||
130 | |||
131 | #define CSR_DMA_ENABLE 0x10 | ||
132 | |||
133 | #define CSR_SEND 0x8 /* 1 = send 0 = recv */ | ||
134 | #define CSR_FIFO 0x2 /* reset fifo */ | ||
135 | #define CSR_INTR 0x4 /* interrupt enable */ | ||
136 | #define CSR_SCSI 0x1 | ||
137 | |||
138 | #define VME_DATA24 0x3d00 | ||
64 | 139 | ||
65 | extern int sun3_map_test(unsigned long, char *); | 140 | extern int sun3_map_test(unsigned long, char *); |
66 | 141 | ||