dual-image: Set priority for primary and secondary flash

Set priority to 0 for primary and 1 for secondary, whatever the BMC is
running on which flash.
This is done by checking the running slot and the functional state,
where:
* If the image is functional and the running slot is 0, it's primary;
* If the image is not function and the running slot is 1, it's primary;
* Other cases, it's secondary.

Tested: Verify the above behavior when BMC is running in primary flash
        and in secondary flash.

Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: Ifee67377c15f7f92772ccde34d8abffb986c5f1f
1 file changed