Lines Matching refs:ioc
23 static bfa_boolean_t bfa_ioc_cb_firmware_lock(struct bfa_ioc_s *ioc);
24 static void bfa_ioc_cb_firmware_unlock(struct bfa_ioc_s *ioc);
25 static void bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc);
26 static void bfa_ioc_cb_map_port(struct bfa_ioc_s *ioc);
27 static void bfa_ioc_cb_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix);
28 static void bfa_ioc_cb_notify_fail(struct bfa_ioc_s *ioc);
29 static void bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc);
30 static bfa_boolean_t bfa_ioc_cb_sync_start(struct bfa_ioc_s *ioc);
31 static void bfa_ioc_cb_sync_join(struct bfa_ioc_s *ioc);
32 static void bfa_ioc_cb_sync_leave(struct bfa_ioc_s *ioc);
33 static void bfa_ioc_cb_sync_ack(struct bfa_ioc_s *ioc);
34 static bfa_boolean_t bfa_ioc_cb_sync_complete(struct bfa_ioc_s *ioc);
36 struct bfa_ioc_s *ioc, enum bfi_ioc_state fwstate);
37 static enum bfi_ioc_state bfa_ioc_cb_get_cur_ioc_fwstate(struct bfa_ioc_s *ioc);
39 struct bfa_ioc_s *ioc, enum bfi_ioc_state fwstate);
40 static enum bfi_ioc_state bfa_ioc_cb_get_alt_ioc_fwstate(struct bfa_ioc_s *ioc);
48 bfa_ioc_set_cb_hwif(struct bfa_ioc_s *ioc) in bfa_ioc_set_cb_hwif() argument
68 ioc->ioc_hwif = &hwif_cb; in bfa_ioc_set_cb_hwif()
75 bfa_ioc_cb_firmware_lock(struct bfa_ioc_s *ioc) in bfa_ioc_cb_firmware_lock() argument
80 cur_fwstate = bfa_ioc_cb_get_cur_ioc_fwstate(ioc); in bfa_ioc_cb_firmware_lock()
81 bfa_trc(ioc, cur_fwstate); in bfa_ioc_cb_firmware_lock()
82 alt_fwstate = bfa_ioc_cb_get_alt_ioc_fwstate(ioc); in bfa_ioc_cb_firmware_lock()
83 bfa_trc(ioc, alt_fwstate); in bfa_ioc_cb_firmware_lock()
93 bfa_ioc_fwver_get(ioc, &fwhdr); in bfa_ioc_cb_firmware_lock()
94 if (!bfa_ioc_fwver_cmp(ioc, &fwhdr) && in bfa_ioc_cb_firmware_lock()
96 bfa_trc(ioc, alt_fwstate); in bfa_ioc_cb_firmware_lock()
104 bfa_ioc_cb_firmware_unlock(struct bfa_ioc_s *ioc) in bfa_ioc_cb_firmware_unlock() argument
112 bfa_ioc_cb_notify_fail(struct bfa_ioc_s *ioc) in bfa_ioc_cb_notify_fail() argument
114 writel(~0U, ioc->ioc_regs.err_set); in bfa_ioc_cb_notify_fail()
115 readl(ioc->ioc_regs.err_set); in bfa_ioc_cb_notify_fail()
136 bfa_ioc_cb_reg_init(struct bfa_ioc_s *ioc) in bfa_ioc_cb_reg_init() argument
139 int pcifn = bfa_ioc_pcifn(ioc); in bfa_ioc_cb_reg_init()
141 rb = bfa_ioc_bar0(ioc); in bfa_ioc_cb_reg_init()
143 ioc->ioc_regs.hfn_mbox = rb + iocreg_fnreg[pcifn].hfn_mbox; in bfa_ioc_cb_reg_init()
144 ioc->ioc_regs.lpu_mbox = rb + iocreg_fnreg[pcifn].lpu_mbox; in bfa_ioc_cb_reg_init()
145 ioc->ioc_regs.host_page_num_fn = rb + iocreg_fnreg[pcifn].hfn_pgn; in bfa_ioc_cb_reg_init()
147 if (ioc->port_id == 0) { in bfa_ioc_cb_reg_init()
148 ioc->ioc_regs.heartbeat = rb + BFA_IOC0_HBEAT_REG; in bfa_ioc_cb_reg_init()
149 ioc->ioc_regs.ioc_fwstate = rb + BFA_IOC0_STATE_REG; in bfa_ioc_cb_reg_init()
150 ioc->ioc_regs.alt_ioc_fwstate = rb + BFA_IOC1_STATE_REG; in bfa_ioc_cb_reg_init()
152 ioc->ioc_regs.heartbeat = (rb + BFA_IOC1_HBEAT_REG); in bfa_ioc_cb_reg_init()
153 ioc->ioc_regs.ioc_fwstate = (rb + BFA_IOC1_STATE_REG); in bfa_ioc_cb_reg_init()
154 ioc->ioc_regs.alt_ioc_fwstate = (rb + BFA_IOC0_STATE_REG); in bfa_ioc_cb_reg_init()
160 ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd[pcifn].hfn; in bfa_ioc_cb_reg_init()
161 ioc->ioc_regs.lpu_mbox_cmd = rb + iocreg_mbcmd[pcifn].lpu; in bfa_ioc_cb_reg_init()
166 ioc->ioc_regs.pss_ctl_reg = (rb + PSS_CTL_REG); in bfa_ioc_cb_reg_init()
167 ioc->ioc_regs.pss_err_status_reg = (rb + PSS_ERR_STATUS_REG); in bfa_ioc_cb_reg_init()
168 ioc->ioc_regs.app_pll_fast_ctl_reg = (rb + APP_PLL_LCLK_CTL_REG); in bfa_ioc_cb_reg_init()
169 ioc->ioc_regs.app_pll_slow_ctl_reg = (rb + APP_PLL_SCLK_CTL_REG); in bfa_ioc_cb_reg_init()
174 ioc->ioc_regs.ioc_sem_reg = (rb + HOST_SEM0_REG); in bfa_ioc_cb_reg_init()
175 ioc->ioc_regs.ioc_init_sem_reg = (rb + HOST_SEM2_REG); in bfa_ioc_cb_reg_init()
180 ioc->ioc_regs.smem_page_start = (rb + PSS_SMEM_PAGE_START); in bfa_ioc_cb_reg_init()
181 ioc->ioc_regs.smem_pg0 = BFI_IOC_SMEM_PG0_CB; in bfa_ioc_cb_reg_init()
186 ioc->ioc_regs.err_set = (rb + ERR_SET_REG); in bfa_ioc_cb_reg_init()
194 bfa_ioc_cb_map_port(struct bfa_ioc_s *ioc) in bfa_ioc_cb_map_port() argument
199 ioc->port_id = bfa_ioc_pcifn(ioc); in bfa_ioc_cb_map_port()
201 bfa_trc(ioc, ioc->port_id); in bfa_ioc_cb_map_port()
208 bfa_ioc_cb_isr_mode_set(struct bfa_ioc_s *ioc, bfa_boolean_t msix) in bfa_ioc_cb_isr_mode_set() argument
216 bfa_ioc_cb_sync_start(struct bfa_ioc_s *ioc) in bfa_ioc_cb_sync_start() argument
218 u32 ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_sync_start()
227 writel(BFI_IOC_UNINIT, ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_sync_start()
228 writel(BFI_IOC_UNINIT, ioc->ioc_regs.alt_ioc_fwstate); in bfa_ioc_cb_sync_start()
232 return bfa_ioc_cb_sync_complete(ioc); in bfa_ioc_cb_sync_start()
239 bfa_ioc_cb_ownership_reset(struct bfa_ioc_s *ioc) in bfa_ioc_cb_ownership_reset() argument
247 readl(ioc->ioc_regs.ioc_sem_reg); in bfa_ioc_cb_ownership_reset()
248 writel(1, ioc->ioc_regs.ioc_sem_reg); in bfa_ioc_cb_ownership_reset()
255 bfa_ioc_cb_sync_join(struct bfa_ioc_s *ioc) in bfa_ioc_cb_sync_join() argument
257 u32 r32 = readl(ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_sync_join()
258 u32 join_pos = bfa_ioc_cb_join_pos(ioc); in bfa_ioc_cb_sync_join()
260 writel((r32 | join_pos), ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_sync_join()
264 bfa_ioc_cb_sync_leave(struct bfa_ioc_s *ioc) in bfa_ioc_cb_sync_leave() argument
266 u32 r32 = readl(ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_sync_leave()
267 u32 join_pos = bfa_ioc_cb_join_pos(ioc); in bfa_ioc_cb_sync_leave()
269 writel((r32 & ~join_pos), ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_sync_leave()
273 bfa_ioc_cb_set_cur_ioc_fwstate(struct bfa_ioc_s *ioc, in bfa_ioc_cb_set_cur_ioc_fwstate() argument
276 u32 r32 = readl(ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_set_cur_ioc_fwstate()
279 ioc->ioc_regs.ioc_fwstate); in bfa_ioc_cb_set_cur_ioc_fwstate()
283 bfa_ioc_cb_get_cur_ioc_fwstate(struct bfa_ioc_s *ioc) in bfa_ioc_cb_get_cur_ioc_fwstate() argument
285 return (enum bfi_ioc_state)(readl(ioc->ioc_regs.ioc_fwstate) & in bfa_ioc_cb_get_cur_ioc_fwstate()
290 bfa_ioc_cb_set_alt_ioc_fwstate(struct bfa_ioc_s *ioc, in bfa_ioc_cb_set_alt_ioc_fwstate() argument
293 u32 r32 = readl(ioc->ioc_regs.alt_ioc_fwstate); in bfa_ioc_cb_set_alt_ioc_fwstate()
296 ioc->ioc_regs.alt_ioc_fwstate); in bfa_ioc_cb_set_alt_ioc_fwstate()
300 bfa_ioc_cb_get_alt_ioc_fwstate(struct bfa_ioc_s *ioc) in bfa_ioc_cb_get_alt_ioc_fwstate() argument
302 return (enum bfi_ioc_state)(readl(ioc->ioc_regs.alt_ioc_fwstate) & in bfa_ioc_cb_get_alt_ioc_fwstate()
307 bfa_ioc_cb_sync_ack(struct bfa_ioc_s *ioc) in bfa_ioc_cb_sync_ack() argument
309 bfa_ioc_cb_set_cur_ioc_fwstate(ioc, BFI_IOC_FAIL); in bfa_ioc_cb_sync_ack()
313 bfa_ioc_cb_sync_complete(struct bfa_ioc_s *ioc) in bfa_ioc_cb_sync_complete() argument
316 fwstate = bfa_ioc_cb_get_cur_ioc_fwstate(ioc); in bfa_ioc_cb_sync_complete()
344 alt_fwstate = bfa_ioc_cb_get_alt_ioc_fwstate(ioc); in bfa_ioc_cb_sync_complete()