Skip to contentSkip to conversation

EFI Capsule "dfu_alt_info" fixes for TI Boards

PATCH In review Siddharth Vadapalli 4 participants 19 messages Nov 24, 2024 – Dec 17, 2024

lore
Share & tools
lore
#0 lore raw

v2 cover 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/726854b49eb199f4acf79028212fabdc

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/feaed5b0a30aff752306d370531a4e10

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&archive=both
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(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 1/5 board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am64x/evm.c +7 -1
index 00b8317d6b..18f7770bc1 100644
@@ -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
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH v2 1/5] board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash

Quoted 25 lines · Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am64x/evm.c +0 -0
index 00b8317d6b..18f7770bc1 100644

board/ti/am64x/evm.c struct efi_capsule_update_info update_info = { · line 59

Quoted 4 lines
board/ti/am64x/evm.c +0 -1
@@ -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

Quoted 10 lines
board/ti/am64x/evm.c +7 -0
+	/*
+	 * 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
#3 lore raw

Re: [PATCH v2 1/5] board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash

Quoted 33 lines · Udit
Quoted 25 lines · Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am64x/evm.c +0 -0
index 00b8317d6b..18f7770bc1 100644

board/ti/am64x/evm.c struct efi_capsule_update_info update_info = { · line 59

Quoted 4 lines
board/ti/am64x/evm.c +0 -1
@@ -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

Quoted 1 line

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.

Acked-by
#4 lore raw

Re: [PATCH v2 1/5] board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash

Quoted 33 lines · Siddharth Vadapalli
Quoted 32 lines · Udit
Quoted 25 lines · Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am64x/evm.c +0 -0
index 00b8317d6b..18f7770bc1 100644

board/ti/am64x/evm.c struct efi_capsule_update_info update_info = { · line 59

Quoted 4 lines
board/ti/am64x/evm.c +0 -1
@@ -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

Quoted 3 lines
Quoted 1 line

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

Quoted 3 lines

Regards,
Siddharth.

#5 lore raw

Re: [PATCH v2 1/5] board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash

In reply to Siddharth Vadapalli
Quoted 26 lines · Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am64x/evm.c +0 -0
index 00b8317d6b..18f7770bc1 100644
@@ -56,7 +56,13 @@ struct efi_capsule_update_info update_info = {
 #if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)

board/ti/am64x/evm.c struct efi_capsule_update_info update_info = { · line 65

Quoted 10 lines
board/ti/am64x/evm.c +7 -1
 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) {
		...
	}
Quoted 3 lines
board/ti/am64x/evm.c +0 -0
 		env_set("dfu_alt_info", update_info.dfu_string);
 }
 #endif
Signature · 3 lines
Regards
Vignesh
https://ti.com/opensource
#6 lore raw

Re: [PATCH v2 1/5] board: ti: am64x: evm: Set "dfu_alt_info" only if interface is Serial Flash

On Tue, Nov 26, 2024 at 10:33:30AM +0530, Vignesh Raghavendra wrote:

Hello Vignesh,

[...]

Quoted 12 lines

board/ti/am64x/evm.c struct efi_capsule_update_info update_info = { · line 65

Quoted 7 lines
board/ti/am64x/evm.c +7 -0
+	/*
+	 * 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?

Quoted 3 lines
	if (CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT) {
		...
	}

This works! Thank you for the suggestion.

Regards,
Siddharth.

#7 lore raw

PATCH v2 2/5 board: ti: j721e: evm: Set "dfu_alt_info" only if interface is Serial Flash

In reply to Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/j721e/evm.c +7 -1
index 6221be9dcf..ae24964ab9 100644
@@ -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
Signature · 1 line
2.43.0
#8 lore raw

Re: [PATCH v2 2/5] board: ti: j721e: evm: Set "dfu_alt_info" only if interface is Serial Flash

Hi Siddharth

Quoted 4 lines · Siddharth Vadapalli

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

Quoted 34 lines
Fixes 9bd6cc292fa8 ("board: j721e: Define capsule update firmware info")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/j721e/evm.c +7 -1
index 6221be9dcf..ae24964ab9 100644
@@ -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
#9 lore raw

Re: [PATCH v2 2/5] board: ti: j721e: evm: Set "dfu_alt_info" only if interface is Serial Flash

Quoted 1 line · Udit

Hi Siddharth

Hello Udit,

Quoted 8 lines · Siddharth Vadapalli
Quoted 4 lines

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".

Quoted 5 lines

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.

#10 lore raw

PATCH v2 3/5 board: ti: am62x: evm: Set "dfu_alt_info" only if interface is Serial Flash

In reply to Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am62x/evm.c +7 -1
index 9075df01ca..1839ed206c 100644
@@ -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
Signature · 1 line
2.43.0
#11 lore raw

PATCH v2 4/5 board: ti: am62px: evm: Set "dfu_alt_info" only if interface is Serial Flash

In reply to Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/am62px/evm.c +7 -1
index 7362fa4520..3c3c58fb8f 100644
@@ -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
Signature · 1 line
2.43.0
#12 lore raw

PATCH v2 5/5 board: ti: j784s4: evm: Set "dfu_alt_info" only if interface is Serial Flash

In reply to Siddharth Vadapalli

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")

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/j784s4/evm.c +7 -1
index 548dbd5925..d915aee48f 100644
@@ -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
Signature · 1 line
2.43.0
#13 lore raw

Re: [PATCH v2 5/5] board: ti: j784s4: evm: Set "dfu_alt_info" only if interface is Serial Flash

Hi Siddharth

Quoted 7 lines · Siddharth Vadapalli

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")

AFAIR, DFU in general is not enabled on J784S4

Can i request to enable DFU along with this update.

Quoted 32 lines

---

v1:
https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/
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(-)
board/ti/j784s4/evm.c +7 -1
index 548dbd5925..d915aee48f 100644
@@ -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
#14 lore raw

Re: [PATCH v2 5/5] board: ti: j784s4: evm: Set "dfu_alt_info" only if interface is Serial Flash

Quoted 8 lines · Udit

Hi Siddharth

Quoted 5 lines · Siddharth Vadapalli

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".

Quoted 5 lines
Quoted 2 lines
Fixes a4d5e5daa847 ("board: sk-am69: Define capsule update firmware info")

AFAIR, DFU in general is not enabled on J784S4

Yes, it is not yet enabled.

Quoted 2 lines

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.

#15 lore raw
In reply to Siddharth Vadapalli
Quoted 9 lines · Siddharth Vadapalli

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").

Quoted 8 lines

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/726854b49eb199f4acf79028212fabdc

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

Quoted 38 lines

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/feaed5b0a30aff752306d370531a4e10

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&archive=both
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(-)
Signature · 1 line
2.43.0
#16 lore raw

On Mon, Nov 25, 2024 at 07:51:54PM -0600, Jon Humphreys wrote:

Hello Jon,

[...]

Quoted 18 lines

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:

(quoted diff) +1 -0
@@ -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

Review int dfu_init_env_entities(char *interface, char

Quoted 10 lines
(quoted diff) +4 -2
- 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.

#17 lore raw
Quoted 22 lines · Siddharth Vadapalli

On Mon, Nov 25, 2024 at 07:51:54PM -0600, Jon Humphreys wrote:

Hello Jon,

[...]

Quoted 16 lines

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:

(quoted diff) +0 -0
@@ -153,10 +153,11 @@ int dfu_init_env_entities(char *interface, char
 *devstr)
 
  dfu_reinit_needed = false;
 
Quoted 16 lines

Review int dfu_init_env_entities(char *interface, char

Quoted 12 lines
(quoted diff) +5 -2
+ 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

Quoted 2 lines

Regards,
Siddharth.

#18 lore raw

On Thu, Nov 28, 2024 at 12:09:41AM -0600, Jon Humphreys wrote:

Hello Jon,

Quoted 41 lines
Quoted 22 lines · Siddharth Vadapalli

On Mon, Nov 25, 2024 at 07:51:54PM -0600, Jon Humphreys wrote:

Hello Jon,

[...]

Quoted 16 lines

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:

(quoted diff) +0 -0
@@ -153,10 +153,11 @@ int dfu_init_env_entities(char *interface, char
 *devstr)
 
  dfu_reinit_needed = false;
 
Quoted 16 lines

Review int dfu_init_env_entities(char *interface, char

Quoted 12 lines
(quoted diff) +5 -2
+ 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.

Quoted 1 line

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/[email protected]/

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.