diff options
Diffstat (limited to 'drivers/scsi/csiostor/csio_hw_t5.c')
-rw-r--r-- | drivers/scsi/csiostor/csio_hw_t5.c | 150 |
1 files changed, 75 insertions, 75 deletions
diff --git a/drivers/scsi/csiostor/csio_hw_t5.c b/drivers/scsi/csiostor/csio_hw_t5.c index 66e180a58718..3267f4f627c9 100644 --- a/drivers/scsi/csiostor/csio_hw_t5.c +++ b/drivers/scsi/csiostor/csio_hw_t5.c | |||
@@ -56,11 +56,11 @@ csio_t5_set_mem_win(struct csio_hw *hw, uint32_t win) | |||
56 | * back MA register to ensure that changes propagate before we attempt | 56 | * back MA register to ensure that changes propagate before we attempt |
57 | * to use the new values.) | 57 | * to use the new values.) |
58 | */ | 58 | */ |
59 | csio_wr_reg32(hw, mem_win_base | BIR(0) | | 59 | csio_wr_reg32(hw, mem_win_base | BIR_V(0) | |
60 | WINDOW(ilog2(MEMWIN_APERTURE) - 10), | 60 | WINDOW_V(ilog2(MEMWIN_APERTURE) - 10), |
61 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, win)); | 61 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN_A, win)); |
62 | csio_rd_reg32(hw, | 62 | csio_rd_reg32(hw, |
63 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, win)); | 63 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN_A, win)); |
64 | 64 | ||
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
@@ -72,74 +72,74 @@ static void | |||
72 | csio_t5_pcie_intr_handler(struct csio_hw *hw) | 72 | csio_t5_pcie_intr_handler(struct csio_hw *hw) |
73 | { | 73 | { |
74 | static struct intr_info sysbus_intr_info[] = { | 74 | static struct intr_info sysbus_intr_info[] = { |
75 | { RNPP, "RXNP array parity error", -1, 1 }, | 75 | { RNPP_F, "RXNP array parity error", -1, 1 }, |
76 | { RPCP, "RXPC array parity error", -1, 1 }, | 76 | { RPCP_F, "RXPC array parity error", -1, 1 }, |
77 | { RCIP, "RXCIF array parity error", -1, 1 }, | 77 | { RCIP_F, "RXCIF array parity error", -1, 1 }, |
78 | { RCCP, "Rx completions control array parity error", -1, 1 }, | 78 | { RCCP_F, "Rx completions control array parity error", -1, 1 }, |
79 | { RFTP, "RXFT array parity error", -1, 1 }, | 79 | { RFTP_F, "RXFT array parity error", -1, 1 }, |
80 | { 0, NULL, 0, 0 } | 80 | { 0, NULL, 0, 0 } |
81 | }; | 81 | }; |
82 | static struct intr_info pcie_port_intr_info[] = { | 82 | static struct intr_info pcie_port_intr_info[] = { |
83 | { TPCP, "TXPC array parity error", -1, 1 }, | 83 | { TPCP_F, "TXPC array parity error", -1, 1 }, |
84 | { TNPP, "TXNP array parity error", -1, 1 }, | 84 | { TNPP_F, "TXNP array parity error", -1, 1 }, |
85 | { TFTP, "TXFT array parity error", -1, 1 }, | 85 | { TFTP_F, "TXFT array parity error", -1, 1 }, |
86 | { TCAP, "TXCA array parity error", -1, 1 }, | 86 | { TCAP_F, "TXCA array parity error", -1, 1 }, |
87 | { TCIP, "TXCIF array parity error", -1, 1 }, | 87 | { TCIP_F, "TXCIF array parity error", -1, 1 }, |
88 | { RCAP, "RXCA array parity error", -1, 1 }, | 88 | { RCAP_F, "RXCA array parity error", -1, 1 }, |
89 | { OTDD, "outbound request TLP discarded", -1, 1 }, | 89 | { OTDD_F, "outbound request TLP discarded", -1, 1 }, |
90 | { RDPE, "Rx data parity error", -1, 1 }, | 90 | { RDPE_F, "Rx data parity error", -1, 1 }, |
91 | { TDUE, "Tx uncorrectable data error", -1, 1 }, | 91 | { TDUE_F, "Tx uncorrectable data error", -1, 1 }, |
92 | { 0, NULL, 0, 0 } | 92 | { 0, NULL, 0, 0 } |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static struct intr_info pcie_intr_info[] = { | 95 | static struct intr_info pcie_intr_info[] = { |
96 | { MSTGRPPERR, "Master Response Read Queue parity error", | 96 | { MSTGRPPERR_F, "Master Response Read Queue parity error", |
97 | -1, 1 }, | 97 | -1, 1 }, |
98 | { MSTTIMEOUTPERR, "Master Timeout FIFO parity error", -1, 1 }, | 98 | { MSTTIMEOUTPERR_F, "Master Timeout FIFO parity error", -1, 1 }, |
99 | { MSIXSTIPERR, "MSI-X STI SRAM parity error", -1, 1 }, | 99 | { MSIXSTIPERR_F, "MSI-X STI SRAM parity error", -1, 1 }, |
100 | { MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, | 100 | { MSIXADDRLPERR_F, "MSI-X AddrL parity error", -1, 1 }, |
101 | { MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, | 101 | { MSIXADDRHPERR_F, "MSI-X AddrH parity error", -1, 1 }, |
102 | { MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, | 102 | { MSIXDATAPERR_F, "MSI-X data parity error", -1, 1 }, |
103 | { MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, | 103 | { MSIXDIPERR_F, "MSI-X DI parity error", -1, 1 }, |
104 | { PIOCPLGRPPERR, "PCI PIO completion Group FIFO parity error", | 104 | { PIOCPLGRPPERR_F, "PCI PIO completion Group FIFO parity error", |
105 | -1, 1 }, | 105 | -1, 1 }, |
106 | { PIOREQGRPPERR, "PCI PIO request Group FIFO parity error", | 106 | { PIOREQGRPPERR_F, "PCI PIO request Group FIFO parity error", |
107 | -1, 1 }, | 107 | -1, 1 }, |
108 | { TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, | 108 | { TARTAGPERR_F, "PCI PCI target tag FIFO parity error", -1, 1 }, |
109 | { MSTTAGQPERR, "PCI master tag queue parity error", -1, 1 }, | 109 | { MSTTAGQPERR_F, "PCI master tag queue parity error", -1, 1 }, |
110 | { CREQPERR, "PCI CMD channel request parity error", -1, 1 }, | 110 | { CREQPERR_F, "PCI CMD channel request parity error", -1, 1 }, |
111 | { CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, | 111 | { CRSPPERR_F, "PCI CMD channel response parity error", -1, 1 }, |
112 | { DREQWRPERR, "PCI DMA channel write request parity error", | 112 | { DREQWRPERR_F, "PCI DMA channel write request parity error", |
113 | -1, 1 }, | 113 | -1, 1 }, |
114 | { DREQPERR, "PCI DMA channel request parity error", -1, 1 }, | 114 | { DREQPERR_F, "PCI DMA channel request parity error", -1, 1 }, |
115 | { DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, | 115 | { DRSPPERR_F, "PCI DMA channel response parity error", -1, 1 }, |
116 | { HREQWRPERR, "PCI HMA channel count parity error", -1, 1 }, | 116 | { HREQWRPERR_F, "PCI HMA channel count parity error", -1, 1 }, |
117 | { HREQPERR, "PCI HMA channel request parity error", -1, 1 }, | 117 | { HREQPERR_F, "PCI HMA channel request parity error", -1, 1 }, |
118 | { HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, | 118 | { HRSPPERR_F, "PCI HMA channel response parity error", -1, 1 }, |
119 | { CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, | 119 | { CFGSNPPERR_F, "PCI config snoop FIFO parity error", -1, 1 }, |
120 | { FIDPERR, "PCI FID parity error", -1, 1 }, | 120 | { FIDPERR_F, "PCI FID parity error", -1, 1 }, |
121 | { VFIDPERR, "PCI INTx clear parity error", -1, 1 }, | 121 | { VFIDPERR_F, "PCI INTx clear parity error", -1, 1 }, |
122 | { MAGRPPERR, "PCI MA group FIFO parity error", -1, 1 }, | 122 | { MAGRPPERR_F, "PCI MA group FIFO parity error", -1, 1 }, |
123 | { PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, | 123 | { PIOTAGPERR_F, "PCI PIO tag parity error", -1, 1 }, |
124 | { IPRXHDRGRPPERR, "PCI IP Rx header group parity error", | 124 | { IPRXHDRGRPPERR_F, "PCI IP Rx header group parity error", |
125 | -1, 1 }, | 125 | -1, 1 }, |
126 | { IPRXDATAGRPPERR, "PCI IP Rx data group parity error", | 126 | { IPRXDATAGRPPERR_F, "PCI IP Rx data group parity error", |
127 | -1, 1 }, | 127 | -1, 1 }, |
128 | { RPLPERR, "PCI IP replay buffer parity error", -1, 1 }, | 128 | { RPLPERR_F, "PCI IP replay buffer parity error", -1, 1 }, |
129 | { IPSOTPERR, "PCI IP SOT buffer parity error", -1, 1 }, | 129 | { IPSOTPERR_F, "PCI IP SOT buffer parity error", -1, 1 }, |
130 | { TRGT1GRPPERR, "PCI TRGT1 group FIFOs parity error", -1, 1 }, | 130 | { TRGT1GRPPERR_F, "PCI TRGT1 group FIFOs parity error", -1, 1 }, |
131 | { READRSPERR, "Outbound read error", -1, 0 }, | 131 | { READRSPERR_F, "Outbound read error", -1, 0 }, |
132 | { 0, NULL, 0, 0 } | 132 | { 0, NULL, 0, 0 } |
133 | }; | 133 | }; |
134 | 134 | ||
135 | int fat; | 135 | int fat; |
136 | fat = csio_handle_intr_status(hw, | 136 | fat = csio_handle_intr_status(hw, |
137 | PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, | 137 | PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS_A, |
138 | sysbus_intr_info) + | 138 | sysbus_intr_info) + |
139 | csio_handle_intr_status(hw, | 139 | csio_handle_intr_status(hw, |
140 | PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, | 140 | PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS_A, |
141 | pcie_port_intr_info) + | 141 | pcie_port_intr_info) + |
142 | csio_handle_intr_status(hw, PCIE_INT_CAUSE, pcie_intr_info); | 142 | csio_handle_intr_status(hw, PCIE_INT_CAUSE_A, pcie_intr_info); |
143 | if (fat) | 143 | if (fat) |
144 | csio_hw_fatal_err(hw); | 144 | csio_hw_fatal_err(hw); |
145 | } | 145 | } |
@@ -177,25 +177,25 @@ csio_t5_mc_read(struct csio_hw *hw, int idx, uint32_t addr, __be32 *data, | |||
177 | uint32_t mc_bist_cmd_reg, mc_bist_cmd_addr_reg, mc_bist_cmd_len_reg; | 177 | uint32_t mc_bist_cmd_reg, mc_bist_cmd_addr_reg, mc_bist_cmd_len_reg; |
178 | uint32_t mc_bist_status_rdata_reg, mc_bist_data_pattern_reg; | 178 | uint32_t mc_bist_status_rdata_reg, mc_bist_data_pattern_reg; |
179 | 179 | ||
180 | mc_bist_cmd_reg = MC_REG(MC_P_BIST_CMD, idx); | 180 | mc_bist_cmd_reg = MC_REG(MC_P_BIST_CMD_A, idx); |
181 | mc_bist_cmd_addr_reg = MC_REG(MC_P_BIST_CMD_ADDR, idx); | 181 | mc_bist_cmd_addr_reg = MC_REG(MC_P_BIST_CMD_ADDR_A, idx); |
182 | mc_bist_cmd_len_reg = MC_REG(MC_P_BIST_CMD_LEN, idx); | 182 | mc_bist_cmd_len_reg = MC_REG(MC_P_BIST_CMD_LEN_A, idx); |
183 | mc_bist_status_rdata_reg = MC_REG(MC_P_BIST_STATUS_RDATA, idx); | 183 | mc_bist_status_rdata_reg = MC_REG(MC_P_BIST_STATUS_RDATA_A, idx); |
184 | mc_bist_data_pattern_reg = MC_REG(MC_P_BIST_DATA_PATTERN, idx); | 184 | mc_bist_data_pattern_reg = MC_REG(MC_P_BIST_DATA_PATTERN_A, idx); |
185 | 185 | ||
186 | if (csio_rd_reg32(hw, mc_bist_cmd_reg) & START_BIST) | 186 | if (csio_rd_reg32(hw, mc_bist_cmd_reg) & START_BIST_F) |
187 | return -EBUSY; | 187 | return -EBUSY; |
188 | csio_wr_reg32(hw, addr & ~0x3fU, mc_bist_cmd_addr_reg); | 188 | csio_wr_reg32(hw, addr & ~0x3fU, mc_bist_cmd_addr_reg); |
189 | csio_wr_reg32(hw, 64, mc_bist_cmd_len_reg); | 189 | csio_wr_reg32(hw, 64, mc_bist_cmd_len_reg); |
190 | csio_wr_reg32(hw, 0xc, mc_bist_data_pattern_reg); | 190 | csio_wr_reg32(hw, 0xc, mc_bist_data_pattern_reg); |
191 | csio_wr_reg32(hw, BIST_OPCODE(1) | START_BIST | BIST_CMD_GAP(1), | 191 | csio_wr_reg32(hw, BIST_OPCODE_V(1) | START_BIST_F | BIST_CMD_GAP_V(1), |
192 | mc_bist_cmd_reg); | 192 | mc_bist_cmd_reg); |
193 | i = csio_hw_wait_op_done_val(hw, mc_bist_cmd_reg, START_BIST, | 193 | i = csio_hw_wait_op_done_val(hw, mc_bist_cmd_reg, START_BIST_F, |
194 | 0, 10, 1, NULL); | 194 | 0, 10, 1, NULL); |
195 | if (i) | 195 | if (i) |
196 | return i; | 196 | return i; |
197 | 197 | ||
198 | #define MC_DATA(i) MC_BIST_STATUS_REG(MC_BIST_STATUS_RDATA, i) | 198 | #define MC_DATA(i) MC_BIST_STATUS_REG(MC_BIST_STATUS_RDATA_A, i) |
199 | 199 | ||
200 | for (i = 15; i >= 0; i--) | 200 | for (i = 15; i >= 0; i--) |
201 | *data++ = htonl(csio_rd_reg32(hw, MC_DATA(i))); | 201 | *data++ = htonl(csio_rd_reg32(hw, MC_DATA(i))); |
@@ -231,27 +231,27 @@ csio_t5_edc_read(struct csio_hw *hw, int idx, uint32_t addr, __be32 *data, | |||
231 | #define EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR) | 231 | #define EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR) |
232 | #define EDC_REG_T5(reg, idx) (reg + EDC_STRIDE_T5 * idx) | 232 | #define EDC_REG_T5(reg, idx) (reg + EDC_STRIDE_T5 * idx) |
233 | 233 | ||
234 | edc_bist_cmd_reg = EDC_REG_T5(EDC_H_BIST_CMD, idx); | 234 | edc_bist_cmd_reg = EDC_REG_T5(EDC_H_BIST_CMD_A, idx); |
235 | edc_bist_cmd_addr_reg = EDC_REG_T5(EDC_H_BIST_CMD_ADDR, idx); | 235 | edc_bist_cmd_addr_reg = EDC_REG_T5(EDC_H_BIST_CMD_ADDR_A, idx); |
236 | edc_bist_cmd_len_reg = EDC_REG_T5(EDC_H_BIST_CMD_LEN, idx); | 236 | edc_bist_cmd_len_reg = EDC_REG_T5(EDC_H_BIST_CMD_LEN_A, idx); |
237 | edc_bist_cmd_data_pattern = EDC_REG_T5(EDC_H_BIST_DATA_PATTERN, idx); | 237 | edc_bist_cmd_data_pattern = EDC_REG_T5(EDC_H_BIST_DATA_PATTERN_A, idx); |
238 | edc_bist_status_rdata_reg = EDC_REG_T5(EDC_H_BIST_STATUS_RDATA, idx); | 238 | edc_bist_status_rdata_reg = EDC_REG_T5(EDC_H_BIST_STATUS_RDATA_A, idx); |
239 | #undef EDC_REG_T5 | 239 | #undef EDC_REG_T5 |
240 | #undef EDC_STRIDE_T5 | 240 | #undef EDC_STRIDE_T5 |
241 | 241 | ||
242 | if (csio_rd_reg32(hw, edc_bist_cmd_reg) & START_BIST) | 242 | if (csio_rd_reg32(hw, edc_bist_cmd_reg) & START_BIST_F) |
243 | return -EBUSY; | 243 | return -EBUSY; |
244 | csio_wr_reg32(hw, addr & ~0x3fU, edc_bist_cmd_addr_reg); | 244 | csio_wr_reg32(hw, addr & ~0x3fU, edc_bist_cmd_addr_reg); |
245 | csio_wr_reg32(hw, 64, edc_bist_cmd_len_reg); | 245 | csio_wr_reg32(hw, 64, edc_bist_cmd_len_reg); |
246 | csio_wr_reg32(hw, 0xc, edc_bist_cmd_data_pattern); | 246 | csio_wr_reg32(hw, 0xc, edc_bist_cmd_data_pattern); |
247 | csio_wr_reg32(hw, BIST_OPCODE(1) | START_BIST | BIST_CMD_GAP(1), | 247 | csio_wr_reg32(hw, BIST_OPCODE_V(1) | START_BIST_F | BIST_CMD_GAP_V(1), |
248 | edc_bist_cmd_reg); | 248 | edc_bist_cmd_reg); |
249 | i = csio_hw_wait_op_done_val(hw, edc_bist_cmd_reg, START_BIST, | 249 | i = csio_hw_wait_op_done_val(hw, edc_bist_cmd_reg, START_BIST_F, |
250 | 0, 10, 1, NULL); | 250 | 0, 10, 1, NULL); |
251 | if (i) | 251 | if (i) |
252 | return i; | 252 | return i; |
253 | 253 | ||
254 | #define EDC_DATA(i) (EDC_BIST_STATUS_REG(EDC_BIST_STATUS_RDATA, i) + idx) | 254 | #define EDC_DATA(i) (EDC_BIST_STATUS_REG(EDC_BIST_STATUS_RDATA_A, i) + idx) |
255 | 255 | ||
256 | for (i = 15; i >= 0; i--) | 256 | for (i = 15; i >= 0; i--) |
257 | *data++ = htonl(csio_rd_reg32(hw, EDC_DATA(i))); | 257 | *data++ = htonl(csio_rd_reg32(hw, EDC_DATA(i))); |
@@ -320,13 +320,13 @@ csio_t5_memory_rw(struct csio_hw *hw, u32 win, int mtype, u32 addr, | |||
320 | * the address is relative to BAR0. | 320 | * the address is relative to BAR0. |
321 | */ | 321 | */ |
322 | mem_reg = csio_rd_reg32(hw, | 322 | mem_reg = csio_rd_reg32(hw, |
323 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, win)); | 323 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN_A, win)); |
324 | mem_aperture = 1 << (WINDOW(mem_reg) + 10); | 324 | mem_aperture = 1 << (WINDOW_V(mem_reg) + 10); |
325 | mem_base = GET_PCIEOFST(mem_reg) << 10; | 325 | mem_base = PCIEOFST_G(mem_reg) << 10; |
326 | 326 | ||
327 | start = addr & ~(mem_aperture-1); | 327 | start = addr & ~(mem_aperture-1); |
328 | offset = addr - start; | 328 | offset = addr - start; |
329 | win_pf = V_PFNUM(hw->pfn); | 329 | win_pf = PFNUM_V(hw->pfn); |
330 | 330 | ||
331 | csio_dbg(hw, "csio_t5_memory_rw: mem_reg: 0x%x, mem_aperture: 0x%x\n", | 331 | csio_dbg(hw, "csio_t5_memory_rw: mem_reg: 0x%x, mem_aperture: 0x%x\n", |
332 | mem_reg, mem_aperture); | 332 | mem_reg, mem_aperture); |
@@ -344,9 +344,9 @@ csio_t5_memory_rw(struct csio_hw *hw, u32 win, int mtype, u32 addr, | |||
344 | * before we attempt to use the new value. | 344 | * before we attempt to use the new value. |
345 | */ | 345 | */ |
346 | csio_wr_reg32(hw, pos | win_pf, | 346 | csio_wr_reg32(hw, pos | win_pf, |
347 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_OFFSET, win)); | 347 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_OFFSET_A, win)); |
348 | csio_rd_reg32(hw, | 348 | csio_rd_reg32(hw, |
349 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_OFFSET, win)); | 349 | PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_OFFSET_A, win)); |
350 | 350 | ||
351 | while (offset < mem_aperture && len > 0) { | 351 | while (offset < mem_aperture && len > 0) { |
352 | if (dir) | 352 | if (dir) |