rom_pick_ab_partition() function
Pick a partition from an A/B pair Determines which of the partitions has the "better" IMAGE_DEF. In the case of executable images, this is the one that would be booted This method potentially requires similar complexity to the boot path in terms of picking amongst versions, checking signatures etc. As a result it requires a user provided memory buffer as a work area. The work area should bye word aligned, and of sufficient size or BOOTROM_ERROR_INSUFFICIENT_RESOURCES will be returned. The work area size currently required is 3064, so 3K is a good choice. The passed partition number can be any valid partition number other than the "B" partition of an A/B pair. This method returns a negative error code, or the partition number of the picked partition if (i.e. partition_a_num or the number of its "B" partition if any). NOTE: This method does not look at owner partitions, only the A partition passed and it's corresponding B partition.
Arguments
workarea_base
base address of work area
workarea_size
size of work area
partition_a_num
the A partition of the pair
flash_update_boot_window_base
the flash update base, to pick that partition instead of the normally "better" partition