Lines Matching refs:bif_output
64 struct bif_output { struct
72 struct bif_output bif_output; argument
246 uintptr_t old_data = (uintptr_t)bif_output.data; in bif_add_blob()
249 header_off = (uintptr_t)bif_output.header - old_data; in bif_add_blob()
250 last_part_off = (uintptr_t)bif_output.last_part - old_data; in bif_add_blob()
251 imgheader_off = (uintptr_t)bif_output.imgheader - old_data; in bif_add_blob()
255 if (bif_output.data_len > *offset) { in bif_add_blob()
260 bif_output.data_len = *offset; in bif_add_blob()
263 new_size = ROUND(bif_output.data_len + len, 64); in bif_add_blob()
264 new_data = realloc(bif_output.data, new_size); in bif_add_blob()
265 memcpy(new_data + bif_output.data_len, data, len); in bif_add_blob()
267 *offset = bif_output.data_len; in bif_add_blob()
268 bif_output.data = new_data; in bif_add_blob()
269 bif_output.data_len = new_size; in bif_add_blob()
272 if (bif_output.header) in bif_add_blob()
273 bif_output.header = new_data + header_off; in bif_add_blob()
274 if (bif_output.last_part) in bif_add_blob()
275 bif_output.last_part = new_data + last_part_off; in bif_add_blob()
276 if (bif_output.imgheader) in bif_add_blob()
277 bif_output.imgheader = new_data + imgheader_off; in bif_add_blob()
293 bif_output.header = (void *)bif_output.data; in bif_init()
302 if (bif_output.header->image_offset) { in bif_add_pmufw()
312 bif_output.header->pfw_image_length = cpu_to_le32(len); in bif_add_pmufw()
313 bif_output.header->total_pfw_image_length = cpu_to_le32(len); in bif_add_pmufw()
314 bif_output.header->image_offset = cpu_to_le32(bf->offset); in bif_add_pmufw()
342 if (bif_output.last_part) { in bif_add_part()
347 parthdr.offset = cpu_to_le32(bif_output.header->image_offset); in bif_add_part()
349 bif_output.header->image_offset) / 4); in bif_add_part()
381 if (!bif_output.imgheader) { in bif_add_part()
392 bif_output.header->image_header_table_offset = imghdr_off; in bif_add_part()
393 bif_output.imgheader = (void *)(bif_output.data + imghdr_off); in bif_add_part()
396 bif_output.imgheader->nr_parts = cpu_to_le32(le32_to_cpu( in bif_add_part()
397 bif_output.imgheader->nr_parts) + 1); in bif_add_part()
400 if (bif_output.last_part) { in bif_add_part()
401 bif_output.last_part->next_partition_offset = in bif_add_part()
405 csum = zynqmp_csum(bif_output.last_part, in bif_add_part()
406 &bif_output.last_part->checksum); in bif_add_part()
407 bif_output.last_part->checksum = cpu_to_le32(csum); in bif_add_part()
409 bif_output.imgheader->partition_header_offset = in bif_add_part()
412 bif_output.last_part = (void *)(bif_output.data + parthdr_offset); in bif_add_part()
415 bif_output.header->image_load = cpu_to_le32(bf->load); in bif_add_part()
416 if (!bif_output.header->image_offset) in bif_add_part()
417 bif_output.header->image_offset = in bif_add_part()
419 bif_output.header->image_size = cpu_to_le32(len); in bif_add_part()
420 bif_output.header->image_stored_size = cpu_to_le32(len); in bif_add_part()
422 bif_output.header->image_attributes &= ~HEADER_CPU_SELECT_MASK; in bif_add_part()
427 bif_output.header->image_attributes |= in bif_add_part()
430 bif_output.header->image_attributes |= in bif_add_part()
434 bif_output.header->image_attributes |= in bif_add_part()
438 bif_output.header->image_attributes |= in bif_add_part()
954 csum = zynqmp_csum(&bif_output.header->width_detection, in zynqmpbif_copy_image()
955 &bif_output.header->checksum); in zynqmpbif_copy_image()
956 bif_output.header->checksum = cpu_to_le32(csum); in zynqmpbif_copy_image()
958 if (bif_output.imgheader) { in zynqmpbif_copy_image()
959 csum = zynqmp_csum(bif_output.imgheader, in zynqmpbif_copy_image()
960 &bif_output.imgheader->checksum); in zynqmpbif_copy_image()
961 bif_output.imgheader->checksum = cpu_to_le32(csum); in zynqmpbif_copy_image()
968 len = bif_output.data_len; in zynqmpbif_copy_image()
969 bifp = bif_output.data; in zynqmpbif_copy_image()