Lines Matching refs:hdr
138 #define FW_TLV_PTR(img, hdr) ((img) + sizeof(*(hdr))) argument
139 #define FW_SIGN_PTR(img, hdr) ({ \ argument
140 struct remoteproc_fw_hdr *__hdr = (hdr); \
144 #define FW_IMG_PTR(img, hdr) ({ \ argument
145 struct remoteproc_fw_hdr *___hdr = (hdr); \
217 static void remoteproc_header_dump(struct remoteproc_fw_hdr __maybe_unused *hdr) in remoteproc_header_dump() argument
219 DMSG("magic :\t%#"PRIx32, hdr->magic); in remoteproc_header_dump()
220 DMSG("version :\t%#"PRIx32, hdr->version); in remoteproc_header_dump()
221 DMSG("tlv_len :\t%#"PRIx32, hdr->tlv_len); in remoteproc_header_dump()
222 DMSG("sign_len :\t%#"PRIx32, hdr->sign_len); in remoteproc_header_dump()
223 DMSG("img_len :\t%#"PRIx32, hdr->img_len); in remoteproc_header_dump()
313 struct remoteproc_fw_hdr *hdr = (void *)ctx->sec_cpy; in remoteproc_pta_verify() local
324 res = remoteproc_get_tlv(ctx->tlvs, hdr->tlv_len, in remoteproc_pta_verify()
338 sign = FW_SIGN_PTR(ctx->sec_cpy, hdr); in remoteproc_pta_verify()
346 params[3].memref.size = hdr->sign_len; in remoteproc_pta_verify()
363 struct remoteproc_fw_hdr *hdr = fw_orig; in remoteproc_save_fw_header_and_tlvs() local
369 if (ADD_OVERFLOW(sizeof(*hdr), ROUNDUP_64(hdr->tlv_len), &length) || in remoteproc_save_fw_header_and_tlvs()
370 ADD_OVERFLOW(length, ROUNDUP_64(hdr->sign_len), &length)) in remoteproc_save_fw_header_and_tlvs()
373 if (fw_orig_size <= length || !hdr->sign_len || !hdr->tlv_len) in remoteproc_save_fw_header_and_tlvs()
376 remoteproc_header_dump(hdr); in remoteproc_save_fw_header_and_tlvs()
391 struct remoteproc_fw_hdr *hdr = (void *)ctx->sec_cpy; in remoteproc_verify_signature() local
400 res = remoteproc_get_tlv(ctx->tlvs, hdr->tlv_len, RPROC_TLV_SIGNTYPE, in remoteproc_verify_signature()
422 TEE_DigestUpdate(op, hdr, sizeof(*hdr)); in remoteproc_verify_signature()
423 res = TEE_DigestDoFinal(op, ctx->tlvs, ROUNDUP_64(hdr->tlv_len), in remoteproc_verify_signature()
449 struct remoteproc_fw_hdr *hdr = (void *)ctx->sec_cpy; in remoteproc_verify_header() local
452 if (hdr->magic != RPROC_HDR_MAGIC) in remoteproc_verify_header()
455 if (hdr->version != HEADER_VERSION) in remoteproc_verify_header()
463 if (ADD_OVERFLOW(sizeof(*hdr), ROUNDUP_64(hdr->sign_len), &size) || in remoteproc_verify_header()
464 ADD_OVERFLOW(size, ROUNDUP_64(hdr->img_len), &size) || in remoteproc_verify_header()
465 ADD_OVERFLOW(size, ROUNDUP_64(hdr->tlv_len), &size) || in remoteproc_verify_header()
499 struct remoteproc_fw_hdr *hdr = NULL; in remoteproc_verify_firmware() local
524 hdr = (void *)ctx->sec_cpy; in remoteproc_verify_firmware()
525 ctx->tlvs_sz = hdr->tlv_len; in remoteproc_verify_firmware()
526 ctx->tlvs = FW_TLV_PTR(ctx->sec_cpy, hdr); in remoteproc_verify_firmware()
533 ctx->fw_img_sz = hdr->img_len; in remoteproc_verify_firmware()
534 ctx->fw_img = FW_IMG_PTR(fw_orig, hdr); in remoteproc_verify_firmware()