Lines Matching full:flash

3966  *	Flash module specific
3970 * FLASH DMA buffer should be big enough to hold both MFG block and
3999 bfa_flash_cb(struct bfa_flash_s *flash) in bfa_flash_cb() argument
4001 flash->op_busy = 0; in bfa_flash_cb()
4002 if (flash->cbfn) in bfa_flash_cb()
4003 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
4009 struct bfa_flash_s *flash = cbarg; in bfa_flash_notify() local
4011 bfa_trc(flash, event); in bfa_flash_notify()
4015 if (flash->op_busy) { in bfa_flash_notify()
4016 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
4017 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
4018 flash->op_busy = 0; in bfa_flash_notify()
4028 * Send flash attribute query request.
4035 struct bfa_flash_s *flash = cbarg; in bfa_flash_query_send() local
4037 (struct bfi_flash_query_req_s *) flash->mb.msg; in bfa_flash_query_send()
4040 bfa_ioc_portid(flash->ioc)); in bfa_flash_query_send()
4042 flash->dbuf_pa); in bfa_flash_query_send()
4043 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_query_send()
4047 * Send flash write request.
4052 bfa_flash_write_send(struct bfa_flash_s *flash) in bfa_flash_write_send() argument
4055 (struct bfi_flash_write_req_s *) flash->mb.msg; in bfa_flash_write_send()
4058 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
4059 msg->instance = flash->instance; in bfa_flash_write_send()
4060 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
4061 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
4062 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
4066 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
4069 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
4070 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
4071 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
4072 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_write_send()
4074 flash->residue -= len; in bfa_flash_write_send()
4075 flash->offset += len; in bfa_flash_write_send()
4079 * Send flash read request.
4086 struct bfa_flash_s *flash = cbarg; in bfa_flash_read_send() local
4088 (struct bfi_flash_read_req_s *) flash->mb.msg; in bfa_flash_read_send()
4091 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
4092 msg->instance = flash->instance; in bfa_flash_read_send()
4093 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
4094 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
4095 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
4098 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
4099 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
4100 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_read_send()
4104 * Send flash erase request.
4111 struct bfa_flash_s *flash = cbarg; in bfa_flash_erase_send() local
4113 (struct bfi_flash_erase_req_s *) flash->mb.msg; in bfa_flash_erase_send()
4115 msg->type = be32_to_cpu(flash->type); in bfa_flash_erase_send()
4116 msg->instance = flash->instance; in bfa_flash_erase_send()
4118 bfa_ioc_portid(flash->ioc)); in bfa_flash_erase_send()
4119 bfa_ioc_mbox_queue(flash->ioc, &flash->mb); in bfa_flash_erase_send()
4123 * Process flash response messages upon receiving interrupts.
4125 * @param[in] flasharg - flash structure
4131 struct bfa_flash_s *flash = flasharg; in bfa_flash_intr() local
4144 bfa_trc(flash, msg->mh.msg_id); in bfa_flash_intr()
4146 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) { in bfa_flash_intr()
4148 bfa_trc(flash, 0x9999); in bfa_flash_intr()
4155 bfa_trc(flash, status); in bfa_flash_intr()
4160 attr = (struct bfa_flash_attr_s *) flash->ubuf; in bfa_flash_intr()
4161 f = (struct bfa_flash_attr_s *) flash->dbuf_kva; in bfa_flash_intr()
4164 bfa_trc(flash, attr->status); in bfa_flash_intr()
4165 bfa_trc(flash, attr->npart); in bfa_flash_intr()
4181 flash->status = status; in bfa_flash_intr()
4182 bfa_flash_cb(flash); in bfa_flash_intr()
4186 bfa_trc(flash, status); in bfa_flash_intr()
4187 flash->status = status; in bfa_flash_intr()
4188 bfa_flash_cb(flash); in bfa_flash_intr()
4192 bfa_trc(flash, status); in bfa_flash_intr()
4193 if (status != BFA_STATUS_OK || flash->residue == 0) { in bfa_flash_intr()
4194 flash->status = status; in bfa_flash_intr()
4195 bfa_flash_cb(flash); in bfa_flash_intr()
4197 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4198 bfa_flash_write_send(flash); in bfa_flash_intr()
4203 bfa_trc(flash, status); in bfa_flash_intr()
4205 flash->status = status; in bfa_flash_intr()
4206 bfa_flash_cb(flash); in bfa_flash_intr()
4209 bfa_trc(flash, flash->offset); in bfa_flash_intr()
4210 bfa_trc(flash, len); in bfa_flash_intr()
4211 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
4212 flash->dbuf_kva, len); in bfa_flash_intr()
4213 flash->residue -= len; in bfa_flash_intr()
4214 flash->offset += len; in bfa_flash_intr()
4215 if (flash->residue == 0) { in bfa_flash_intr()
4216 flash->status = status; in bfa_flash_intr()
4217 bfa_flash_cb(flash); in bfa_flash_intr()
4219 bfa_flash_read_send(flash); in bfa_flash_intr()
4226 bfa_trc(flash, status); in bfa_flash_intr()
4228 bfa_ioc_aen_post(flash->ioc, BFA_IOC_AEN_FWCFG_ERROR); in bfa_flash_intr()
4232 bfa_trc(flash, param); in bfa_flash_intr()
4233 bfa_ioc_aen_post(flash->ioc, in bfa_flash_intr()
4244 * Flash memory info API.
4251 /* min driver doesn't need flash */ in bfa_flash_meminfo()
4258 * Flash attach API.
4260 * @param[in] flash - flash structure
4267 bfa_flash_attach(struct bfa_flash_s *flash, struct bfa_ioc_s *ioc, void *dev, in bfa_flash_attach() argument
4270 flash->ioc = ioc; in bfa_flash_attach()
4271 flash->trcmod = trcmod; in bfa_flash_attach()
4272 flash->cbfn = NULL; in bfa_flash_attach()
4273 flash->cbarg = NULL; in bfa_flash_attach()
4274 flash->op_busy = 0; in bfa_flash_attach()
4276 bfa_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_flash_attach()
4277 bfa_q_qe_init(&flash->ioc_notify); in bfa_flash_attach()
4278 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_flash_attach()
4279 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_flash_attach()
4281 /* min driver doesn't need flash */ in bfa_flash_attach()
4283 flash->dbuf_kva = NULL; in bfa_flash_attach()
4284 flash->dbuf_pa = 0; in bfa_flash_attach()
4289 * Claim memory for flash
4291 * @param[in] flash - flash structure
4297 bfa_flash_memclaim(struct bfa_flash_s *flash, u8 *dm_kva, u64 dm_pa, in bfa_flash_memclaim() argument
4303 flash->dbuf_kva = dm_kva; in bfa_flash_memclaim()
4304 flash->dbuf_pa = dm_pa; in bfa_flash_memclaim()
4305 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_flash_memclaim()
4311 * Get flash attribute.
4313 * @param[in] flash - flash structure
4314 * @param[in] attr - flash attribute structure
4321 bfa_flash_get_attr(struct bfa_flash_s *flash, struct bfa_flash_attr_s *attr, in bfa_flash_get_attr() argument
4324 bfa_trc(flash, BFI_FLASH_H2I_QUERY_REQ); in bfa_flash_get_attr()
4326 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_get_attr()
4329 if (flash->op_busy) { in bfa_flash_get_attr()
4330 bfa_trc(flash, flash->op_busy); in bfa_flash_get_attr()
4334 flash->op_busy = 1; in bfa_flash_get_attr()
4335 flash->cbfn = cbfn; in bfa_flash_get_attr()
4336 flash->cbarg = cbarg; in bfa_flash_get_attr()
4337 flash->ubuf = (u8 *) attr; in bfa_flash_get_attr()
4338 bfa_flash_query_send(flash); in bfa_flash_get_attr()
4344 * Erase flash partition.
4346 * @param[in] flash - flash structure
4347 * @param[in] type - flash partition type
4348 * @param[in] instance - flash partition instance
4355 bfa_flash_erase_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_erase_part() argument
4358 bfa_trc(flash, BFI_FLASH_H2I_ERASE_REQ); in bfa_flash_erase_part()
4359 bfa_trc(flash, type); in bfa_flash_erase_part()
4360 bfa_trc(flash, instance); in bfa_flash_erase_part()
4362 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_erase_part()
4365 if (flash->op_busy) { in bfa_flash_erase_part()
4366 bfa_trc(flash, flash->op_busy); in bfa_flash_erase_part()
4370 flash->op_busy = 1; in bfa_flash_erase_part()
4371 flash->cbfn = cbfn; in bfa_flash_erase_part()
4372 flash->cbarg = cbarg; in bfa_flash_erase_part()
4373 flash->type = type; in bfa_flash_erase_part()
4374 flash->instance = instance; in bfa_flash_erase_part()
4376 bfa_flash_erase_send(flash); in bfa_flash_erase_part()
4377 bfa_flash_aen_audit_post(flash->ioc, BFA_AUDIT_AEN_FLASH_ERASE, in bfa_flash_erase_part()
4383 * Update flash partition.
4385 * @param[in] flash - flash structure
4386 * @param[in] type - flash partition type
4387 * @param[in] instance - flash partition instance
4397 bfa_flash_update_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_update_part() argument
4401 bfa_trc(flash, BFI_FLASH_H2I_WRITE_REQ); in bfa_flash_update_part()
4402 bfa_trc(flash, type); in bfa_flash_update_part()
4403 bfa_trc(flash, instance); in bfa_flash_update_part()
4404 bfa_trc(flash, len); in bfa_flash_update_part()
4405 bfa_trc(flash, offset); in bfa_flash_update_part()
4407 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_update_part()
4420 if (flash->op_busy) { in bfa_flash_update_part()
4421 bfa_trc(flash, flash->op_busy); in bfa_flash_update_part()
4425 flash->op_busy = 1; in bfa_flash_update_part()
4426 flash->cbfn = cbfn; in bfa_flash_update_part()
4427 flash->cbarg = cbarg; in bfa_flash_update_part()
4428 flash->type = type; in bfa_flash_update_part()
4429 flash->instance = instance; in bfa_flash_update_part()
4430 flash->residue = len; in bfa_flash_update_part()
4431 flash->offset = 0; in bfa_flash_update_part()
4432 flash->addr_off = offset; in bfa_flash_update_part()
4433 flash->ubuf = buf; in bfa_flash_update_part()
4435 bfa_flash_write_send(flash); in bfa_flash_update_part()
4440 * Read flash partition.
4442 * @param[in] flash - flash structure
4443 * @param[in] type - flash partition type
4444 * @param[in] instance - flash partition instance
4454 bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, in bfa_flash_read_part() argument
4458 bfa_trc(flash, BFI_FLASH_H2I_READ_REQ); in bfa_flash_read_part()
4459 bfa_trc(flash, type); in bfa_flash_read_part()
4460 bfa_trc(flash, instance); in bfa_flash_read_part()
4461 bfa_trc(flash, len); in bfa_flash_read_part()
4462 bfa_trc(flash, offset); in bfa_flash_read_part()
4464 if (!bfa_ioc_is_operational(flash->ioc)) in bfa_flash_read_part()
4474 if (flash->op_busy) { in bfa_flash_read_part()
4475 bfa_trc(flash, flash->op_busy); in bfa_flash_read_part()
4479 flash->op_busy = 1; in bfa_flash_read_part()
4480 flash->cbfn = cbfn; in bfa_flash_read_part()
4481 flash->cbarg = cbarg; in bfa_flash_read_part()
4482 flash->type = type; in bfa_flash_read_part()
4483 flash->instance = instance; in bfa_flash_read_part()
4484 flash->residue = len; in bfa_flash_read_part()
4485 flash->offset = 0; in bfa_flash_read_part()
4486 flash->addr_off = offset; in bfa_flash_read_part()
4487 flash->ubuf = buf; in bfa_flash_read_part()
4488 bfa_flash_read_send(flash); in bfa_flash_read_part()
5219 * Flash memory info API.
5234 * Flash attach API.
5603 BFA_DCONF_SM_FLASH_COMP = 2, /* read/write to flash */
5672 * Read flash for dconf entries and make a call back to the driver once done.
5726 * entries are dirty, write back to the flash.
5763 * Sync the dconf entries to the flash.
5869 * Set the flashdone flag to TRUE explicitly as no flash in bfa_dconf_attach()