[PATCH 0/5] EFI Capsule "dfu_alt_info" fixes for TI Boards

Hello,
This series fixes the commits which introduced EFI Capsule support. The blamed commits unconditionally updated "dfu_alt_info" with the "dfu_string" corresponding to SPI Flash and therefore its associated partitions. While this addresses use-cases where the interface is indeed SPI Flash ("sf"), it breaks use-cases such as USB DFU Boot where the interface is RAM ("ram").
As of commit 52c0e5f8a3 Merge branch '2024-11-22-assorted-fixes' of the master branch of U-Boot, USB DFU Boot on AM625-SK is non-functional. Logs: https://gist.github.com/Siddharth-Vadapalli-at-TI/726854b49eb199f4acf7902821...
In order to fix this, update "dfu_alt_info" only if the interface is "sf".
The patch for AM62x in this series has been tested and it fixes USB DFU Boot on AM625-SK. Logs: https://gist.github.com/Siddharth-Vadapalli-at-TI/feaed5b0a30aff752306d37053...
Series is based on commit 52c0e5f8a3 Merge branch '2024-11-22-assorted-fixes' of the master branch of U-Boot.
Regards, Siddharth.
Siddharth Vadapalli (5): board: ti: am64x: evm: Set "dfu_alt_info" only if interface is SPI Flash board: ti: j721e: evm: Set "dfu_alt_info" only if interface is SPI Flash board: ti: am62x: evm: Set "dfu_alt_info" only if interface is SPI Flash board: ti: am62px: evm: Set "dfu_alt_info" only if interface is SPI Flash board: ti: j784s4: evm: Set "dfu_alt_info" only if interface is SPI Flash
board/ti/am62px/evm.c | 8 +++++++- board/ti/am62x/evm.c | 8 +++++++- board/ti/am64x/evm.c | 8 +++++++- board/ti/j721e/evm.c | 8 +++++++- board/ti/j784s4/evm.c | 8 +++++++- 5 files changed, 35 insertions(+), 5 deletions(-)

Commit 5b84d2de5e6c ("board: am64x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with SPI Flash. However, this breaks use-cases where the interface is not SPI Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
Fixes: 5b84d2de5e6c ("board: am64x: Define capsule update firmware info") Signed-off-by: Siddharth Vadapalli s-vadapalli@ti.com --- board/ti/am64x/evm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c index 00b8317d6b..e8132b8aa9 100644 --- a/board/ti/am64x/evm.c +++ b/board/ti/am64x/evm.c @@ -56,7 +56,13 @@ struct efi_capsule_update_info update_info = { #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) void set_dfu_alt_info(char *interface, char *devstr) { - if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) + /* + * Since the EFI Capsule support is enabled only for SPI Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (SPI Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

Commit 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with SPI Flash. However, this breaks use-cases where the interface is not SPI Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
Fixes: 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info") Signed-off-by: Siddharth Vadapalli s-vadapalli@ti.com --- board/ti/j721e/evm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c index 6221be9dcf..f7e181548c 100644 --- a/board/ti/j721e/evm.c +++ b/board/ti/j721e/evm.c @@ -67,7 +67,13 @@ struct efi_capsule_update_info update_info = { #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) void set_dfu_alt_info(char *interface, char *devstr) { - if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) + /* + * Since the EFI Capsule support is enabled only for SPI Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (SPI Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

Commit 2af879df86f8 ("board: am62x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with SPI Flash. However, this breaks use-cases where the interface is not SPI Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
Fixes: 2af879df86f8 ("board: am62x: Define capsule update firmware info") Signed-off-by: Siddharth Vadapalli s-vadapalli@ti.com --- board/ti/am62x/evm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c index 9075df01ca..3e5d6406ae 100644 --- a/board/ti/am62x/evm.c +++ b/board/ti/am62x/evm.c @@ -76,7 +76,13 @@ struct efi_capsule_update_info update_info = { #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) void set_dfu_alt_info(char *interface, char *devstr) { - if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) + /* + * Since the EFI Capsule support is enabled only for SPI Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (SPI Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

Commit 0af78a1a729d ("board: am62px: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with SPI Flash. However, this breaks use-cases where the interface is not SPI Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
Fixes: 0af78a1a729d ("board: am62px: Define capsule update firmware info") Signed-off-by: Siddharth Vadapalli s-vadapalli@ti.com --- board/ti/am62px/evm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c index 7362fa4520..1bfbc7ed4d 100644 --- a/board/ti/am62px/evm.c +++ b/board/ti/am62px/evm.c @@ -43,7 +43,13 @@ struct efi_capsule_update_info update_info = { #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) void set_dfu_alt_info(char *interface, char *devstr) { - if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) + /* + * Since the EFI Capsule support is enabled only for SPI Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (SPI Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

Commit a4d5e5daa847 ("board: sk-am69: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with SPI Flash. However, this breaks use-cases where the interface is not SPI Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
Fixes: a4d5e5daa847 ("board: sk-am69: Define capsule update firmware info") Signed-off-by: Siddharth Vadapalli s-vadapalli@ti.com --- board/ti/j784s4/evm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/board/ti/j784s4/evm.c b/board/ti/j784s4/evm.c index 548dbd5925..3699076a93 100644 --- a/board/ti/j784s4/evm.c +++ b/board/ti/j784s4/evm.c @@ -42,7 +42,13 @@ struct efi_capsule_update_info update_info = { #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO) void set_dfu_alt_info(char *interface, char *devstr) { - if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)) + /* + * Since the EFI Capsule support is enabled only for SPI Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (SPI Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

On Sun, Nov 24, 2024 at 10:45:29AM +0530, Siddharth Vadapalli wrote:
Kindly ignore this series. I had mistakenly assumed that "sf" was an abbreviation for SPI Flash. I found out later that it is an abbreviation for Serial Flash as indicated at: https://docs.u-boot.org/en/latest/usage/dfu.html#overview
I will change all references of "SPI Flash" to "Serial Flash" and post the v2 series.
Regards, Siddharth.
participants (2)
-
s-vadapalli
-
Siddharth Vadapalli