• Home
  • Raw
  • Download

Lines Matching refs:fc

137 	struct esas2r_flash_context *fc =  in esas2r_fmapi_callback()  local
144 if (fc->sgc.cur_offset == NULL) in esas2r_fmapi_callback()
155 rq->interrupt_cb = fc->interrupt_cb; in esas2r_fmapi_callback()
169 (*fc->interrupt_cb)(a, rq); in esas2r_fmapi_callback()
179 struct esas2r_flash_context *fc = in build_flash_msg() local
181 struct esas2r_sg_context *sgc = &fc->sgc; in build_flash_msg()
185 if (fc->func == VDA_FLASH_BEGINW) { in build_flash_msg()
192 rq->interrupt_cb = fc->interrupt_cb; in build_flash_msg()
196 fc->func, in build_flash_msg()
198 fc->flsh_addr, in build_flash_msg()
208 fc->curr_len = fc->sgc.length; in build_flash_msg()
219 fc->sgc.length = 0; in build_flash_msg()
223 fc->flsh_addr += fc->curr_len; in build_flash_msg()
305 struct esas2r_flash_context *fc = in complete_fmapi_req() local
307 struct esas2r_flash_img *fi = fc->fi; in complete_fmapi_req()
315 memset(fc->scratch, 0, FM_BUF_SZ); in complete_fmapi_req()
326 struct esas2r_flash_context *fc = in fw_download_proc() local
328 struct esas2r_flash_img *fi = fc->fi; in fw_download_proc()
342 if (fc->func == VDA_FLASH_READ in fw_download_proc()
343 && fc->cmp_len) { in fw_download_proc()
344 ch = &fi->cmp_hdr[fc->comp_typ]; in fw_download_proc()
346 p = fc->scratch; in fw_download_proc()
350 - fc->cmp_len; /* where we are now */ in fw_download_proc()
356 for (len = fc->curr_len; len; len--) in fw_download_proc()
360 fc->cmp_len -= fc->curr_len; /* # left to compare */ in fw_download_proc()
363 if (fc->cmp_len > FM_BUF_SZ) in fw_download_proc()
364 fc->sgc.length = FM_BUF_SZ; in fw_download_proc()
366 fc->sgc.length = fc->cmp_len; in fw_download_proc()
368 fc->sgc.cur_offset = fc->sgc_offset + in fw_download_proc()
369 ((u8 *)fc->scratch - (u8 *)fi); in fw_download_proc()
378 while (fc->sgc.length == 0) { in fw_download_proc()
379 ch = &fi->cmp_hdr[fc->comp_typ]; in fw_download_proc()
381 switch (fc->task) { in fw_download_proc()
388 fc->task = FMTSK_WRTBIOS; in fw_download_proc()
389 fc->func = VDA_FLASH_BEGINW; in fw_download_proc()
390 fc->comp_typ = CH_IT_BIOS; in fw_download_proc()
391 fc->flsh_addr = FLS_OFFSET_BOOT; in fw_download_proc()
392 fc->sgc.length = ch->length; in fw_download_proc()
393 fc->sgc.cur_offset = fc->sgc_offset + in fw_download_proc()
402 fc->task = FMTSK_READBIOS; in fw_download_proc()
403 fc->func = VDA_FLASH_READ; in fw_download_proc()
404 fc->flsh_addr = FLS_OFFSET_BOOT; in fw_download_proc()
405 fc->cmp_len = ch->length; in fw_download_proc()
406 fc->sgc.length = FM_BUF_SZ; in fw_download_proc()
407 fc->sgc.cur_offset = fc->sgc_offset in fw_download_proc()
408 + ((u8 *)fc->scratch - in fw_download_proc()
425 fc->task = FMTSK_WRTMAC; in fw_download_proc()
426 fc->func = VDA_FLASH_BEGINW; in fw_download_proc()
427 fc->comp_typ = CH_IT_MAC; in fw_download_proc()
428 fc->flsh_addr = FLS_OFFSET_BOOT in fw_download_proc()
430 fc->sgc.length = ch->length; in fw_download_proc()
431 fc->sgc.cur_offset = fc->sgc_offset + in fw_download_proc()
437 fc->task = FMTSK_READMAC; in fw_download_proc()
438 fc->func = VDA_FLASH_READ; in fw_download_proc()
439 fc->flsh_addr -= ch->length; in fw_download_proc()
440 fc->cmp_len = ch->length; in fw_download_proc()
441 fc->sgc.length = FM_BUF_SZ; in fw_download_proc()
442 fc->sgc.cur_offset = fc->sgc_offset in fw_download_proc()
443 + ((u8 *)fc->scratch - in fw_download_proc()
460 fc->task = FMTSK_WRTEFI; in fw_download_proc()
461 fc->func = VDA_FLASH_BEGINW; in fw_download_proc()
462 fc->comp_typ = CH_IT_EFI; in fw_download_proc()
463 fc->flsh_addr = FLS_OFFSET_BOOT in fw_download_proc()
466 fc->sgc.length = ch->length; in fw_download_proc()
467 fc->sgc.cur_offset = fc->sgc_offset + in fw_download_proc()
473 fc->task = FMTSK_READEFI; in fw_download_proc()
474 fc->func = VDA_FLASH_READ; in fw_download_proc()
475 fc->flsh_addr -= ch->length; in fw_download_proc()
476 fc->cmp_len = ch->length; in fw_download_proc()
477 fc->sgc.length = FM_BUF_SZ; in fw_download_proc()
478 fc->sgc.cur_offset = fc->sgc_offset in fw_download_proc()
479 + ((u8 *)fc->scratch - in fw_download_proc()
496 fc->task = FMTSK_WRTCFG; in fw_download_proc()
497 fc->func = VDA_FLASH_BEGINW; in fw_download_proc()
498 fc->comp_typ = CH_IT_CFG; in fw_download_proc()
499 fc->flsh_addr = FLS_OFFSET_CPYR - ch->length; in fw_download_proc()
500 fc->sgc.length = ch->length; in fw_download_proc()
501 fc->sgc.cur_offset = fc->sgc_offset + in fw_download_proc()
507 fc->task = FMTSK_READCFG; in fw_download_proc()
508 fc->func = VDA_FLASH_READ; in fw_download_proc()
509 fc->flsh_addr = FLS_OFFSET_CPYR - ch->length; in fw_download_proc()
510 fc->cmp_len = ch->length; in fw_download_proc()
511 fc->sgc.length = FM_BUF_SZ; in fw_download_proc()
512 fc->sgc.cur_offset = fc->sgc_offset in fw_download_proc()
513 + ((u8 *)fc->scratch - in fw_download_proc()
543 if (fc->func == VDA_FLASH_READ in fw_download_proc()
544 && fc->sgc.length > fc->cmp_len) in fw_download_proc()
545 fc->sgc.length = fc->cmp_len; in fw_download_proc()
551 if (fc->comp_typ < fi->num_comps) { in fw_download_proc()
552 ch = &fi->cmp_hdr[fc->comp_typ]; in fw_download_proc()
664 static u16 calc_fi_checksum(struct esas2r_flash_context *fc) in calc_fi_checksum() argument
666 struct esas2r_flash_img *fi = fc->fi; in calc_fi_checksum()
671 for (len = (fi->length - fc->fi_hdr_len) / 2, in calc_fi_checksum()
672 pw = (u16 *)((u8 *)fi + fc->fi_hdr_len), in calc_fi_checksum()
693 struct esas2r_flash_context *fc) in verify_fi() argument
695 struct esas2r_flash_img *fi = fc->fi; in verify_fi()
706 || len < fc->fi_hdr_len) { in verify_fi()
812 if (len != fi->length - fc->fi_hdr_len) { in verify_fi()
818 if (fi->checksum != calc_fi_checksum(fc)) { in verify_fi()
1393 struct esas2r_flash_context *fc = &a->flash_context; in esas2r_fm_api() local
1403 memcpy(&fc->sgc, sgc, sizeof(struct esas2r_sg_context)); in esas2r_fm_api()
1404 sgc = &fc->sgc; in esas2r_fm_api()
1405 fc->fi = fi; in esas2r_fm_api()
1406 fc->sgc_offset = sgc->cur_offset; in esas2r_fm_api()
1408 rq->interrupt_cx = fc; in esas2r_fm_api()
1412 fc->scratch = ((struct esas2r_flash_img *)fi)->scratch_buf; in esas2r_fm_api()
1413 fc->num_comps = FI_NUM_COMPS_V1; in esas2r_fm_api()
1414 fc->fi_hdr_len = sizeof(struct esas2r_flash_img); in esas2r_fm_api()
1427 if (!verify_fi(a, fc)) in esas2r_fm_api()
1447 fi->checksum = calc_fi_checksum(fc); in esas2r_fm_api()
1453 fc->task = FMTSK_ERASE_BOOT; in esas2r_fm_api()
1454 fc->func = VDA_FLASH_BEGINW; in esas2r_fm_api()
1455 fc->comp_typ = CH_IT_CFG; in esas2r_fm_api()
1456 fc->flsh_addr = FLS_OFFSET_BOOT; in esas2r_fm_api()
1457 fc->sgc.length = FLS_LENGTH_BOOT; in esas2r_fm_api()
1458 fc->sgc.cur_offset = NULL; in esas2r_fm_api()
1461 fc->interrupt_cb = fw_download_proc; in esas2r_fm_api()
1467 fi->num_comps = fc->num_comps; in esas2r_fm_api()
1468 fi->length = fc->fi_hdr_len; in esas2r_fm_api()