Lines Matching refs:flash

4209 bfa_flash_cb(struct bfa_flash_s *flash)  in bfa_flash_cb()  argument
4211 flash->op_busy = 0; in bfa_flash_cb()
4212 if (flash->cbfn) in bfa_flash_cb()
4213 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
4219 struct bfa_flash_s *flash = cbarg; in bfa_flash_notify() local
4221 bfa_trc(flash, event); in bfa_flash_notify()
4225 if (flash->op_busy) { in bfa_flash_notify()
4226 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
4227 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
4228 flash->op_busy = 0; in bfa_flash_notify()
4245 struct bfa_flash_s *flash = cbarg; in bfa_flash_query_send() local
4247 (struct bfi_flash_query_req_s *) flash->mb.msg; in bfa_flash_query_send()
4250 bfa_ioc_portid(flash->ioc)); in bfa_flash_query_send()
4252 flash->dbuf_pa); in bfa_flash_query_send()
4253 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_query_send()
4262 bfa_flash_write_send(struct bfa_flash_s *flash) in bfa_flash_write_send() argument
4265 (struct bfi_flash_write_req_s *) flash->mb.msg; in bfa_flash_write_send()
4268 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
4269 msg->instance = flash->instance; in bfa_flash_write_send()
4270 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
4271 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
4272 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
4276 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
4279 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
4280 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
4281 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
4282 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_write_send()
4284 flash->residue -= len; in bfa_flash_write_send()
4285 flash->offset += len; in bfa_flash_write_send()
4296 struct bfa_flash_s *flash = cbarg; in bfa_flash_read_send() local
4298 (struct bfi_flash_read_req_s *) flash->mb.msg; in bfa_flash_read_send()
4301 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
4302 msg->instance = flash->instance; in bfa_flash_read_send()
4303 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
4304 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
4305 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
4308 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
4309 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
4310 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_read_send()
4321 struct bfa_flash_s *flash = cbarg; in bfa_flash_erase_send() local
4323 (struct bfi_flash_erase_req_s *) flash->mb.msg; in bfa_flash_erase_send()
4325 msg->type = be32_to_cpu(flash->type); in bfa_flash_erase_send()
4326 msg->instance = flash->instance; in bfa_flash_erase_send()
4328 bfa_ioc_portid(flash->ioc)); in bfa_flash_erase_send()
4329 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_erase_send()
4341 struct bfa_flash_s *flash = flasharg; in bfa_flash_intr() local
4354 bfa_trc(flash, msg->mh.msg_id); in bfa_flash_intr()
4356 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) { in bfa_flash_intr()
4358 bfa_trc(flash, 0x9999); in bfa_flash_intr()
4365 bfa_trc(flash, status); in bfa_flash_intr()
4370 attr = (struct bfa_flash_attr_s *) flash->ubuf; in bfa_flash_intr()
4371 f = (struct bfa_flash_attr_s *) flash->dbuf_kva; in bfa_flash_intr()
4374 bfa_trc(flash, attr->status); in bfa_flash_intr()
4375 bfa_trc(flash, attr->npart); in bfa_flash_intr()
4391 flash->status = status; in bfa_flash_intr()
4392 bfa_flash_cb(flash); in bfa_flash_intr()
4396 bfa_trc(flash, status); in bfa_flash_intr()
4397 flash->status = status; in bfa_flash_intr()
4398 bfa_flash_cb(flash); in bfa_flash_intr()
4402 bfa_trc(flash, status); in bfa_flash_intr()
4403 if (status != BFA_STATUS_OK || 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_trc(flash, flash->offset); in bfa_flash_intr()
4408 bfa_flash_write_send(flash); in bfa_flash_intr()
4413 bfa_trc(flash, status); in bfa_flash_intr()
4415 flash->status = status; in bfa_flash_intr()
4416 bfa_flash_cb(flash); in bfa_flash_intr()
4419 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4420 bfa_trc(flash, len); in bfa_flash_intr()
4421 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
4422 flash->dbuf_kva, len); in bfa_flash_intr()
4423 flash->residue -= len; in bfa_flash_intr()
4424 flash->offset += len; in bfa_flash_intr()
4425 if (flash->residue == 0) { in bfa_flash_intr()
4426 flash->status = status; in bfa_flash_intr()
4427 bfa_flash_cb(flash); in bfa_flash_intr()
4429 bfa_flash_read_send(flash); in bfa_flash_intr()
4436 bfa_trc(flash, status); in bfa_flash_intr()
4438 bfa_ioc_aen_post(flash->ioc, BFA_IOC_AEN_FWCFG_ERROR); in bfa_flash_intr()
4442 bfa_trc(flash, param); in bfa_flash_intr()
4443 bfa_ioc_aen_post(flash->ioc, in bfa_flash_intr()
4477 bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc, void *dev, in bfa_flash_attach() argument
4480 flash->ioc = ioc; in bfa_flash_attach()
4481 flash->trcmod = trcmod; in bfa_flash_attach()
4482 flash->cbfn = NULL; in bfa_flash_attach()
4483 flash->cbarg = NULL; in bfa_flash_attach()
4484 flash->op_busy = 0; in bfa_flash_attach()
4486 bfa_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_flash_attach()
4487 bfa_q_qe_init(&flash->ioc_notify); in bfa_flash_attach()
4488 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_flash_attach()
4489 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_flash_attach()
4493 flash->dbuf_kva = NULL; in bfa_flash_attach()
4494 flash->dbuf_pa = 0; in bfa_flash_attach()
4507 bfa_flash_memclaim(struct bfa_flash_s *flash, u8 *dm_kva, u64 dm_pa, in bfa_flash_memclaim() argument
4513 flash->dbuf_kva = dm_kva; in bfa_flash_memclaim()
4514 flash->dbuf_pa = dm_pa; in bfa_flash_memclaim()
4515 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_flash_memclaim()
4531 bfa_flash_get_attr(struct bfa_flash_s *flash, struct bfa_flash_attr_s *attr, in bfa_flash_get_attr() argument
4534 bfa_trc(flash, BFI_FLASH_H2I_QUERY_REQ); in bfa_flash_get_attr()
4536 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_get_attr()
4539 if (flash->op_busy) { in bfa_flash_get_attr()
4540 bfa_trc(flash, flash->op_busy); in bfa_flash_get_attr()
4544 flash->op_busy = 1; in bfa_flash_get_attr()
4545 flash->cbfn = cbfn; in bfa_flash_get_attr()
4546 flash->cbarg = cbarg; in bfa_flash_get_attr()
4547 flash->ubuf = (u8 *) attr; in bfa_flash_get_attr()
4548 bfa_flash_query_send(flash); in bfa_flash_get_attr()
4565 bfa_flash_erase_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_erase_part() argument
4568 bfa_trc(flash, BFI_FLASH_H2I_ERASE_REQ); in bfa_flash_erase_part()
4569 bfa_trc(flash, type); in bfa_flash_erase_part()
4570 bfa_trc(flash, instance); in bfa_flash_erase_part()
4572 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_erase_part()
4575 if (flash->op_busy) { in bfa_flash_erase_part()
4576 bfa_trc(flash, flash->op_busy); in bfa_flash_erase_part()
4580 flash->op_busy = 1; in bfa_flash_erase_part()
4581 flash->cbfn = cbfn; in bfa_flash_erase_part()
4582 flash->cbarg = cbarg; in bfa_flash_erase_part()
4583 flash->type = type; in bfa_flash_erase_part()
4584 flash->instance = instance; in bfa_flash_erase_part()
4586 bfa_flash_erase_send(flash); in bfa_flash_erase_part()
4587 bfa_flash_aen_audit_post(flash->ioc, BFA_AUDIT_AEN_FLASH_ERASE, in bfa_flash_erase_part()
4607 bfa_flash_update_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_update_part() argument
4611 bfa_trc(flash, BFI_FLASH_H2I_WRITE_REQ); in bfa_flash_update_part()
4612 bfa_trc(flash, type); in bfa_flash_update_part()
4613 bfa_trc(flash, instance); in bfa_flash_update_part()
4614 bfa_trc(flash, len); in bfa_flash_update_part()
4615 bfa_trc(flash, offset); in bfa_flash_update_part()
4617 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_update_part()
4630 if (flash->op_busy) { in bfa_flash_update_part()
4631 bfa_trc(flash, flash->op_busy); in bfa_flash_update_part()
4635 flash->op_busy = 1; in bfa_flash_update_part()
4636 flash->cbfn = cbfn; in bfa_flash_update_part()
4637 flash->cbarg = cbarg; in bfa_flash_update_part()
4638 flash->type = type; in bfa_flash_update_part()
4639 flash->instance = instance; in bfa_flash_update_part()
4640 flash->residue = len; in bfa_flash_update_part()
4641 flash->offset = 0; in bfa_flash_update_part()
4642 flash->addr_off = offset; in bfa_flash_update_part()
4643 flash->ubuf = buf; in bfa_flash_update_part()
4645 bfa_flash_write_send(flash); in bfa_flash_update_part()
4664 bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_read_part() argument
4668 bfa_trc(flash, BFI_FLASH_H2I_READ_REQ); in bfa_flash_read_part()
4669 bfa_trc(flash, type); in bfa_flash_read_part()
4670 bfa_trc(flash, instance); in bfa_flash_read_part()
4671 bfa_trc(flash, len); in bfa_flash_read_part()
4672 bfa_trc(flash, offset); in bfa_flash_read_part()
4674 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_read_part()
4684 if (flash->op_busy) { in bfa_flash_read_part()
4685 bfa_trc(flash, flash->op_busy); in bfa_flash_read_part()
4689 flash->op_busy = 1; in bfa_flash_read_part()
4690 flash->cbfn = cbfn; in bfa_flash_read_part()
4691 flash->cbarg = cbarg; in bfa_flash_read_part()
4692 flash->type = type; in bfa_flash_read_part()
4693 flash->instance = instance; in bfa_flash_read_part()
4694 flash->residue = len; in bfa_flash_read_part()
4695 flash->offset = 0; in bfa_flash_read_part()
4696 flash->addr_off = offset; in bfa_flash_read_part()
4697 flash->ubuf = buf; in bfa_flash_read_part()
4698 bfa_flash_read_send(flash); in bfa_flash_read_part()