Lines Matching refs:flash
4187 bfa_flash_cb(struct bfa_flash_s *flash) in bfa_flash_cb() argument
4189 flash->op_busy = 0; in bfa_flash_cb()
4190 if (flash->cbfn) in bfa_flash_cb()
4191 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
4197 struct bfa_flash_s *flash = cbarg; in bfa_flash_notify() local
4199 bfa_trc(flash, event); in bfa_flash_notify()
4203 if (flash->op_busy) { in bfa_flash_notify()
4204 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
4205 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
4206 flash->op_busy = 0; in bfa_flash_notify()
4223 struct bfa_flash_s *flash = cbarg; in bfa_flash_query_send() local
4225 (struct bfi_flash_query_req_s *) flash->mb.msg; in bfa_flash_query_send()
4228 bfa_ioc_portid(flash->ioc)); in bfa_flash_query_send()
4230 flash->dbuf_pa); in bfa_flash_query_send()
4231 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_query_send()
4240 bfa_flash_write_send(struct bfa_flash_s *flash) in bfa_flash_write_send() argument
4243 (struct bfi_flash_write_req_s *) flash->mb.msg; in bfa_flash_write_send()
4246 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
4247 msg->instance = flash->instance; in bfa_flash_write_send()
4248 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
4249 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
4250 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
4254 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
4257 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
4258 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
4259 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
4260 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_write_send()
4262 flash->residue -= len; in bfa_flash_write_send()
4263 flash->offset += len; in bfa_flash_write_send()
4274 struct bfa_flash_s *flash = cbarg; in bfa_flash_read_send() local
4276 (struct bfi_flash_read_req_s *) flash->mb.msg; in bfa_flash_read_send()
4279 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
4280 msg->instance = flash->instance; in bfa_flash_read_send()
4281 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
4282 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
4283 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
4286 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
4287 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
4288 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_read_send()
4299 struct bfa_flash_s *flash = cbarg; in bfa_flash_erase_send() local
4301 (struct bfi_flash_erase_req_s *) flash->mb.msg; in bfa_flash_erase_send()
4303 msg->type = be32_to_cpu(flash->type); in bfa_flash_erase_send()
4304 msg->instance = flash->instance; in bfa_flash_erase_send()
4306 bfa_ioc_portid(flash->ioc)); in bfa_flash_erase_send()
4307 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_erase_send()
4319 struct bfa_flash_s *flash = flasharg; in bfa_flash_intr() local
4332 bfa_trc(flash, msg->mh.msg_id); in bfa_flash_intr()
4334 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) { in bfa_flash_intr()
4336 bfa_trc(flash, 0x9999); in bfa_flash_intr()
4343 bfa_trc(flash, status); in bfa_flash_intr()
4348 attr = (struct bfa_flash_attr_s *) flash->ubuf; in bfa_flash_intr()
4349 f = (struct bfa_flash_attr_s *) flash->dbuf_kva; in bfa_flash_intr()
4352 bfa_trc(flash, attr->status); in bfa_flash_intr()
4353 bfa_trc(flash, attr->npart); in bfa_flash_intr()
4369 flash->status = status; in bfa_flash_intr()
4370 bfa_flash_cb(flash); in bfa_flash_intr()
4374 bfa_trc(flash, status); in bfa_flash_intr()
4375 flash->status = status; in bfa_flash_intr()
4376 bfa_flash_cb(flash); in bfa_flash_intr()
4380 bfa_trc(flash, status); in bfa_flash_intr()
4381 if (status != BFA_STATUS_OK || flash->residue == 0) { in bfa_flash_intr()
4382 flash->status = status; in bfa_flash_intr()
4383 bfa_flash_cb(flash); in bfa_flash_intr()
4385 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4386 bfa_flash_write_send(flash); in bfa_flash_intr()
4391 bfa_trc(flash, status); in bfa_flash_intr()
4393 flash->status = status; in bfa_flash_intr()
4394 bfa_flash_cb(flash); in bfa_flash_intr()
4397 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4398 bfa_trc(flash, len); in bfa_flash_intr()
4399 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
4400 flash->dbuf_kva, len); in bfa_flash_intr()
4401 flash->residue -= len; in bfa_flash_intr()
4402 flash->offset += len; in bfa_flash_intr()
4403 if (flash->residue == 0) { in bfa_flash_intr()
4404 flash->status = status; in bfa_flash_intr()
4405 bfa_flash_cb(flash); in bfa_flash_intr()
4407 bfa_flash_read_send(flash); in bfa_flash_intr()
4414 bfa_trc(flash, status); in bfa_flash_intr()
4416 bfa_ioc_aen_post(flash->ioc, BFA_IOC_AEN_FWCFG_ERROR); in bfa_flash_intr()
4420 bfa_trc(flash, param); in bfa_flash_intr()
4421 bfa_ioc_aen_post(flash->ioc, in bfa_flash_intr()
4455 bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc, void *dev, in bfa_flash_attach() argument
4458 flash->ioc = ioc; in bfa_flash_attach()
4459 flash->trcmod = trcmod; in bfa_flash_attach()
4460 flash->cbfn = NULL; in bfa_flash_attach()
4461 flash->cbarg = NULL; in bfa_flash_attach()
4462 flash->op_busy = 0; in bfa_flash_attach()
4464 bfa_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_flash_attach()
4465 bfa_q_qe_init(&flash->ioc_notify); in bfa_flash_attach()
4466 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_flash_attach()
4467 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_flash_attach()
4471 flash->dbuf_kva = NULL; in bfa_flash_attach()
4472 flash->dbuf_pa = 0; in bfa_flash_attach()
4485 bfa_flash_memclaim(struct bfa_flash_s *flash, u8 *dm_kva, u64 dm_pa, in bfa_flash_memclaim() argument
4491 flash->dbuf_kva = dm_kva; in bfa_flash_memclaim()
4492 flash->dbuf_pa = dm_pa; in bfa_flash_memclaim()
4493 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_flash_memclaim()
4509 bfa_flash_get_attr(struct bfa_flash_s *flash, struct bfa_flash_attr_s *attr, in bfa_flash_get_attr() argument
4512 bfa_trc(flash, BFI_FLASH_H2I_QUERY_REQ); in bfa_flash_get_attr()
4514 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_get_attr()
4517 if (flash->op_busy) { in bfa_flash_get_attr()
4518 bfa_trc(flash, flash->op_busy); in bfa_flash_get_attr()
4522 flash->op_busy = 1; in bfa_flash_get_attr()
4523 flash->cbfn = cbfn; in bfa_flash_get_attr()
4524 flash->cbarg = cbarg; in bfa_flash_get_attr()
4525 flash->ubuf = (u8 *) attr; in bfa_flash_get_attr()
4526 bfa_flash_query_send(flash); in bfa_flash_get_attr()
4543 bfa_flash_erase_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_erase_part() argument
4546 bfa_trc(flash, BFI_FLASH_H2I_ERASE_REQ); in bfa_flash_erase_part()
4547 bfa_trc(flash, type); in bfa_flash_erase_part()
4548 bfa_trc(flash, instance); in bfa_flash_erase_part()
4550 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_erase_part()
4553 if (flash->op_busy) { in bfa_flash_erase_part()
4554 bfa_trc(flash, flash->op_busy); in bfa_flash_erase_part()
4558 flash->op_busy = 1; in bfa_flash_erase_part()
4559 flash->cbfn = cbfn; in bfa_flash_erase_part()
4560 flash->cbarg = cbarg; in bfa_flash_erase_part()
4561 flash->type = type; in bfa_flash_erase_part()
4562 flash->instance = instance; in bfa_flash_erase_part()
4564 bfa_flash_erase_send(flash); in bfa_flash_erase_part()
4565 bfa_flash_aen_audit_post(flash->ioc, BFA_AUDIT_AEN_FLASH_ERASE, in bfa_flash_erase_part()
4585 bfa_flash_update_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_update_part() argument
4589 bfa_trc(flash, BFI_FLASH_H2I_WRITE_REQ); in bfa_flash_update_part()
4590 bfa_trc(flash, type); in bfa_flash_update_part()
4591 bfa_trc(flash, instance); in bfa_flash_update_part()
4592 bfa_trc(flash, len); in bfa_flash_update_part()
4593 bfa_trc(flash, offset); in bfa_flash_update_part()
4595 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_update_part()
4608 if (flash->op_busy) { in bfa_flash_update_part()
4609 bfa_trc(flash, flash->op_busy); in bfa_flash_update_part()
4613 flash->op_busy = 1; in bfa_flash_update_part()
4614 flash->cbfn = cbfn; in bfa_flash_update_part()
4615 flash->cbarg = cbarg; in bfa_flash_update_part()
4616 flash->type = type; in bfa_flash_update_part()
4617 flash->instance = instance; in bfa_flash_update_part()
4618 flash->residue = len; in bfa_flash_update_part()
4619 flash->offset = 0; in bfa_flash_update_part()
4620 flash->addr_off = offset; in bfa_flash_update_part()
4621 flash->ubuf = buf; in bfa_flash_update_part()
4623 bfa_flash_write_send(flash); in bfa_flash_update_part()
4642 bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_read_part() argument
4646 bfa_trc(flash, BFI_FLASH_H2I_READ_REQ); in bfa_flash_read_part()
4647 bfa_trc(flash, type); in bfa_flash_read_part()
4648 bfa_trc(flash, instance); in bfa_flash_read_part()
4649 bfa_trc(flash, len); in bfa_flash_read_part()
4650 bfa_trc(flash, offset); in bfa_flash_read_part()
4652 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_read_part()
4662 if (flash->op_busy) { in bfa_flash_read_part()
4663 bfa_trc(flash, flash->op_busy); in bfa_flash_read_part()
4667 flash->op_busy = 1; in bfa_flash_read_part()
4668 flash->cbfn = cbfn; in bfa_flash_read_part()
4669 flash->cbarg = cbarg; in bfa_flash_read_part()
4670 flash->type = type; in bfa_flash_read_part()
4671 flash->instance = instance; in bfa_flash_read_part()
4672 flash->residue = len; in bfa_flash_read_part()
4673 flash->offset = 0; in bfa_flash_read_part()
4674 flash->addr_off = offset; in bfa_flash_read_part()
4675 flash->ubuf = buf; in bfa_flash_read_part()
4676 bfa_flash_read_send(flash); in bfa_flash_read_part()