Hi Sumit,
+/** + * qcom_configure_capsule_updates() - Configure the DFU string for capsule updates + * + * U-Boot is flashed to the boot partition on Qualcomm boards. In most cases there + * are two boot partitions, boot_a and boot_b. As we don't currently support doing + * full A/B updates, we only support updating the currently active boot partition. + * + * So we need to find the current slot suffix and the associated boot partition. + * We do this by looking for the boot partition that has the 'active' flag set + * in the GPT partition vendor attribute bits. + */ +void qcom_configure_capsule_updates(void) +{ + struct blk_desc *desc; + int ret = 0, partnum = -1, devnum; + static char dfu_string[32] = { 0 }; + char name[32]; /* GPT partition name */ + char *partname = "boot"; + struct udevice *dev = NULL; + + /* + * There is currently no good way to check how U-Boot is booting, but we have + * a few hueristics, like here checking if our DTB has a kaslr-seed specified + * will tell us if we were chainloaded by another bootloader. + * FIXME: we should do this check once and use some proper API to expose the data.If U-Boot is built with LINUX_KERNEL_IMAGE_HEADER enabled then we should know that U-Boot is built as a replacement of Linux kernel and hence chainloaded. Isn't that what you need here?
Not necessarily, you can build with LINUX_KERNEL_IMAGE_HEADER and then pack U-Boot into XBL or flash it to hyp and it will still run (the kernel header is specifically written to behave like a nop slide). So we can't rely on this.
-Sumit
Kind regards, -- // Caleb (they/them)

