[PATCH v2 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 Serial Flash and therefore its associated partitions. While this addresses use-cases where the interface is indeed Serial 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.
v1 of this series is at: https://patchwork.ozlabs.org/project/uboot/list/?series=433959&state=%2A... Changes since v1: - Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
Siddharth Vadapalli (5): board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: j721e: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: am62x: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: am62px: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: j784s4: evm: Set "dfu_alt_info" only if interface is Serial 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 Serial Flash. However, this breaks use-cases where interface is not Serial 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 ---
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-2-s-v... Changes since v1: - Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..18f7770bc1 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 Serial Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (Serial Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit 5b84d2de5e6c ("board: am64x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-2-s-v... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..18f7770bc1 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))
Could you evaluate possibility of moving this function along with others to
board/ti/common/ area.
Regards
Udit
- /*
* Since the EFI Capsule support is enabled only for Serial Flash,
* update the "dfu_alt_info" environment variable only if the
* interface happens to be "sf" (Serial Flash).
*/
- if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) &&
env_set("dfu_alt_info", update_info.dfu_string); } #endif(strcmp(interface, "sf") == 0))

On Mon, Nov 25, 2024 at 09:27:50AM +0530, Kumar, Udit wrote:
On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit 5b84d2de5e6c ("board: am64x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-2-s-v... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..18f7770bc1 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))
Could you evaluate possibility of moving this function along with others to
board/ti/common/ area.
Sure, but that doesn't have to be tied to this fix. I will take a look at it independent of this series.
Regards, Siddharth.

On 11/25/2024 10:55 AM, Siddharth Vadapalli wrote:
On Mon, Nov 25, 2024 at 09:27:50AM +0530, Kumar, Udit wrote:
On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit 5b84d2de5e6c ("board: am64x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-2-s-v... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..18f7770bc1 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))
Could you evaluate possibility of moving this function along with others to
board/ti/common/ area.
Sure, but that doesn't have to be tied to this fix. I will take a look at it independent of this series.
Ok, Please take care in other series.
For this series
Acked-by: Udit Kumar u-kumar1@ti.com
Regards, Siddharth.

On 24/11/24 12:37, Siddharth Vadapalli wrote:
Commit 5b84d2de5e6c ("board: am64x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-2-s-v... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..18f7770bc1 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 Serial Flash,
* update the "dfu_alt_info" environment variable only if the
* interface happens to be "sf" (Serial Flash).
*/
- if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) &&
(strcmp(interface, "sf") == 0))
IIUC, EFI_HAVE_CAPSULE_SUPPORT is probably only functional at U-Boot proper and not at SPL (I dont see any SPL_EFI_* options), so would this work instead?
if (CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) { ... }
env_set("dfu_alt_info", update_info.dfu_string);
} #endif

On Tue, Nov 26, 2024 at 10:33:30AM +0530, Vignesh Raghavendra wrote:
Hello Vignesh,
[...]
- /*
* Since the EFI Capsule support is enabled only for Serial Flash,
* update the "dfu_alt_info" environment variable only if the
* interface happens to be "sf" (Serial Flash).
*/
- if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) &&
(strcmp(interface, "sf") == 0))
IIUC, EFI_HAVE_CAPSULE_SUPPORT is probably only functional at U-Boot proper and not at SPL (I dont see any SPL_EFI_* options), so would this work instead?
if (CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) { ... }
This works! Thank you for the suggestion.
Regards, Siddharth.

Commit 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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 ---
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-3-s-v... Changes since v1: - Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..ae24964ab9 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 Serial Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (Serial Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

Hi Siddharth
On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
I am not sure, if we are on same page.
Setting this dfu_alt_info on shell works for me
https://gist.github.com/uditkumarti/e5185838bcc32b47f5d9dae48eff72c9
Fixes: 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info") Signed-off-by: Siddharth Vadapalli s-vadapalli@ti.com
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-3-s-v... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..ae24964ab9 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 Serial Flash,
* update the "dfu_alt_info" environment variable only if the
* interface happens to be "sf" (Serial Flash).
*/
- if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) &&
env_set("dfu_alt_info", update_info.dfu_string); } #endif(strcmp(interface, "sf") == 0))

On Mon, Nov 25, 2024 at 09:27:08AM +0530, Kumar, Udit wrote:
Hi Siddharth
Hello Udit,
On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial Flash ("sf"). Fix this by setting "dfu_alt_info" only when the interface is "sf".
I am not sure, if we are on same page.
Setting this dfu_alt_info on shell works for me
https://gist.github.com/uditkumarti/e5185838bcc32b47f5d9dae48eff72c9
The fix is for DFU Boot i.e. loading tiboot3.bin, tispl.bin and u-boot.img via USB DFU Boot. Please refer to the cover letter for details on the issue observed when attempting to boot AM625-SK via USB DFU Boot.
Regards, Siddharth.

