diff options
Diffstat (limited to 'drivers/scsi/bfa/bfa_ioc_ct.c')
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc_ct.c | 167 |
1 files changed, 81 insertions, 86 deletions
diff --git a/drivers/scsi/bfa/bfa_ioc_ct.c b/drivers/scsi/bfa/bfa_ioc_ct.c index f21b82c5f64..115730c0aa7 100644 --- a/drivers/scsi/bfa/bfa_ioc_ct.c +++ b/drivers/scsi/bfa/bfa_ioc_ct.c | |||
@@ -34,7 +34,7 @@ static void bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc); | |||
34 | 34 | ||
35 | struct bfa_ioc_hwif_s hwif_ct; | 35 | struct bfa_ioc_hwif_s hwif_ct; |
36 | 36 | ||
37 | /** | 37 | /* |
38 | * Called from bfa_ioc_attach() to map asic specific calls. | 38 | * Called from bfa_ioc_attach() to map asic specific calls. |
39 | */ | 39 | */ |
40 | void | 40 | void |
@@ -52,7 +52,7 @@ bfa_ioc_set_ct_hwif(struct bfa_ioc_s *ioc) | |||
52 | ioc->ioc_hwif = &hwif_ct; | 52 | ioc->ioc_hwif = &hwif_ct; |
53 | } | 53 | } |
54 | 54 | ||
55 | /** | 55 | /* |
56 | * Return true if firmware of current driver matches the running firmware. | 56 | * Return true if firmware of current driver matches the running firmware. |
57 | */ | 57 | */ |
58 | static bfa_boolean_t | 58 | static bfa_boolean_t |
@@ -62,13 +62,13 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
62 | u32 usecnt; | 62 | u32 usecnt; |
63 | struct bfi_ioc_image_hdr_s fwhdr; | 63 | struct bfi_ioc_image_hdr_s fwhdr; |
64 | 64 | ||
65 | /** | 65 | /* |
66 | * Firmware match check is relevant only for CNA. | 66 | * Firmware match check is relevant only for CNA. |
67 | */ | 67 | */ |
68 | if (!ioc->cna) | 68 | if (!ioc->cna) |
69 | return BFA_TRUE; | 69 | return BFA_TRUE; |
70 | 70 | ||
71 | /** | 71 | /* |
72 | * If bios boot (flash based) -- do not increment usage count | 72 | * If bios boot (flash based) -- do not increment usage count |
73 | */ | 73 | */ |
74 | if (bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)) < | 74 | if (bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)) < |
@@ -76,27 +76,27 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
76 | return BFA_TRUE; | 76 | return BFA_TRUE; |
77 | 77 | ||
78 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 78 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
79 | usecnt = bfa_reg_read(ioc->ioc_regs.ioc_usage_reg); | 79 | usecnt = readl(ioc->ioc_regs.ioc_usage_reg); |
80 | 80 | ||
81 | /** | 81 | /* |
82 | * If usage count is 0, always return TRUE. | 82 | * If usage count is 0, always return TRUE. |
83 | */ | 83 | */ |
84 | if (usecnt == 0) { | 84 | if (usecnt == 0) { |
85 | bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, 1); | 85 | writel(1, ioc->ioc_regs.ioc_usage_reg); |
86 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); | 86 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); |
87 | bfa_trc(ioc, usecnt); | 87 | bfa_trc(ioc, usecnt); |
88 | return BFA_TRUE; | 88 | return BFA_TRUE; |
89 | } | 89 | } |
90 | 90 | ||
91 | ioc_fwstate = bfa_reg_read(ioc->ioc_regs.ioc_fwstate); | 91 | ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate); |
92 | bfa_trc(ioc, ioc_fwstate); | 92 | bfa_trc(ioc, ioc_fwstate); |
93 | 93 | ||
94 | /** | 94 | /* |
95 | * Use count cannot be non-zero and chip in uninitialized state. | 95 | * Use count cannot be non-zero and chip in uninitialized state. |
96 | */ | 96 | */ |
97 | bfa_assert(ioc_fwstate != BFI_IOC_UNINIT); | 97 | bfa_assert(ioc_fwstate != BFI_IOC_UNINIT); |
98 | 98 | ||
99 | /** | 99 | /* |
100 | * Check if another driver with a different firmware is active | 100 | * Check if another driver with a different firmware is active |
101 | */ | 101 | */ |
102 | bfa_ioc_fwver_get(ioc, &fwhdr); | 102 | bfa_ioc_fwver_get(ioc, &fwhdr); |
@@ -106,11 +106,11 @@ bfa_ioc_ct_firmware_lock(struct bfa_ioc_s *ioc) | |||
106 | return BFA_FALSE; | 106 | return BFA_FALSE; |
107 | } | 107 | } |
108 | 108 | ||
109 | /** | 109 | /* |
110 | * Same firmware version. Increment the reference count. | 110 | * Same firmware version. Increment the reference count. |
111 | */ | 111 | */ |
112 | usecnt++; | 112 | usecnt++; |
113 | bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, usecnt); | 113 | writel(usecnt, ioc->ioc_regs.ioc_usage_reg); |
114 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); | 114 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); |
115 | bfa_trc(ioc, usecnt); | 115 | bfa_trc(ioc, usecnt); |
116 | return BFA_TRUE; | 116 | return BFA_TRUE; |
@@ -121,50 +121,50 @@ bfa_ioc_ct_firmware_unlock(struct bfa_ioc_s *ioc) | |||
121 | { | 121 | { |
122 | u32 usecnt; | 122 | u32 usecnt; |
123 | 123 | ||
124 | /** | 124 | /* |
125 | * Firmware lock is relevant only for CNA. | 125 | * Firmware lock is relevant only for CNA. |
126 | */ | 126 | */ |
127 | if (!ioc->cna) | 127 | if (!ioc->cna) |
128 | return; | 128 | return; |
129 | 129 | ||
130 | /** | 130 | /* |
131 | * If bios boot (flash based) -- do not decrement usage count | 131 | * If bios boot (flash based) -- do not decrement usage count |
132 | */ | 132 | */ |
133 | if (bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)) < | 133 | if (bfa_cb_image_get_size(BFA_IOC_FWIMG_TYPE(ioc)) < |
134 | BFA_IOC_FWIMG_MINSZ) | 134 | BFA_IOC_FWIMG_MINSZ) |
135 | return; | 135 | return; |
136 | 136 | ||
137 | /** | 137 | /* |
138 | * decrement usage count | 138 | * decrement usage count |
139 | */ | 139 | */ |
140 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 140 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
141 | usecnt = bfa_reg_read(ioc->ioc_regs.ioc_usage_reg); | 141 | usecnt = readl(ioc->ioc_regs.ioc_usage_reg); |
142 | bfa_assert(usecnt > 0); | 142 | bfa_assert(usecnt > 0); |
143 | 143 | ||
144 | usecnt--; | 144 | usecnt--; |
145 | bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, usecnt); | 145 | writel(usecnt, ioc->ioc_regs.ioc_usage_reg); |
146 | bfa_trc(ioc, usecnt); | 146 | bfa_trc(ioc, usecnt); |
147 | 147 | ||
148 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); | 148 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); |
149 | } | 149 | } |
150 | 150 | ||
151 | /** | 151 | /* |
152 | * Notify other functions on HB failure. | 152 | * Notify other functions on HB failure. |
153 | */ | 153 | */ |
154 | static void | 154 | static void |
155 | bfa_ioc_ct_notify_hbfail(struct bfa_ioc_s *ioc) | 155 | bfa_ioc_ct_notify_hbfail(struct bfa_ioc_s *ioc) |
156 | { | 156 | { |
157 | if (ioc->cna) { | 157 | if (ioc->cna) { |
158 | bfa_reg_write(ioc->ioc_regs.ll_halt, __FW_INIT_HALT_P); | 158 | writel(__FW_INIT_HALT_P, ioc->ioc_regs.ll_halt); |
159 | /* Wait for halt to take effect */ | 159 | /* Wait for halt to take effect */ |
160 | bfa_reg_read(ioc->ioc_regs.ll_halt); | 160 | readl(ioc->ioc_regs.ll_halt); |
161 | } else { | 161 | } else { |
162 | bfa_reg_write(ioc->ioc_regs.err_set, __PSS_ERR_STATUS_SET); | 162 | writel(__PSS_ERR_STATUS_SET, ioc->ioc_regs.err_set); |
163 | bfa_reg_read(ioc->ioc_regs.err_set); | 163 | readl(ioc->ioc_regs.err_set); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | /** | 167 | /* |
168 | * Host to LPU mailbox message addresses | 168 | * Host to LPU mailbox message addresses |
169 | */ | 169 | */ |
170 | static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = { | 170 | static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = { |
@@ -174,7 +174,7 @@ static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = { | |||
174 | { HOSTFN3_LPU_MBOX0_8, LPU_HOSTFN3_MBOX0_8, HOST_PAGE_NUM_FN3 } | 174 | { HOSTFN3_LPU_MBOX0_8, LPU_HOSTFN3_MBOX0_8, HOST_PAGE_NUM_FN3 } |
175 | }; | 175 | }; |
176 | 176 | ||
177 | /** | 177 | /* |
178 | * Host <-> LPU mailbox command/status registers - port 0 | 178 | * Host <-> LPU mailbox command/status registers - port 0 |
179 | */ | 179 | */ |
180 | static struct { u32 hfn, lpu; } iocreg_mbcmd_p0[] = { | 180 | static struct { u32 hfn, lpu; } iocreg_mbcmd_p0[] = { |
@@ -184,7 +184,7 @@ static struct { u32 hfn, lpu; } iocreg_mbcmd_p0[] = { | |||
184 | { HOSTFN3_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN3_MBOX0_CMD_STAT } | 184 | { HOSTFN3_LPU0_MBOX0_CMD_STAT, LPU0_HOSTFN3_MBOX0_CMD_STAT } |
185 | }; | 185 | }; |
186 | 186 | ||
187 | /** | 187 | /* |
188 | * Host <-> LPU mailbox command/status registers - port 1 | 188 | * Host <-> LPU mailbox command/status registers - port 1 |
189 | */ | 189 | */ |
190 | static struct { u32 hfn, lpu; } iocreg_mbcmd_p1[] = { | 190 | static struct { u32 hfn, lpu; } iocreg_mbcmd_p1[] = { |
@@ -197,7 +197,7 @@ static struct { u32 hfn, lpu; } iocreg_mbcmd_p1[] = { | |||
197 | static void | 197 | static void |
198 | bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc) | 198 | bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc) |
199 | { | 199 | { |
200 | bfa_os_addr_t rb; | 200 | void __iomem *rb; |
201 | int pcifn = bfa_ioc_pcifn(ioc); | 201 | int pcifn = bfa_ioc_pcifn(ioc); |
202 | 202 | ||
203 | rb = bfa_ioc_bar0(ioc); | 203 | rb = bfa_ioc_bar0(ioc); |
@@ -236,7 +236,7 @@ bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc) | |||
236 | ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG); | 236 | ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG); |
237 | ioc->ioc_regs.ioc_usage_reg = (rb + BFA_FW_USE_COUNT); | 237 | ioc->ioc_regs.ioc_usage_reg = (rb + BFA_FW_USE_COUNT); |
238 | 238 | ||
239 | /** | 239 | /* |
240 | * sram memory access | 240 | * sram memory access |
241 | */ | 241 | */ |
242 | ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START); | 242 | ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START); |
@@ -248,7 +248,7 @@ bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc) | |||
248 | ioc->ioc_regs.err_set = (rb + ERR_SET_REG); | 248 | ioc->ioc_regs.err_set = (rb + ERR_SET_REG); |
249 | } | 249 | } |
250 | 250 | ||
251 | /** | 251 | /* |
252 | * Initialize IOC to port mapping. | 252 | * Initialize IOC to port mapping. |
253 | */ | 253 | */ |
254 | 254 | ||
@@ -256,13 +256,13 @@ bfa_ioc_ct_reg_init(struct bfa_ioc_s *ioc) | |||
256 | static void | 256 | static void |
257 | bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc) | 257 | bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc) |
258 | { | 258 | { |
259 | bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva; | 259 | void __iomem *rb = ioc->pcidev.pci_bar_kva; |
260 | u32 r32; | 260 | u32 r32; |
261 | 261 | ||
262 | /** | 262 | /* |
263 | * For catapult, base port id on personality register and IOC type | 263 | * For catapult, base port id on personality register and IOC type |
264 | */ | 264 | */ |
265 | r32 = bfa_reg_read(rb + FNC_PERS_REG); | 265 | r32 = readl(rb + FNC_PERS_REG); |
266 | r32 >>= FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc)); | 266 | r32 >>= FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc)); |
267 | ioc->port_id = (r32 & __F0_PORT_MAP_MK) >> __F0_PORT_MAP_SH; | 267 | ioc->port_id = (r32 & __F0_PORT_MAP_MK) >> __F0_PORT_MAP_SH; |
268 | 268 | ||
@@ -270,22 +270,22 @@ bfa_ioc_ct_map_port(struct bfa_ioc_s *ioc) | |||
270 | bfa_trc(ioc, ioc->port_id); | 270 | bfa_trc(ioc, ioc->port_id); |
271 | } | 271 | } |
272 | 272 | ||
273 | /** | 273 | /* |
274 | * Set interrupt mode for a function: INTX or MSIX | 274 | * Set interrupt mode for a function: INTX or MSIX |
275 | */ | 275 | */ |
276 | static void | 276 | static void |
277 | bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix) | 277 | bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix) |
278 | { | 278 | { |
279 | bfa_os_addr_t rb = ioc->pcidev.pci_bar_kva; | 279 | void __iomem *rb = ioc->pcidev.pci_bar_kva; |
280 | u32 r32, mode; | 280 | u32 r32, mode; |
281 | 281 | ||
282 | r32 = bfa_reg_read(rb + FNC_PERS_REG); | 282 | r32 = readl(rb + FNC_PERS_REG); |
283 | bfa_trc(ioc, r32); | 283 | bfa_trc(ioc, r32); |
284 | 284 | ||
285 | mode = (r32 >> FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc))) & | 285 | mode = (r32 >> FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc))) & |
286 | __F0_INTX_STATUS; | 286 | __F0_INTX_STATUS; |
287 | 287 | ||
288 | /** | 288 | /* |
289 | * If already in desired mode, do not change anything | 289 | * If already in desired mode, do not change anything |
290 | */ | 290 | */ |
291 | if (!msix && mode) | 291 | if (!msix && mode) |
@@ -300,10 +300,10 @@ bfa_ioc_ct_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix) | |||
300 | r32 |= (mode << FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc))); | 300 | r32 |= (mode << FNC_PERS_FN_SHIFT(bfa_ioc_pcifn(ioc))); |
301 | bfa_trc(ioc, r32); | 301 | bfa_trc(ioc, r32); |
302 | 302 | ||
303 | bfa_reg_write(rb + FNC_PERS_REG, r32); | 303 | writel(r32, rb + FNC_PERS_REG); |
304 | } | 304 | } |
305 | 305 | ||
306 | /** | 306 | /* |
307 | * Cleanup hw semaphore and usecnt registers | 307 | * Cleanup hw semaphore and usecnt registers |
308 | */ | 308 | */ |
309 | static void | 309 | static void |
@@ -312,7 +312,7 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) | |||
312 | 312 | ||
313 | if (ioc->cna) { | 313 | if (ioc->cna) { |
314 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); | 314 | bfa_ioc_sem_get(ioc->ioc_regs.ioc_usage_sem_reg); |
315 | bfa_reg_write(ioc->ioc_regs.ioc_usage_reg, 0); | 315 | writel(0, ioc->ioc_regs.ioc_usage_reg); |
316 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); | 316 | bfa_ioc_sem_release(ioc->ioc_regs.ioc_usage_sem_reg); |
317 | } | 317 | } |
318 | 318 | ||
@@ -321,7 +321,7 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) | |||
321 | * before we clear it. If it is not locked, writing 1 | 321 | * before we clear it. If it is not locked, writing 1 |
322 | * will lock it instead of clearing it. | 322 | * will lock it instead of clearing it. |
323 | */ | 323 | */ |
324 | bfa_reg_read(ioc->ioc_regs.ioc_sem_reg); | 324 | readl(ioc->ioc_regs.ioc_sem_reg); |
325 | bfa_ioc_hw_sem_release(ioc); | 325 | bfa_ioc_hw_sem_release(ioc); |
326 | } | 326 | } |
327 | 327 | ||
@@ -331,17 +331,17 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc_s *ioc) | |||
331 | * Check the firmware state to know if pll_init has been completed already | 331 | * Check the firmware state to know if pll_init has been completed already |
332 | */ | 332 | */ |
333 | bfa_boolean_t | 333 | bfa_boolean_t |
334 | bfa_ioc_ct_pll_init_complete(bfa_os_addr_t rb) | 334 | bfa_ioc_ct_pll_init_complete(void __iomem *rb) |
335 | { | 335 | { |
336 | if ((bfa_reg_read(rb + BFA_IOC0_STATE_REG) == BFI_IOC_OP) || | 336 | if ((readl(rb + BFA_IOC0_STATE_REG) == BFI_IOC_OP) || |
337 | (bfa_reg_read(rb + BFA_IOC1_STATE_REG) == BFI_IOC_OP)) | 337 | (readl(rb + BFA_IOC1_STATE_REG) == BFI_IOC_OP)) |
338 | return BFA_TRUE; | 338 | return BFA_TRUE; |
339 | 339 | ||
340 | return BFA_FALSE; | 340 | return BFA_FALSE; |
341 | } | 341 | } |
342 | 342 | ||
343 | bfa_status_t | 343 | bfa_status_t |
344 | bfa_ioc_ct_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode) | 344 | bfa_ioc_ct_pll_init(void __iomem *rb, bfa_boolean_t fcmode) |
345 | { | 345 | { |
346 | u32 pll_sclk, pll_fclk, r32; | 346 | u32 pll_sclk, pll_fclk, r32; |
347 | 347 | ||
@@ -354,56 +354,51 @@ bfa_ioc_ct_pll_init(bfa_os_addr_t rb, bfa_boolean_t fcmode) | |||
354 | __APP_PLL_425_JITLMT0_1(3U) | | 354 | __APP_PLL_425_JITLMT0_1(3U) | |
355 | __APP_PLL_425_CNTLMT0_1(1U); | 355 | __APP_PLL_425_CNTLMT0_1(1U); |
356 | if (fcmode) { | 356 | if (fcmode) { |
357 | bfa_reg_write((rb + OP_MODE), 0); | 357 | writel(0, (rb + OP_MODE)); |
358 | bfa_reg_write((rb + ETH_MAC_SER_REG), | 358 | writel(__APP_EMS_CMLCKSEL | __APP_EMS_REFCKBUFEN2 | |
359 | __APP_EMS_CMLCKSEL | | 359 | __APP_EMS_CHANNEL_SEL, (rb + ETH_MAC_SER_REG)); |
360 | __APP_EMS_REFCKBUFEN2 | | ||
361 | __APP_EMS_CHANNEL_SEL); | ||
362 | } else { | 360 | } else { |
363 | bfa_reg_write((rb + OP_MODE), __GLOBAL_FCOE_MODE); | 361 | writel(__GLOBAL_FCOE_MODE, (rb + OP_MODE)); |
364 | bfa_reg_write((rb + ETH_MAC_SER_REG), | 362 | writel(__APP_EMS_REFCKBUFEN1, (rb + ETH_MAC_SER_REG)); |
365 | __APP_EMS_REFCKBUFEN1); | ||
366 | } | 363 | } |
367 | bfa_reg_write((rb + BFA_IOC0_STATE_REG), BFI_IOC_UNINIT); | 364 | writel(BFI_IOC_UNINIT, (rb + BFA_IOC0_STATE_REG)); |
368 | bfa_reg_write((rb + BFA_IOC1_STATE_REG), BFI_IOC_UNINIT); | 365 | writel(BFI_IOC_UNINIT, (rb + BFA_IOC1_STATE_REG)); |
369 | bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU); | 366 | writel(0xffffffffU, (rb + HOSTFN0_INT_MSK)); |
370 | bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU); | 367 | writel(0xffffffffU, (rb + HOSTFN1_INT_MSK)); |
371 | bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU); | 368 | writel(0xffffffffU, (rb + HOSTFN0_INT_STATUS)); |
372 | bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU); | 369 | writel(0xffffffffU, (rb + HOSTFN1_INT_STATUS)); |
373 | bfa_reg_write((rb + HOSTFN0_INT_MSK), 0xffffffffU); | 370 | writel(0xffffffffU, (rb + HOSTFN0_INT_MSK)); |
374 | bfa_reg_write((rb + HOSTFN1_INT_MSK), 0xffffffffU); | 371 | writel(0xffffffffU, (rb + HOSTFN1_INT_MSK)); |
375 | bfa_reg_write(rb + APP_PLL_312_CTL_REG, pll_sclk | | 372 | writel(pll_sclk | __APP_PLL_312_LOGIC_SOFT_RESET, |
376 | __APP_PLL_312_LOGIC_SOFT_RESET); | 373 | rb + APP_PLL_312_CTL_REG); |
377 | bfa_reg_write(rb + APP_PLL_425_CTL_REG, pll_fclk | | 374 | writel(pll_fclk | __APP_PLL_425_LOGIC_SOFT_RESET, |
378 | __APP_PLL_425_LOGIC_SOFT_RESET); | 375 | rb + APP_PLL_425_CTL_REG); |
379 | bfa_reg_write(rb + APP_PLL_312_CTL_REG, pll_sclk | | 376 | writel(pll_sclk | __APP_PLL_312_LOGIC_SOFT_RESET | __APP_PLL_312_ENABLE, |
380 | __APP_PLL_312_LOGIC_SOFT_RESET | __APP_PLL_312_ENABLE); | 377 | rb + APP_PLL_312_CTL_REG); |
381 | bfa_reg_write(rb + APP_PLL_425_CTL_REG, pll_fclk | | 378 | writel(pll_fclk | __APP_PLL_425_LOGIC_SOFT_RESET | __APP_PLL_425_ENABLE, |
382 | __APP_PLL_425_LOGIC_SOFT_RESET | __APP_PLL_425_ENABLE); | 379 | rb + APP_PLL_425_CTL_REG); |
383 | bfa_reg_read(rb + HOSTFN0_INT_MSK); | 380 | readl(rb + HOSTFN0_INT_MSK); |
384 | bfa_os_udelay(2000); | 381 | udelay(2000); |
385 | bfa_reg_write((rb + HOSTFN0_INT_STATUS), 0xffffffffU); | 382 | writel(0xffffffffU, (rb + HOSTFN0_INT_STATUS)); |
386 | bfa_reg_write((rb + HOSTFN1_INT_STATUS), 0xffffffffU); | 383 | writel(0xffffffffU, (rb + HOSTFN1_INT_STATUS)); |
387 | bfa_reg_write(rb + APP_PLL_312_CTL_REG, pll_sclk | | 384 | writel(pll_sclk | __APP_PLL_312_ENABLE, rb + APP_PLL_312_CTL_REG); |
388 | __APP_PLL_312_ENABLE); | 385 | writel(pll_fclk | __APP_PLL_425_ENABLE, rb + APP_PLL_425_CTL_REG); |
389 | bfa_reg_write(rb + APP_PLL_425_CTL_REG, pll_fclk | | ||
390 | __APP_PLL_425_ENABLE); | ||
391 | if (!fcmode) { | 386 | if (!fcmode) { |
392 | bfa_reg_write((rb + PMM_1T_RESET_REG_P0), __PMM_1T_RESET_P); | 387 | writel(__PMM_1T_RESET_P, (rb + PMM_1T_RESET_REG_P0)); |
393 | bfa_reg_write((rb + PMM_1T_RESET_REG_P1), __PMM_1T_RESET_P); | 388 | writel(__PMM_1T_RESET_P, (rb + PMM_1T_RESET_REG_P1)); |
394 | } | 389 | } |
395 | r32 = bfa_reg_read((rb + PSS_CTL_REG)); | 390 | r32 = readl((rb + PSS_CTL_REG)); |
396 | r32 &= ~__PSS_LMEM_RESET; | 391 | r32 &= ~__PSS_LMEM_RESET; |
397 | bfa_reg_write((rb + PSS_CTL_REG), r32); | 392 | writel(r32, (rb + PSS_CTL_REG)); |
398 | bfa_os_udelay(1000); | 393 | udelay(1000); |
399 | if (!fcmode) { | 394 | if (!fcmode) { |
400 | bfa_reg_write((rb + PMM_1T_RESET_REG_P0), 0); | 395 | writel(0, (rb + PMM_1T_RESET_REG_P0)); |
401 | bfa_reg_write((rb + PMM_1T_RESET_REG_P1), 0); | 396 | writel(0, (rb + PMM_1T_RESET_REG_P1)); |
402 | } | 397 | } |
403 | 398 | ||
404 | bfa_reg_write((rb + MBIST_CTL_REG), __EDRAM_BISTR_START); | 399 | writel(__EDRAM_BISTR_START, (rb + MBIST_CTL_REG)); |
405 | bfa_os_udelay(1000); | 400 | udelay(1000); |
406 | r32 = bfa_reg_read((rb + MBIST_STAT_REG)); | 401 | r32 = readl((rb + MBIST_STAT_REG)); |
407 | bfa_reg_write((rb + MBIST_CTL_REG), 0); | 402 | writel(0, (rb + MBIST_CTL_REG)); |
408 | return BFA_STATUS_OK; | 403 | return BFA_STATUS_OK; |
409 | } | 404 | } |