Lines Matching refs:flash
4222 bfa_flash_cb(struct bfa_flash_s *flash) in bfa_flash_cb() argument
4224 flash->op_busy = 0; in bfa_flash_cb()
4225 if (flash->cbfn) in bfa_flash_cb()
4226 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
4232 struct bfa_flash_s *flash = cbarg; in bfa_flash_notify() local
4234 bfa_trc(flash, event); in bfa_flash_notify()
4238 if (flash->op_busy) { in bfa_flash_notify()
4239 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
4240 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
4241 flash->op_busy = 0; in bfa_flash_notify()
4258 struct bfa_flash_s *flash = cbarg; in bfa_flash_query_send() local
4260 (struct bfi_flash_query_req_s *) flash->mb.msg; in bfa_flash_query_send()
4263 bfa_ioc_portid(flash->ioc)); in bfa_flash_query_send()
4265 flash->dbuf_pa); in bfa_flash_query_send()
4266 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_query_send()
4275 bfa_flash_write_send(struct bfa_flash_s *flash) in bfa_flash_write_send() argument
4278 (struct bfi_flash_write_req_s *) flash->mb.msg; in bfa_flash_write_send()
4281 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
4282 msg->instance = flash->instance; in bfa_flash_write_send()
4283 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
4284 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
4285 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
4289 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
4292 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
4293 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
4294 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
4295 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_write_send()
4297 flash->residue -= len; in bfa_flash_write_send()
4298 flash->offset += len; in bfa_flash_write_send()
4309 struct bfa_flash_s *flash = cbarg; in bfa_flash_read_send() local
4311 (struct bfi_flash_read_req_s *) flash->mb.msg; in bfa_flash_read_send()
4314 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
4315 msg->instance = flash->instance; in bfa_flash_read_send()
4316 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
4317 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
4318 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
4321 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
4322 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
4323 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_read_send()
4334 struct bfa_flash_s *flash = cbarg; in bfa_flash_erase_send() local
4336 (struct bfi_flash_erase_req_s *) flash->mb.msg; in bfa_flash_erase_send()
4338 msg->type = be32_to_cpu(flash->type); in bfa_flash_erase_send()
4339 msg->instance = flash->instance; in bfa_flash_erase_send()
4341 bfa_ioc_portid(flash->ioc)); in bfa_flash_erase_send()
4342 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_erase_send()
4354 struct bfa_flash_s *flash = flasharg; in bfa_flash_intr() local
4367 bfa_trc(flash, msg->mh.msg_id); in bfa_flash_intr()
4369 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) { in bfa_flash_intr()
4371 bfa_trc(flash, 0x9999); in bfa_flash_intr()
4378 bfa_trc(flash, status); in bfa_flash_intr()
4383 attr = (struct bfa_flash_attr_s *) flash->ubuf; in bfa_flash_intr()
4384 f = (struct bfa_flash_attr_s *) flash->dbuf_kva; in bfa_flash_intr()
4387 bfa_trc(flash, attr->status); in bfa_flash_intr()
4388 bfa_trc(flash, attr->npart); in bfa_flash_intr()
4404 flash->status = status; in bfa_flash_intr()
4405 bfa_flash_cb(flash); in bfa_flash_intr()
4409 bfa_trc(flash, status); in bfa_flash_intr()
4410 flash->status = status; in bfa_flash_intr()
4411 bfa_flash_cb(flash); in bfa_flash_intr()
4415 bfa_trc(flash, status); in bfa_flash_intr()
4416 if (status != BFA_STATUS_OK || flash->residue == 0) { in bfa_flash_intr()
4417 flash->status = status; in bfa_flash_intr()
4418 bfa_flash_cb(flash); in bfa_flash_intr()
4420 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4421 bfa_flash_write_send(flash); in bfa_flash_intr()
4426 bfa_trc(flash, status); in bfa_flash_intr()
4428 flash->status = status; in bfa_flash_intr()
4429 bfa_flash_cb(flash); in bfa_flash_intr()
4432 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4433 bfa_trc(flash, len); in bfa_flash_intr()
4434 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
4435 flash->dbuf_kva, len); in bfa_flash_intr()
4436 flash->residue -= len; in bfa_flash_intr()
4437 flash->offset += len; in bfa_flash_intr()
4438 if (flash->residue == 0) { in bfa_flash_intr()
4439 flash->status = status; in bfa_flash_intr()
4440 bfa_flash_cb(flash); in bfa_flash_intr()
4442 bfa_flash_read_send(flash); in bfa_flash_intr()
4449 bfa_trc(flash, status); in bfa_flash_intr()
4451 bfa_ioc_aen_post(flash->ioc, BFA_IOC_AEN_FWCFG_ERROR); in bfa_flash_intr()
4455 bfa_trc(flash, param); in bfa_flash_intr()
4456 bfa_ioc_aen_post(flash->ioc, in bfa_flash_intr()
4490 bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc, void *dev, in bfa_flash_attach() argument
4493 flash->ioc = ioc; in bfa_flash_attach()
4494 flash->trcmod = trcmod; in bfa_flash_attach()
4495 flash->cbfn = NULL; in bfa_flash_attach()
4496 flash->cbarg = NULL; in bfa_flash_attach()
4497 flash->op_busy = 0; in bfa_flash_attach()
4499 bfa_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_flash_attach()
4500 bfa_q_qe_init(&flash->ioc_notify); in bfa_flash_attach()
4501 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_flash_attach()
4502 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_flash_attach()
4506 flash->dbuf_kva = NULL; in bfa_flash_attach()
4507 flash->dbuf_pa = 0; in bfa_flash_attach()
4520 bfa_flash_memclaim(struct bfa_flash_s *flash, u8 *dm_kva, u64 dm_pa, in bfa_flash_memclaim() argument
4526 flash->dbuf_kva = dm_kva; in bfa_flash_memclaim()
4527 flash->dbuf_pa = dm_pa; in bfa_flash_memclaim()
4528 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_flash_memclaim()
4544 bfa_flash_get_attr(struct bfa_flash_s *flash, struct bfa_flash_attr_s *attr, in bfa_flash_get_attr() argument
4547 bfa_trc(flash, BFI_FLASH_H2I_QUERY_REQ); in bfa_flash_get_attr()
4549 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_get_attr()
4552 if (flash->op_busy) { in bfa_flash_get_attr()
4553 bfa_trc(flash, flash->op_busy); in bfa_flash_get_attr()
4557 flash->op_busy = 1; in bfa_flash_get_attr()
4558 flash->cbfn = cbfn; in bfa_flash_get_attr()
4559 flash->cbarg = cbarg; in bfa_flash_get_attr()
4560 flash->ubuf = (u8 *) attr; in bfa_flash_get_attr()
4561 bfa_flash_query_send(flash); in bfa_flash_get_attr()
4578 bfa_flash_erase_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_erase_part() argument
4581 bfa_trc(flash, BFI_FLASH_H2I_ERASE_REQ); in bfa_flash_erase_part()
4582 bfa_trc(flash, type); in bfa_flash_erase_part()
4583 bfa_trc(flash, instance); in bfa_flash_erase_part()
4585 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_erase_part()
4588 if (flash->op_busy) { in bfa_flash_erase_part()
4589 bfa_trc(flash, flash->op_busy); in bfa_flash_erase_part()
4593 flash->op_busy = 1; in bfa_flash_erase_part()
4594 flash->cbfn = cbfn; in bfa_flash_erase_part()
4595 flash->cbarg = cbarg; in bfa_flash_erase_part()
4596 flash->type = type; in bfa_flash_erase_part()
4597 flash->instance = instance; in bfa_flash_erase_part()
4599 bfa_flash_erase_send(flash); in bfa_flash_erase_part()
4600 bfa_flash_aen_audit_post(flash->ioc, BFA_AUDIT_AEN_FLASH_ERASE, in bfa_flash_erase_part()
4620 bfa_flash_update_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_update_part() argument
4624 bfa_trc(flash, BFI_FLASH_H2I_WRITE_REQ); in bfa_flash_update_part()
4625 bfa_trc(flash, type); in bfa_flash_update_part()
4626 bfa_trc(flash, instance); in bfa_flash_update_part()
4627 bfa_trc(flash, len); in bfa_flash_update_part()
4628 bfa_trc(flash, offset); in bfa_flash_update_part()
4630 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_update_part()
4643 if (flash->op_busy) { in bfa_flash_update_part()
4644 bfa_trc(flash, flash->op_busy); in bfa_flash_update_part()
4648 flash->op_busy = 1; in bfa_flash_update_part()
4649 flash->cbfn = cbfn; in bfa_flash_update_part()
4650 flash->cbarg = cbarg; in bfa_flash_update_part()
4651 flash->type = type; in bfa_flash_update_part()
4652 flash->instance = instance; in bfa_flash_update_part()
4653 flash->residue = len; in bfa_flash_update_part()
4654 flash->offset = 0; in bfa_flash_update_part()
4655 flash->addr_off = offset; in bfa_flash_update_part()
4656 flash->ubuf = buf; in bfa_flash_update_part()
4658 bfa_flash_write_send(flash); in bfa_flash_update_part()
4677 bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_read_part() argument
4681 bfa_trc(flash, BFI_FLASH_H2I_READ_REQ); in bfa_flash_read_part()
4682 bfa_trc(flash, type); in bfa_flash_read_part()
4683 bfa_trc(flash, instance); in bfa_flash_read_part()
4684 bfa_trc(flash, len); in bfa_flash_read_part()
4685 bfa_trc(flash, offset); in bfa_flash_read_part()
4687 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_read_part()
4697 if (flash->op_busy) { in bfa_flash_read_part()
4698 bfa_trc(flash, flash->op_busy); in bfa_flash_read_part()
4702 flash->op_busy = 1; in bfa_flash_read_part()
4703 flash->cbfn = cbfn; in bfa_flash_read_part()
4704 flash->cbarg = cbarg; in bfa_flash_read_part()
4705 flash->type = type; in bfa_flash_read_part()
4706 flash->instance = instance; in bfa_flash_read_part()
4707 flash->residue = len; in bfa_flash_read_part()
4708 flash->offset = 0; in bfa_flash_read_part()
4709 flash->addr_off = offset; in bfa_flash_read_part()
4710 flash->ubuf = buf; in bfa_flash_read_part()
4711 bfa_flash_read_send(flash); in bfa_flash_read_part()