Re: [PATCH v6 05/13] stm32mp1: dk2: Add image information for capsule updates

2022-07-13 Thread Patrick DELAUNAY

Hi,

On 7/4/22 07:16, Sughosh Ganu wrote:

Enabling capsule update functionality on the platform requires
populating information on the images that are to be updated using the
functionality. Do so for the DK2 board.

Signed-off-by: Sughosh Ganu 
---
Changes since V5: None

  board/st/stm32mp1/stm32mp1.c   | 19 +++
  include/configs/stm32mp15_common.h |  4 
  2 files changed, 23 insertions(+)

diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 07b1a63db7..c6bb7562f6 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -11,6 +11,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -92,6 +93,16 @@ DECLARE_GLOBAL_DATA_PTR;
  #define USB_START_LOW_THRESHOLD_UV123
  #define USB_START_HIGH_THRESHOLD_UV   215
  
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)

+struct efi_fw_image fw_images[1];
+
+struct efi_capsule_update_info update_info = {
+   .images = fw_images,
+};
+
+u8 num_image_type_guids = ARRAY_SIZE(fw_images);
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
  int board_early_init_f(void)
  {
/* nothing to do, only used in SPL */
@@ -675,6 +686,14 @@ int board_init(void)
  
  	setup_led(LEDST_ON);
  
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)

+   if (board_is_dk2()) {
+   efi_guid_t image_type_guid = STM32MP1_DK2_FIP_IMAGE_GUID;


STM32MP15_DK2_FIP_IMAGE_GUID


+   guidcpy(_images[0].image_type_id, _type_guid);
+   fw_images[0].fw_name = u"STM32MP1-DK2-FIP";


fw_images[0].fw_name = u"STM32MP15-DK2-FIP";


+   fw_images[0].image_index = 5;
+   }
+#endif
return 0;
  }
  
diff --git a/include/configs/stm32mp15_common.h b/include/configs/stm32mp15_common.h

index 6b40cdb017..6a1ae9788d 100644
--- a/include/configs/stm32mp15_common.h
+++ b/include/configs/stm32mp15_common.h
@@ -54,6 +54,10 @@
  #define CONFIG_SYS_AUTOLOAD   "no"
  #endif
  
+#define STM32MP1_DK2_FIP_IMAGE_GUID \

+   EFI_GUID(0x19d5df83, 0x11b0, 0x457b, 0xbe, 0x2c, \
+0x75, 0x59, 0xc1, 0x31, 0x42, 0xa5)
+


#define STM32MP15_DK2_FIP_IMAGE_GUID \



  
/*/
  #ifdef CONFIG_DISTRO_DEFAULTS
  
/*/



with the modification s/STM32MP1/STM32MP15/

to avoid confusion with STM32MP13


Reviewed-by: Patrick Delaunay 

Thanks
Patrick




[PATCH v6 05/13] stm32mp1: dk2: Add image information for capsule updates

2022-07-03 Thread Sughosh Ganu
Enabling capsule update functionality on the platform requires
populating information on the images that are to be updated using the
functionality. Do so for the DK2 board.

Signed-off-by: Sughosh Ganu 
---
Changes since V5: None

 board/st/stm32mp1/stm32mp1.c   | 19 +++
 include/configs/stm32mp15_common.h |  4 
 2 files changed, 23 insertions(+)

diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c
index 07b1a63db7..c6bb7562f6 100644
--- a/board/st/stm32mp1/stm32mp1.c
+++ b/board/st/stm32mp1/stm32mp1.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -92,6 +93,16 @@ DECLARE_GLOBAL_DATA_PTR;
 #define USB_START_LOW_THRESHOLD_UV 123
 #define USB_START_HIGH_THRESHOLD_UV215
 
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[1];
+
+struct efi_capsule_update_info update_info = {
+   .images = fw_images,
+};
+
+u8 num_image_type_guids = ARRAY_SIZE(fw_images);
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_early_init_f(void)
 {
/* nothing to do, only used in SPL */
@@ -675,6 +686,14 @@ int board_init(void)
 
setup_led(LEDST_ON);
 
+#if CONFIG_IS_ENABLED(EFI_HAVE_CAPSULE_SUPPORT)
+   if (board_is_dk2()) {
+   efi_guid_t image_type_guid = STM32MP1_DK2_FIP_IMAGE_GUID;
+   guidcpy(_images[0].image_type_id, _type_guid);
+   fw_images[0].fw_name = u"STM32MP1-DK2-FIP";
+   fw_images[0].image_index = 5;
+   }
+#endif
return 0;
 }
 
diff --git a/include/configs/stm32mp15_common.h 
b/include/configs/stm32mp15_common.h
index 6b40cdb017..6a1ae9788d 100644
--- a/include/configs/stm32mp15_common.h
+++ b/include/configs/stm32mp15_common.h
@@ -54,6 +54,10 @@
 #define CONFIG_SYS_AUTOLOAD"no"
 #endif
 
+#define STM32MP1_DK2_FIP_IMAGE_GUID \
+   EFI_GUID(0x19d5df83, 0x11b0, 0x457b, 0xbe, 0x2c, \
+0x75, 0x59, 0xc1, 0x31, 0x42, 0xa5)
+
 /*/
 #ifdef CONFIG_DISTRO_DEFAULTS
 /*/
-- 
2.25.1