@@ -102,6 +102,7 @@ static void board_get_alt_info_mtd(struct mtd_info *mtd, char *buf)
void set_dfu_alt_info(char *interface, char *devstr)
{
+ int len;
struct udevice *dev;
struct mtd_info *mtd;
@@ -112,9 +113,6 @@ void set_dfu_alt_info(char *interface, char *devstr)
memset(buf, 0, sizeof(buf));
- snprintf(buf, DFU_ALT_BUF_LEN,
- "ram 0=%s", CONFIG_DFU_ALT_RAM0);
-
if (CONFIG_IS_ENABLED(MMC)) {
if (!uclass_get_device(UCLASS_MMC, 0, &dev))
board_get_alt_info_mmc(dev, buf);
@@ -151,6 +149,13 @@ void set_dfu_alt_info(char *interface, char *devstr)
strncat(buf, "&virt 1=PMIC", DFU_ALT_BUF_LEN);
}
+ len = strlen(buf);
+ if (buf[0] != '\0')
+ len += snprintf(buf + len, DFU_ALT_BUF_LEN - len, "&");
+
+ snprintf(buf + len, DFU_ALT_BUF_LEN,
+ "ram 0=%s", CONFIG_DFU_ALT_RAM0);
+
env_set("dfu_alt_info", buf);
puts("DFU alt info setting: done\n");
}
With the FWU multi bank update feature enabled, the dfu alt no that is used to identify the partition to be updated is derived at runtime and should match the partition number on the storage media. Achieve this by moving the ram partitions to the end of the dfu_alt_info variable. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> --- board/st/common/stm32mp_dfu.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)