Commit 2af879df86f8 ("board: am62x: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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 ---
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-4-s-v... Changes since v1: - Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..1839ed206c 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 Serial Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (Serial 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 Serial Flash. However, this breaks use-cases where interface is not Serial 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 ---
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-5-s-v... Changes since v1: - Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..3c3c58fb8f 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 Serial Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (Serial 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 Serial Flash. However, this breaks use-cases where interface is not Serial 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 ---
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-6-s-v... Changes since v1: - Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..d915aee48f 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 Serial Flash, + * update the "dfu_alt_info" environment variable only if the + * interface happens to be "sf" (Serial Flash). + */ + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) && + (strcmp(interface, "sf") == 0)) env_set("dfu_alt_info", update_info.dfu_string); } #endif

Hi Siddharth
On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit a4d5e5daa847 ("board: sk-am69: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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
AFAIR, DFU in general is not enabled on J784S4
Can i request to enable DFU along with this update.
v1: https://patchwork.ozlabs.org/project/uboot/patch/20241124051545.382397-6-s-v... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
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..d915aee48f 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 Serial Flash,
* update the "dfu_alt_info" environment variable only if the
* interface happens to be "sf" (Serial Flash).
*/
- if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT) &&
env_set("dfu_alt_info", update_info.dfu_string); } #endif(strcmp(interface, "sf") == 0))

On Mon, Nov 25, 2024 at 09:29:01AM +0530, Kumar, Udit wrote:
Hi Siddharth
On 11/24/2024 12:37 PM, Siddharth Vadapalli wrote:
Commit a4d5e5daa847 ("board: sk-am69: Define capsule update firmware info") updated the "dfu_alt_info" variable to support use-cases with Serial Flash. However, this breaks use-cases where interface is not Serial 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
AFAIR, DFU in general is not enabled on J784S4
Yes, it is not yet enabled.
Can i request to enable DFU along with this update.
This series is a pre-requisite for enabling/fixing USB DFU boot on various devices. I will be enabling USB DFU boot on all TI K3 Boards, but again, that doesn't have to be tied to this series and can be done independently. This series is a fix, while enabling USB DFU boot on devices is a new feature. So I don't think that the feature *has* to be enabled along with this series.
Regards, Siddharth.

Siddharth Vadapalli s-vadapalli@ti.com writes:
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 Serial Flash and therefore its associated partitions. While this addresses use-cases where the interface is indeed Serial 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".
Hi Siddharth, this is an issue that I also discovered while working on a separate issue with Collabora, but haven't posted a patch yet. The issue is that when DFU booting, spl_dfu_cmd() will setup it's own value for dfu_alt_info before calling run_dfu(). In our existing code, however, this will get overridden by set_dfu_alt_info(). This issue isn't specific to TI boards.
Can you try this patch to drivers/dfu/dfu.c to see if it solves the problems you are seeing:
@@ -153,10 +153,11 @@ int dfu_init_env_entities(char *interface, char *devstr)
dfu_reinit_needed = false;
+ str_env = env_get("dfu_alt_info"); #ifdef CONFIG_SET_DFU_ALT_INFO - set_dfu_alt_info(interface, devstr); + if (!str_env) { + set_dfu_alt_info(interface, devstr); + str_env = env_get("dfu_alt_info"); + } #endif - str_env = env_get("dfu_alt_info"); if (!str_env) { pr_err(""dfu_alt_info" env variable not defined!\n"); return -EINVAL;
thanks Jon
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.
v1 of this series is at: https://patchwork.ozlabs.org/project/uboot/list/?series=433959&state=%2A... Changes since v1:
- Replaced "SPI Flash" with "Serial Flash" everywhere.
Regards, Siddharth.
Siddharth Vadapalli (5): board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: j721e: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: am62x: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: am62px: evm: Set "dfu_alt_info" only if interface is Serial Flash board: ti: j784s4: evm: Set "dfu_alt_info" only if interface is Serial 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(-)
-- 2.43.0

