Lines Matching full:region

70  * get_region() - Get information about the selected region
72 * @frba: Flash region list
73 * @region_type: Type of region (0..MAX_REGIONS-1)
74 * @region: Region information is written here
78 struct region_t *region) in get_region() argument
81 fprintf(stderr, "Invalid region type.\n"); in get_region()
85 region->base = FLREG_BASE(frba->flreg[region_type]); in get_region()
86 region->limit = FLREG_LIMIT(frba->flreg[region_type]); in get_region()
87 region->size = region->limit - region->base + 1; in get_region()
124 struct region_t region; in dump_region() local
127 ret = get_region(frba, num, &region); in dump_region()
131 printf(" Flash Region %d (%s): %08x - %08x %s\n", in dump_region()
132 num, region_name(num), region.base, region.limit, in dump_region()
133 region.size < 1 ? "(unused)" : ""); in dump_region()
142 printf("Found Region Section\n"); in dump_frba()
243 printf(" Platform Data Region Write Access: %s\n", in decode_flmstr()
245 printf(" GbE Region Write Access: %s\n", in decode_flmstr()
247 printf(" Intel ME Region Write Access: %s\n", in decode_flmstr()
249 printf(" Host CPU/BIOS Region Write Access: %s\n", in decode_flmstr()
254 printf(" Platform Data Region Read Access: %s\n", in decode_flmstr()
256 printf(" GbE Region Read Access: %s\n", in decode_flmstr()
258 printf(" Intel ME Region Read Access: %s\n", in decode_flmstr()
260 printf(" Host CPU/BIOS Region Read Access: %s\n", in decode_flmstr()
429 * write_regions() - Write each region from an image to its own file
451 struct region_t region; in write_regions() local
454 ret = get_region(frba, i, &region); in write_regions()
458 if (region.size <= 0) in write_regions()
463 if (write(region_fd, image + region.base, region.size) != in write_regions()
464 region.size) { in write_regions()
567 * TODO: Dynamically take Platform Data Region and GbE Region into in lock_descriptor()
616 * inject_region() - Add a file to an image region
618 * This puts a file into a particular region of the flash. Several pre-defined
623 * @region_type: Region where the file should be added
630 struct region_t region; in inject_region() local
641 ret = get_region(frba, region_type, &region); in inject_region()
644 if (region.size <= 0xfff) { in inject_region()
645 fprintf(stderr, "Region %s is disabled in target. Not injecting.\n", in inject_region()
654 if ((region_size > region.size) || in inject_region()
655 ((region_type != 1) && (region_size > region.size))) { in inject_region()
656 fprintf(stderr, "Region %s is %d(0x%x) bytes. File is %d(0x%x) bytes. Not injecting.\n", in inject_region()
657 region_name(region_type), region.size, in inject_region()
658 region.size, region_size, region_size); in inject_region()
662 if ((region_type == 1) && (region_size < region.size)) { in inject_region()
663 …fprintf(stderr, "Region %s is %d(0x%x) bytes. File is %d(0x%x) bytes. Padding before injecting.\n", in inject_region()
664 region_name(region_type), region.size, in inject_region()
665 region.size, region_size, region_size); in inject_region()
666 offset = region.size - region_size; in inject_region()
667 memset(image + region.base, 0xff, offset); in inject_region()
670 if (size < region.base + offset + region_size) { in inject_region()
672 size, region.base + offset + region_size); in inject_region()
676 if (read(region_fd, image + region.base + offset, region_size) in inject_region()
691 * write_data() - Write some raw data into a region
721 fprintf(stderr, "U-Boot image overlaps with region '%s'\n", in write_data()
730 fprintf(stderr, "U-Boot image overlaps with region '%s'\n", in write_data()
769 " -i | --inject <region>:<module> inject file <module> into region <region>\n" in print_usage()
775 " -l | --lock Lock firmware descriptor and ME region\n" in print_usage()
776 " -u | --unlock Unlock firmware descriptor and ME region\n" in print_usage()
782 "<region> is one of Descriptor, BIOS, ME, GbE, Platform\n" in print_usage()
886 fprintf(stderr, "No such region type: '%s'\n\n", in main()