Lines Matching refs:hdr
39 struct tag_tboot_header_2k *hdr) in open_image() argument
54 component_num = (hdr->size >> 16) & 0xffff; in open_image()
55 sign_offset = (hdr->size & 0xffff) << 2; in open_image()
56 pcompdata = (component_data *)((char *)hdr + sizeof(tboot_header)); in open_image()
57 pcomp = (boot_component *)((char *)hdr + sign_offset + SIGNATURE_SIZE); in open_image()
89 static int check_image(struct tag_tboot_header_2k *hdr) in check_image() argument
94 return (hash_format[hdr->flags & 0x3] == 0) ? -EINVAL : 0; in check_image()
98 struct tag_tboot_header_2k *hdr, in load_image() argument
112 image_num = open_image(image_name, entry, hdr); in load_image()
149 ret = check_image(hdr); in load_image()
173 struct tag_tboot_header_2k hdr; in rkfw_load_trust() local
181 if (blkcnt != info->read(info, sect_addr, blkcnt, &hdr)) in rkfw_load_trust()
184 if (hdr.tag == TBOOT_HEAD_TAG) { in rkfw_load_trust()
189 ret = load_image(info, &hdr, sect_addr, in rkfw_load_trust()
195 ret = load_image(info, &hdr, sect_addr, in rkfw_load_trust()
216 struct tag_second_loader_hdr hdr; in rkfw_load_trust() local
224 ret = info->read(info, sect_addr, blkcnt, &hdr); in rkfw_load_trust()
228 if (!memcmp(hdr.magic, TBOOT_HEAD_TAG, 6)) { in rkfw_load_trust()
230 spl_image->entry_point = (uintptr_t)hdr.loader_load_addr; in rkfw_load_trust()
233 load_addr = (char *)((size_t)hdr.loader_load_addr); in rkfw_load_trust()
234 blkcnt = DIV_ROUND_UP(hdr.loader_load_size, 512); in rkfw_load_trust()
258 struct tag_second_loader_hdr hdr; in rkfw_load_uboot() local
266 ret = info->read(info, sect_addr, blkcnt, &hdr); in rkfw_load_uboot()
270 if (!memcmp(hdr.magic, LOADER_HARD_STR, 6)) { in rkfw_load_uboot()
273 load_addr = (char *)((size_t)hdr.loader_load_addr); in rkfw_load_uboot()
274 blkcnt = DIV_ROUND_UP(hdr.loader_load_size, 512); in rkfw_load_uboot()
293 spl_image->entry_point_bl33 = (uintptr_t)hdr.loader_load_addr; in rkfw_load_uboot()
296 spl_image->entry_point_os = (uintptr_t)hdr.loader_load_addr; in rkfw_load_uboot()
304 struct andr_img_hdr *hdr; in rkfw_load_kernel() local
309 hdr = malloc(cnt * 512); in rkfw_load_kernel()
310 if (!hdr) in rkfw_load_kernel()
313 ret = info->read(info, image_sector, cnt, (void *)hdr); in rkfw_load_kernel()
319 if (memcmp(hdr->magic, ANDR_BOOT_MAGIC, strlen(ANDR_BOOT_MAGIC)) != 0) { in rkfw_load_kernel()
325 ramdisk_sector = ALIGN(hdr->kernel_size, hdr->page_size); in rkfw_load_kernel()
326 resource_sector = ALIGN(hdr->kernel_size, hdr->page_size) in rkfw_load_kernel()
327 + ALIGN(hdr->ramdisk_size, hdr->page_size); in rkfw_load_kernel()
328 dtb_sector = ALIGN(hdr->kernel_size, hdr->page_size) in rkfw_load_kernel()
329 + ALIGN(hdr->ramdisk_size, hdr->page_size) in rkfw_load_kernel()
330 + ALIGN(hdr->second_size, hdr->page_size); in rkfw_load_kernel()
332 cnt = ALIGN(hdr->kernel_size, hdr->page_size) >> 9; in rkfw_load_kernel()
363 if (hdr->ramdisk_size) { in rkfw_load_kernel()
366 ALIGN(hdr->ramdisk_size, hdr->page_size) >> 9, in rkfw_load_kernel()
370 ALIGN(hdr->ramdisk_size, hdr->page_size) >> 9, in rkfw_load_kernel()
373 if (ret != (ALIGN(hdr->ramdisk_size, hdr->page_size) >> 9)) { in rkfw_load_kernel()
418 if (hdr->second_size) { in rkfw_load_kernel()
423 ALIGN(hdr->second_size, hdr->page_size) >> 9, in rkfw_load_kernel()
425 if (ret != (ALIGN(hdr->second_size, hdr->page_size) >> 9)) { in rkfw_load_kernel()
450 ALIGN(hdr->dtb_size, hdr->page_size) >> 9, in rkfw_load_kernel()
452 if (ret != (ALIGN(hdr->dtb_size, hdr->page_size) >> 9)) { in rkfw_load_kernel()
467 free(hdr); in rkfw_load_kernel()