On Mon, Nov 25, 2024 at 07:51:54PM -0600, Jon Humphreys wrote:
Hello Jon,
[...]
Hi Siddharth, this is an issue that I also discovered while working on a separate issue with Collabora, but haven't posted a patch yet. The issue is that when DFU booting, spl_dfu_cmd() will setup it's own value for dfu_alt_info before calling run_dfu(). In our existing code, however, this will get overridden by set_dfu_alt_info(). This issue isn't specific to TI boards.
Can you try this patch to drivers/dfu/dfu.c to see if it solves the problems you are seeing:
@@ -153,10 +153,11 @@ int dfu_init_env_entities(char *interface, char *devstr)
dfu_reinit_needed = false;
- str_env = env_get("dfu_alt_info");
#ifdef CONFIG_SET_DFU_ALT_INFO
- set_dfu_alt_info(interface, devstr);
- if (!str_env) {
- set_dfu_alt_info(interface, devstr);
- str_env = env_get("dfu_alt_info");
- }
#endif
- str_env = env_get("dfu_alt_info"); if (!str_env) { pr_err(""dfu_alt_info" env variable not defined!\n"); return -EINVAL;
Yes, this patch fixes the issue. Do you plan to post this patch? Or has it already been posted and is under discussion? Please let me know.
Regards, Siddharth.

Siddharth Vadapalli s-vadapalli@ti.com writes:
On Mon, Nov 25, 2024 at 07:51:54PM -0600, Jon Humphreys wrote:
Hello Jon,
[...]
Hi Siddharth, this is an issue that I also discovered while working on a separate issue with Collabora, but haven't posted a patch yet. The issue is that when DFU booting, spl_dfu_cmd() will setup it's own value for dfu_alt_info before calling run_dfu(). In our existing code, however, this will get overridden by set_dfu_alt_info(). This issue isn't specific to TI boards.
Can you try this patch to drivers/dfu/dfu.c to see if it solves the problems you are seeing:
@@ -153,10 +153,11 @@ int dfu_init_env_entities(char *interface, char *devstr)
dfu_reinit_needed = false;
- str_env = env_get("dfu_alt_info");
#ifdef CONFIG_SET_DFU_ALT_INFO
- set_dfu_alt_info(interface, devstr);
- if (!str_env) {
- set_dfu_alt_info(interface, devstr);
- str_env = env_get("dfu_alt_info");
- }
#endif
- str_env = env_get("dfu_alt_info"); if (!str_env) { pr_err(""dfu_alt_info" env variable not defined!\n"); return -EINVAL;
Yes, this patch fixes the issue. Do you plan to post this patch? Or has it already been posted and is under discussion? Please let me know.
no patch posted yet, but I will do that next week.
Jon
Regards, Siddharth.

On Thu, Nov 28, 2024 at 12:09:41AM -0600, Jon Humphreys wrote:
Hello Jon,
Siddharth Vadapalli s-vadapalli@ti.com writes:
On Mon, Nov 25, 2024 at 07:51:54PM -0600, Jon Humphreys wrote:
Hello Jon,
[...]
Hi Siddharth, this is an issue that I also discovered while working on a separate issue with Collabora, but haven't posted a patch yet. The issue is that when DFU booting, spl_dfu_cmd() will setup it's own value for dfu_alt_info before calling run_dfu(). In our existing code, however, this will get overridden by set_dfu_alt_info(). This issue isn't specific to TI boards.
Can you try this patch to drivers/dfu/dfu.c to see if it solves the problems you are seeing:
@@ -153,10 +153,11 @@ int dfu_init_env_entities(char *interface, char *devstr)
dfu_reinit_needed = false;
- str_env = env_get("dfu_alt_info");
#ifdef CONFIG_SET_DFU_ALT_INFO
- set_dfu_alt_info(interface, devstr);
- if (!str_env) {
- set_dfu_alt_info(interface, devstr);
- str_env = env_get("dfu_alt_info");
- }
#endif
- str_env = env_get("dfu_alt_info"); if (!str_env) { pr_err(""dfu_alt_info" env variable not defined!\n"); return -EINVAL;
Yes, this patch fixes the issue. Do you plan to post this patch? Or has it already been posted and is under discussion? Please let me know.
no patch posted yet, but I will do that next week.
Since this fix is required not only for AM62x, but also for AM62Px, I have included the fix as a patch with your authorship in my series for enabling USB DFU Boot on AM62Px at: https://patchwork.ozlabs.org/project/uboot/cover/20241217131658.2920799-1-s-...
I have copied you in the series. Please review the patch (and the series also if possible) and share your feedback in case of any concerns with either the commit message or the changes made in that patch.
Regards, Siddharth.
participants (4)
-
Jon Humphreys
-
Kumar, Udit
-
Siddharth Vadapalli
-
Vignesh Raghavendra