Lines Matching full:flash
1424 BFA_FLASH_NOT_PRESENT = -1, /*!< flash not present */
1425 BFA_FLASH_UNINIT = -2, /*!< flash not initialized */
1426 BFA_FLASH_BAD = -3, /*!< flash bad */
1427 BFA_FLASH_BUSY = -4, /*!< flash busy */
1435 /* flash command register data structure */
1457 /* flash device status register data structure */
1481 /* flash address register data structure */
1495 /* Flash raw private functions */
1563 /* Read flash status. */
1601 /* Start flash read operation. */
1631 /* Check flash read operation. */
1641 /* End flash read operation. */
1656 /* Perform flash raw read. */
1786 /* IF Flash has a better F/W than smem do not work with smem. in bfa_nw_ioc_fwver_cmp()
1787 * If smem f/w == flash f/w, as smem f/w not old | incmp, work with it. in bfa_nw_ioc_fwver_cmp()
1788 * If Flash is old or incomp work with smem iff smem f/w == drv f/w. in bfa_nw_ioc_fwver_cmp()
2369 /* Work with Flash iff flash f/w is better than driver f/w. in bfa_ioc_boot()
3020 * Flash module specific
3024 * FLASH DMA buffer should be big enough to hold both MFG block and
3033 bfa_flash_cb(struct bfa_flash *flash) in bfa_flash_cb() argument
3035 flash->op_busy = 0; in bfa_flash_cb()
3036 if (flash->cbfn) in bfa_flash_cb()
3037 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_cb()
3043 struct bfa_flash *flash = cbarg; in bfa_flash_notify() local
3048 if (flash->op_busy) { in bfa_flash_notify()
3049 flash->status = BFA_STATUS_IOC_FAILURE; in bfa_flash_notify()
3050 flash->cbfn(flash->cbarg, flash->status); in bfa_flash_notify()
3051 flash->op_busy = 0; in bfa_flash_notify()
3060 * Send flash write request.
3063 bfa_flash_write_send(struct bfa_flash *flash) in bfa_flash_write_send() argument
3066 (struct bfi_flash_write_req *) flash->mb.msg; in bfa_flash_write_send()
3069 msg->type = be32_to_cpu(flash->type); in bfa_flash_write_send()
3070 msg->instance = flash->instance; in bfa_flash_write_send()
3071 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_write_send()
3072 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_write_send()
3073 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_write_send()
3077 msg->last = (len == flash->residue) ? 1 : 0; in bfa_flash_write_send()
3080 bfa_ioc_portid(flash->ioc)); in bfa_flash_write_send()
3081 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_write_send()
3082 memcpy(flash->dbuf_kva, flash->ubuf + flash->offset, len); in bfa_flash_write_send()
3083 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_flash_write_send()
3085 flash->residue -= len; in bfa_flash_write_send()
3086 flash->offset += len; in bfa_flash_write_send()
3090 * bfa_flash_read_send - Send flash read request.
3097 struct bfa_flash *flash = cbarg; in bfa_flash_read_send() local
3099 (struct bfi_flash_read_req *) flash->mb.msg; in bfa_flash_read_send()
3102 msg->type = be32_to_cpu(flash->type); in bfa_flash_read_send()
3103 msg->instance = flash->instance; in bfa_flash_read_send()
3104 msg->offset = be32_to_cpu(flash->addr_off + flash->offset); in bfa_flash_read_send()
3105 len = (flash->residue < BFA_FLASH_DMA_BUF_SZ) ? in bfa_flash_read_send()
3106 flash->residue : BFA_FLASH_DMA_BUF_SZ; in bfa_flash_read_send()
3109 bfa_ioc_portid(flash->ioc)); in bfa_flash_read_send()
3110 bfa_alen_set(&msg->alen, len, flash->dbuf_pa); in bfa_flash_read_send()
3111 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_flash_read_send()
3115 * bfa_flash_intr - Process flash response messages upon receiving interrupts.
3117 * @flasharg: flash structure
3123 struct bfa_flash *flash = flasharg; in bfa_flash_intr() local
3136 if (!flash->op_busy && msg->mh.msg_id != BFI_FLASH_I2H_EVENT) in bfa_flash_intr()
3146 attr = (struct bfa_flash_attr *) flash->ubuf; in bfa_flash_intr()
3147 f = (struct bfa_flash_attr *) flash->dbuf_kva; in bfa_flash_intr()
3165 flash->status = status; in bfa_flash_intr()
3166 bfa_flash_cb(flash); in bfa_flash_intr()
3170 if (status != BFA_STATUS_OK || flash->residue == 0) { in bfa_flash_intr()
3171 flash->status = status; in bfa_flash_intr()
3172 bfa_flash_cb(flash); in bfa_flash_intr()
3174 bfa_flash_write_send(flash); in bfa_flash_intr()
3179 flash->status = status; in bfa_flash_intr()
3180 bfa_flash_cb(flash); in bfa_flash_intr()
3183 memcpy(flash->ubuf + flash->offset, in bfa_flash_intr()
3184 flash->dbuf_kva, len); in bfa_flash_intr()
3185 flash->residue -= len; in bfa_flash_intr()
3186 flash->offset += len; in bfa_flash_intr()
3187 if (flash->residue == 0) { in bfa_flash_intr()
3188 flash->status = status; in bfa_flash_intr()
3189 bfa_flash_cb(flash); in bfa_flash_intr()
3191 bfa_flash_read_send(flash); in bfa_flash_intr()
3203 * Flash memory info API.
3212 * bfa_nw_flash_attach - Flash attach API.
3214 * @flash: flash structure
3219 bfa_nw_flash_attach(struct bfa_flash *flash, struct bfa_ioc *ioc, void *dev) in bfa_nw_flash_attach() argument
3221 flash->ioc = ioc; in bfa_nw_flash_attach()
3222 flash->cbfn = NULL; in bfa_nw_flash_attach()
3223 flash->cbarg = NULL; in bfa_nw_flash_attach()
3224 flash->op_busy = 0; in bfa_nw_flash_attach()
3226 bfa_nw_ioc_mbox_regisr(flash->ioc, BFI_MC_FLASH, bfa_flash_intr, flash); in bfa_nw_flash_attach()
3227 bfa_ioc_notify_init(&flash->ioc_notify, bfa_flash_notify, flash); in bfa_nw_flash_attach()
3228 list_add_tail(&flash->ioc_notify.qe, &flash->ioc->notify_q); in bfa_nw_flash_attach()
3232 * bfa_nw_flash_memclaim - Claim memory for flash
3234 * @flash: flash structure
3239 bfa_nw_flash_memclaim(struct bfa_flash *flash, u8 *dm_kva, u64 dm_pa) in bfa_nw_flash_memclaim() argument
3241 flash->dbuf_kva = dm_kva; in bfa_nw_flash_memclaim()
3242 flash->dbuf_pa = dm_pa; in bfa_nw_flash_memclaim()
3243 memset(flash->dbuf_kva, 0, BFA_FLASH_DMA_BUF_SZ); in bfa_nw_flash_memclaim()
3249 * bfa_nw_flash_get_attr - Get flash attribute.
3251 * @flash: flash structure
3252 * @attr: flash attribute structure
3259 bfa_nw_flash_get_attr(struct bfa_flash *flash, struct bfa_flash_attr *attr, in bfa_nw_flash_get_attr() argument
3263 (struct bfi_flash_query_req *) flash->mb.msg; in bfa_nw_flash_get_attr()
3265 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_get_attr()
3268 if (flash->op_busy) in bfa_nw_flash_get_attr()
3271 flash->op_busy = 1; in bfa_nw_flash_get_attr()
3272 flash->cbfn = cbfn; in bfa_nw_flash_get_attr()
3273 flash->cbarg = cbarg; in bfa_nw_flash_get_attr()
3274 flash->ubuf = (u8 *) attr; in bfa_nw_flash_get_attr()
3277 bfa_ioc_portid(flash->ioc)); in bfa_nw_flash_get_attr()
3278 bfa_alen_set(&msg->alen, sizeof(struct bfa_flash_attr), flash->dbuf_pa); in bfa_nw_flash_get_attr()
3279 bfa_nw_ioc_mbox_queue(flash->ioc, &flash->mb, NULL, NULL); in bfa_nw_flash_get_attr()
3285 * bfa_nw_flash_update_part - Update flash partition.
3287 * @flash: flash structure
3288 * @type: flash partition type
3289 * @instance: flash partition instance
3299 bfa_nw_flash_update_part(struct bfa_flash *flash, u32 type, u8 instance, in bfa_nw_flash_update_part() argument
3303 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_update_part()
3315 if (flash->op_busy) in bfa_nw_flash_update_part()
3318 flash->op_busy = 1; in bfa_nw_flash_update_part()
3319 flash->cbfn = cbfn; in bfa_nw_flash_update_part()
3320 flash->cbarg = cbarg; in bfa_nw_flash_update_part()
3321 flash->type = type; in bfa_nw_flash_update_part()
3322 flash->instance = instance; in bfa_nw_flash_update_part()
3323 flash->residue = len; in bfa_nw_flash_update_part()
3324 flash->offset = 0; in bfa_nw_flash_update_part()
3325 flash->addr_off = offset; in bfa_nw_flash_update_part()
3326 flash->ubuf = buf; in bfa_nw_flash_update_part()
3328 bfa_flash_write_send(flash); in bfa_nw_flash_update_part()
3334 * bfa_nw_flash_read_part - Read flash partition.
3336 * @flash: flash structure
3337 * @type: flash partition type
3338 * @instance: flash partition instance
3348 bfa_nw_flash_read_part(struct bfa_flash *flash, u32 type, u8 instance, in bfa_nw_flash_read_part() argument
3352 if (!bfa_nw_ioc_is_operational(flash->ioc)) in bfa_nw_flash_read_part()
3361 if (flash->op_busy) in bfa_nw_flash_read_part()
3364 flash->op_busy = 1; in bfa_nw_flash_read_part()
3365 flash->cbfn = cbfn; in bfa_nw_flash_read_part()
3366 flash->cbarg = cbarg; in bfa_nw_flash_read_part()
3367 flash->type = type; in bfa_nw_flash_read_part()
3368 flash->instance = instance; in bfa_nw_flash_read_part()
3369 flash->residue = len; in bfa_nw_flash_read_part()
3370 flash->offset = 0; in bfa_nw_flash_read_part()
3371 flash->addr_off = offset; in bfa_nw_flash_read_part()
3372 flash->ubuf = buf; in bfa_nw_flash_read_part()
3374 bfa_flash_read_send(flash); in bfa_nw_flash_read_part()