Re: [PATCH v2 02/16] board: am64x: Define capsule update firmware info

2024-04-08 Thread Heinrich Schuchardt

On 4/9/24 00:31, Jonathan Humphreys wrote:

Define the firmwares updatable via EFI capsule update.


Nits:

%s/firmwares/firmware/ (firmware is uncountable).



Signed-off-by: Jonathan Humphreys 
---
  board/ti/am64x/evm.c | 33 +
  1 file changed, 33 insertions(+)

diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
index b8de69da06c..876c5c25d42 100644
--- a/board/ti/am64x/evm.c
+++ b/board/ti/am64x/evm.c
@@ -7,6 +7,7 @@
   *
   */

+#include 
  #include 
  #include 
  #include 
@@ -27,6 +28,38 @@

  DECLARE_GLOBAL_DATA_PTR;

+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 10;tispl.bin raw 10 
20;u-boot.img raw 30 40",


Is TI using other addresses than Phytec?

doc/board/phytec/phycore-am64x.rst:

  fatload mmc 1 ${loadaddr} tiboot3.bin
  sf update $loadaddr 0x0 $filesize
  fatload mmc 1 ${loadaddr} tispl.bin
  sf update $loadaddr 0x8 $filesize
  fatload mmc 1 ${loadaddr} u-boot.img
  sf update $loadaddr 0x28 $filesize

Please, add documentation in doc/board/ for all boards in the series
specifying the location of the firmware in flash memory and how to
update it(cf. section OSPI in doc/board/ti/am65x_evm.rst).


+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};


The series has been assigned to me in Patchwork.

But changes should be tested and reviewed by the respective board
maintainers (Vignesh, Tom for AM64x) as I have no access to TI boards.

Best regards

Heinrich


+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
  int board_init(void)
  {
return 0;




Re: [PATCH v2 01/16] board: Define GUIDs for firmware images

2024-04-08 Thread Heinrich Schuchardt

On 4/9/24 00:31, Jonathan Humphreys wrote:

Define GUIDs for the different firmware images (tiboot3.bin, tispl.bin,
u-boot.img, sysfw). >
Signed-off-by: Jonathan Humphreys 
---
  include/configs/ti_armv7_common.h | 17 +
  1 file changed, 17 insertions(+)

diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index 3def7b1027e..4ce14a9b84c 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -16,6 +16,23 @@
  #ifndef __CONFIG_TI_ARMV7_COMMON_H__
  #define __CONFIG_TI_ARMV7_COMMON_H__

+/* GUIDs for capsule updatable firmware images */


Please, provide code comments for the GUIDs, e.g.

/**
 * define K3_TIBOOT3_IMAGE_GUID - firmware GUID for K3 tiboot3.bin
 *
 * This GUID is used in capsules updates to identify the tiboot3.bin
 * binary.
 */

Cf.
https://docs.kernel.org/doc-guide/kernel-doc.html#object-like-macro-documentation

Best regards

Heinrich


+#define K3_TIBOOT3_IMAGE_GUID \
+   EFI_GUID(0xe672b518, 0x7cd7, 0x4014, 0xbd, 0x8d, \
+0x40, 0x72, 0x4d, 0x0a, 0xd4, 0xdc)
+
+#define K3_SPL_IMAGE_GUID \
+   EFI_GUID(0x86f710ad, 0x10cf, 0x46ea, 0xac, 0x67, \
+0x85, 0x6a, 0xe0, 0x6e, 0xfa, 0xd2)
+
+#define K3_UBOOT_IMAGE_GUID \
+   EFI_GUID(0x81b58fb0, 0x3b00, 0x4add, 0xa2, 0x0a, \
+0xc1, 0x85, 0xbb, 0xac, 0xa1, 0xed)
+
+#define K3_SYSFW_IMAGE_GUID \
+   EFI_GUID(0x6fd10680, 0x361b, 0x431f, 0x80, 0xaa, \
+0x89, 0x94, 0x55, 0x81, 0x9e, 0x11)
+
  /*
   * We setup defaults based on constraints from the Linux kernel, which should
   * also be safe elsewhere.  We have the default load at 32MB into DDR (for




Re: [PATCH 01/13] ti:keys Add EFI signature list

2024-04-08 Thread Heinrich Schuchardt

On 4/8/24 23:33, Jonathan Humphreys wrote:

EFI signature list using TI dummy keys.


Adding vendor public keys into the code base to lock down generated
binaries to the vendors unpublished private key does not match well with
the intent of the GNU public license.

Best regards

Heinrich



Signed-off-by: Jonathan Humphreys 
---
  arch/arm/mach-k3/keys/custMpk.esl | Bin 0 -> 1523 bytes
  1 file changed, 0 insertions(+), 0 deletions(-)
  create mode 100644 arch/arm/mach-k3/keys/custMpk.esl

diff --git a/arch/arm/mach-k3/keys/custMpk.esl 
b/arch/arm/mach-k3/keys/custMpk.esl
new file mode 100644
index 
..2feb704e0a5fd126410de451d3c0fa4d3edccc52
GIT binary patch
literal 1523
zcmZ1^?2Da*aux2_hA(f&~MnUw(yu0v@E4?-F=u^u*PVqVQ8QZ((-^A*$m*Kg7c
z&78AJODc2mtxpELY@Awc9)w85y}*84Mcd8gd(OvN4CUun9AT2E#ZUJWL@GhWtR)
zKpA!(HkZVloWx>7bput902hy3NNPo5v4Uq_aY<2WZfaf$h@G5YRFGekSdyAzC~P1I
zQpnB26;PC)oLXF*UsMbeWai-t@l*_blshP#N9QH-w`BJNO+QS$x7=il`0?bc6sZ`Vxxl^6N{>i2E;SY*4-T$+0G;)5dxe+2CR
z@4+)sDPWdQb@%6KTpDVdm)v}?GSpG(w_UV)+#e3fJowDZO)JR83lIcbw(hMu}}Y
z2ZZwYAI-LVx@^G;HdkgxaX_l3&{H|3l7uX@Vl5di{>fQQ{pDynFlySp2(z~g)
z{LIBUzm_CMw_SIFfPdcT#zmg6g{#b(Lp`M3Uj
zGOKycyEe+n{G(Rmg}jB!)0ySk-!kkj_R7#OT+}pcG0VXh?f+ftRvnyw#hUea^Iyfn
ze|zgKPKrqe@jYWU?v<50X(n^lZ*G%j$JyCh`*Px|H*K=2WXP)hx>jng+}Q}N^KoDN
z8dh8T-~Dmrp2?yk3O6Gqbz7O@W=dcRVPvS;*B%(4`P|iK>Vg$XDgN9sr}Df{
z7X0es=RPHr8RB+*)}q}h%gn?x9PO4y*Qog};xRCb9PcXWpE>
zKlQ}fzw*izXI|}|r!O*nb#VhHRn;B`1LC^xvIctvLCYhRA_6yCS~2&!0SH1xwv(O~+5t
z^|E$S{MM^8j9J5`sQ6pud{2Lz?k`zncbjvHj%eutjusUol}8;%cbPLCO|e;ZJ^tXe
z_N{pmM}uCi3UWO3=hMciTPl?N16Xv@buq_d@TU`uX0_s{?
zt`1&)Tk-yb?sKMPI~!}xt*d*!tMat!r1`}jul#i@lDB8rnu>ba_-^4!iQ5{|tb3TX
z>fTMIw2!Me3{Dw*WZotC<4@h



Re: [PATCH 00/13] EFI: capsule: ti: enable authenticated capsules

2024-04-08 Thread Heinrich Schuchardt

On 4/8/24 23:33, Jonathan Humphreys wrote:

Create an EFI signature list (.esl) file based on the TI dummy key.
Enable capsule authentication for several TI SoC based platforms: AM64, AM62,
AM62p, BeaglePlay, J7, and BeagleboneAI.


Hello Jonathan,

with the patch a capsule update will not be possible if the capsule is
not signed with the private key matching the ESL signature key in patch
1/13.

Why should a user want to lock down their board to a private key over
which he has no control? Wouldn't it be in their best interest to create
a key pair themselves?

I would have expected a documentation change explaining this to the users.

Best regards

Heinrich



Jonathan Humphreys (13):
   ti:keys Add EFI signature list
   configs: am64x: Set capsule update signature list file
   configs: am64x: Enable capsule authentication
   configs: j721e: Set capsule update signature list file
   configs: j721e: Enable capsule authentication
   configs: beagleplay: Set capsule update signature list file
   configs: beagleplay: Enable capsule authentication
   configs: am62px: Set capsule update signature list file
   configs: am62px: Enable capsule authentication
   configs: am62x: Set capsule update signature list file
   configs: am62x: Enable capsule authentication
   configs: beagleboneai64: Set capsule update signature list file
   configs: beagleboneai64: Enable capsule authentication

  arch/arm/mach-k3/keys/custMpk.esl  | Bin 0 -> 1523 bytes
  configs/am62px_evm_a53_defconfig   |   2 ++
  configs/am62x_beagleplay_a53_defconfig |   2 ++
  configs/am62x_evm_a53_defconfig|   2 ++
  configs/am64x_evm_a53_defconfig|   2 ++
  configs/j721e_beagleboneai64_a72_defconfig |   2 ++
  configs/j721e_evm_a72_defconfig|   2 ++
  7 files changed, 12 insertions(+)
  create mode 100644 arch/arm/mach-k3/keys/custMpk.esl





Re: [PATCH] mtd: spi-nor: Add support for Infineon S25FS-S family

2024-04-08 Thread Takahiro Kuwano
On 4/5/2024 7:10 PM, Pratyush Yadav wrote:
> Hi,
> 
> Just a couple small comments. Looks good otherwise.
> 
> On Fri, Apr 05 2024, tkuw584...@gmail.com wrote:
> 
>> From: Takahiro Kuwano 
>>
>> The S25FS064S, S25FS128S, and S25FS256S are the same family of SPI NOR
>> Flash devices with S25FS512S. Some difference depending on the device
>> densities are taken care in fixup hooks.
>>
>> Signed-off-by: Takahiro Kuwano 
>> ---
>> Datasheets:
>> https://www.infineon.com/dgdl/Infineon-S25FS064S_64_Mb_8_MB_FS-S_Flash_SPI_Multi-I_O_1-DataSheet-v10_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed526b25412
>> https://www.infineon.com/dgdl/Infineon-S25FS128S_S25FS256S_1.8_V_Serial_Peripheral_Interface_with_Multi-I_O_MirrorBit(R)_Non-Volatile_Flash-DataSheet-v15_00-EN.pdf?fileId=8ac78c8c7d0d8da4017d0ed6b5ab5758
>> ---
>>  drivers/mtd/spi/spi-nor-core.c | 28 +---
>>  drivers/mtd/spi/spi-nor-ids.c  |  7 +--
>>  2 files changed, 26 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
>> index f86003ca8c..9b81b31e8e 100644
>> --- a/drivers/mtd/spi/spi-nor-core.c
>> +++ b/drivers/mtd/spi/spi-nor-core.c
>> @@ -3299,8 +3299,10 @@ static int s25fs_s_quad_enable(struct spi_nor *nor)
>>
>>  static int s25fs_s_erase_non_uniform(struct spi_nor *nor, loff_t addr)
>>  {
>> +u8 opcode = nor->addr_width == 4 ? SPINOR_OP_BE_4K_4B : SPINOR_OP_BE_4K;
>> +
>>  /* Support 8 x 4KB sectors at bottom */
>> -return spansion_erase_non_uniform(nor, addr, SPINOR_OP_BE_4K_4B, 0, 
>> SZ_32K);
>> +return spansion_erase_non_uniform(nor, addr, opcode, 0, SZ_32K);
> 
> Looks like an unrelated bugfix. Should this be a separate patch?
> 
The existing S25FS512S uses 4-byte address so it's OK with 4B opcode.
But, yes, this is a bugfix and should be separated.

>>  }
>>
>>  static int s25fs_s_setup(struct spi_nor *nor, const struct flash_info *info,
>> @@ -3354,12 +3356,24 @@ static int s25fs_s_post_bfpt_fixup(struct spi_nor 
>> *nor,
>>  static void s25fs_s_post_sfdp_fixup(struct spi_nor *nor,
>>  struct spi_nor_flash_parameter *params)
>>  {
>> -/* READ_1_1_2 is not supported */
>> -params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
>> -/* READ_1_1_4 is not supported */
>> -params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
>> -/* PP_1_1_4 is not supported */
>> -params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
>> +/*
>> + * The S25FS064S(8MB) supports 1-1-2 and 1-1-4 commands, but params for
>> + * read ops in SFDP are wrong. The other density parts do not support
>> + * 1-1-2 and 1-1-4 commands.
>> + */
>> +if (params->size == SZ_8M) {
>> +spi_nor_set_read_settings(>reads[SNOR_CMD_READ_1_1_2],
>> +  0, 8, SPINOR_OP_READ_1_1_2,
>> +  SNOR_PROTO_1_1_2);
>> +spi_nor_set_read_settings(>reads[SNOR_CMD_READ_1_1_4],
>> +  0, 8, SPINOR_OP_READ_1_1_4,
>> +  SNOR_PROTO_1_1_4);
>> +} else {
>> +params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_2;
>> +params->hwcaps.mask &= ~SNOR_HWCAPS_READ_1_1_4;
>> +params->hwcaps.mask &= ~SNOR_HWCAPS_PP_1_1_4;
>> +}
>> +
>>  /* Use volatile register to enable quad */
>>  params->quad_enable = s25fs_s_quad_enable;
>>  }
>> diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c
>> index 4e83b8c94c..9ca1f244f0 100644
>> --- a/drivers/mtd/spi/spi-nor-ids.c
>> +++ b/drivers/mtd/spi/spi-nor-ids.c
>> @@ -338,9 +338,12 @@ const struct flash_info spi_nor_ids[] = {
>>   */
>>  { INFO("s25sl032p",  0x010215, 0x4d00,  64 * 1024,  64, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
>>  { INFO("s25sl064p",  0x010216, 0x4d00,  64 * 1024, 128, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
>> -{ INFO("s25fl256s0", 0x010219, 0x4d00, 256 * 1024, 128, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
>> -{ INFO("s25fl256s1", 0x010219, 0x4d01,  64 * 1024, 512, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
>> +{ INFO6("s25fl256s0", 0x010219, 0x4d0080, 256 * 1024, 128, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
>> +{ INFO6("s25fl256s1", 0x010219, 0x4d0180,  64 * 1024, 512, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
> 
> Unrelated change. Is this intentional? If so, please make it a separate
> patch.
> 
Yes, it's intentional. The 6th byte is needed to distinguish S25FL-S and
S25FS-S. Will make it separate patch in next version.

>>  { INFO6("s25fl512s",  0x010220, 0x4d0080, 256 * 1024, 256, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
>> +{ INFO6("s25fs064s",  0x010217, 0x4d0181,  64 * 1024, 128, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | USE_CLSR) },
>> +{ INFO6("s25fs128s",  0x012018, 0x4d0181,  64 * 1024, 256, 
>> SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | 

Re: Pull request efi-2024-07-rc1

2024-04-08 Thread Tom Rini
On Mon, Apr 08, 2024 at 10:28:42PM +0200, Heinrich Schuchardt wrote:

> Dear Tom,
> 
> The following changes since commit 9cba29b19f43f9450117e8bc89e7dda691ed5ab5:
> 
>   Merge tag 'u-boot-imx-master-20240405' of
> https://gitlab.denx.de/u-boot/custodians/u-boot-imx (2024-04-05 17:23:58
> -0400)
> 
> are available in the Git repository at:
> 
>   https://source.denx.de/u-boot/custodians/u-boot-efi.git
> tags/efi-2024-07-rc1
> 
> for you to fetch changes up to 3f8d13044b32ddd906bb9f2fc705b988ec93df35:
> 
>   efi_loader: access __efi_runtime_rel_start/stop without & (2024-04-08
> 13:05:50 +0200)
> 
> Gitlab CI showed no issues:
> https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/20252
> 

Applied to u-boot/master, thanks!

-- 
Tom


signature.asc
Description: PGP signature


[PATCH v2 01/16] board: Define GUIDs for firmware images

2024-04-08 Thread Jonathan Humphreys
Define GUIDs for the different firmware images (tiboot3.bin, tispl.bin,
u-boot.img, sysfw).

Signed-off-by: Jonathan Humphreys 
---
 include/configs/ti_armv7_common.h | 17 +
 1 file changed, 17 insertions(+)

diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index 3def7b1027e..4ce14a9b84c 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -16,6 +16,23 @@
 #ifndef __CONFIG_TI_ARMV7_COMMON_H__
 #define __CONFIG_TI_ARMV7_COMMON_H__
 
+/* GUIDs for capsule updatable firmware images */
+#define K3_TIBOOT3_IMAGE_GUID \
+   EFI_GUID(0xe672b518, 0x7cd7, 0x4014, 0xbd, 0x8d, \
+0x40, 0x72, 0x4d, 0x0a, 0xd4, 0xdc)
+
+#define K3_SPL_IMAGE_GUID \
+   EFI_GUID(0x86f710ad, 0x10cf, 0x46ea, 0xac, 0x67, \
+0x85, 0x6a, 0xe0, 0x6e, 0xfa, 0xd2)
+
+#define K3_UBOOT_IMAGE_GUID \
+   EFI_GUID(0x81b58fb0, 0x3b00, 0x4add, 0xa2, 0x0a, \
+0xc1, 0x85, 0xbb, 0xac, 0xa1, 0xed)
+
+#define K3_SYSFW_IMAGE_GUID \
+   EFI_GUID(0x6fd10680, 0x361b, 0x431f, 0x80, 0xaa, \
+0x89, 0x94, 0x55, 0x81, 0x9e, 0x11)
+
 /*
  * We setup defaults based on constraints from the Linux kernel, which should
  * also be safe elsewhere.  We have the default load at 32MB into DDR (for
-- 
2.34.1



[PATCH v2 15/16] board: beagleboneai64: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 board/beagle/beagleboneai64/beagleboneai64.c | 38 
 1 file changed, 38 insertions(+)

diff --git a/board/beagle/beagleboneai64/beagleboneai64.c 
b/board/beagle/beagleboneai64/beagleboneai64.c
index c5b4ff7df47..b6ef1c137cb 100644
--- a/board/beagle/beagleboneai64/beagleboneai64.c
+++ b/board/beagle/beagleboneai64/beagleboneai64.c
@@ -7,6 +7,7 @@
  * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -14,6 +15,43 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+   {
+   .image_type_id = K3_SYSFW_IMAGE_GUID,
+   .fw_name = u"K3_SYSFW",
+   .image_index = 4,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;tispl.bin fat 0 
1;u-boot.img fat 0 1; sysfw.itb fat 0 1",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH v2 11/16] configs: am62x: Enable serial flash DFU

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index d650b8575b6..0e6c94de538 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -67,6 +67,7 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_DFU_SF=y
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
-- 
2.34.1



[PATCH v2 06/16] board: beagleplay: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 board/beagle/beagleplay/beagleplay.c | 33 
 1 file changed, 33 insertions(+)

diff --git a/board/beagle/beagleplay/beagleplay.c 
b/board/beagle/beagleplay/beagleplay.c
index af36439e2e2..519c63d9608 100644
--- a/board/beagle/beagleplay/beagleplay.c
+++ b/board/beagle/beagleplay/beagleplay.c
@@ -6,6 +6,7 @@
  * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -15,6 +16,38 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;tispl.bin fat 0 
1;u-boot.img fat 0 1",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH v2 16/16] configs: beagleboneai64: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_beagleboneai64_a72_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig 
b/configs/j721e_beagleboneai64_a72_defconfig
index 3d234bc1a8f..e74ee68e23e 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -172,3 +172,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6163
 CONFIG_SPL_DFU=y
 CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH v2 05/16] configs: j721e: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_evm_a72_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 077bf508328..b8840a556e1 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -210,3 +210,5 @@ CONFIG_UFS=y
 CONFIG_CADENCE_UFS=y
 CONFIG_TI_J721E_UFS=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH v2 13/16] board: am62x: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Define the firmwares updatable via EFI capsule update.

Signed-off-by: Jonathan Humphreys 
---
 board/ti/am62x/evm.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index b3e8680dfab..3341308c9ae 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -7,6 +7,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -46,6 +47,37 @@ int splash_screen_prepare(void)
 }
 #endif
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 8;tispl.bin raw 8 
20;u-boot.img raw 28 48",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH v2 09/16] board: am62px: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Define the firmwares updatable via EFI capsule update.

Signed-off-by: Jonathan Humphreys 
---
 board/ti/am62px/evm.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index 97a95ce8cc2..149ff8eedc7 100644
--- a/board/ti/am62px/evm.c
+++ b/board/ti/am62px/evm.c
@@ -6,6 +6,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -13,6 +14,37 @@
 #include 
 #include 
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 8;tispl.bin raw 8 
20;u-boot.img raw 28 40",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH v2 03/16] configs: am64x: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 61b498b49a6..8ba17ea89f9 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -177,3 +177,5 @@ CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH v2 02/16] board: am64x: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Define the firmwares updatable via EFI capsule update.

Signed-off-by: Jonathan Humphreys 
---
 board/ti/am64x/evm.c | 33 +
 1 file changed, 33 insertions(+)

diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
index b8de69da06c..876c5c25d42 100644
--- a/board/ti/am64x/evm.c
+++ b/board/ti/am64x/evm.c
@@ -7,6 +7,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -27,6 +28,38 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 10;tispl.bin raw 10 
20;u-boot.img raw 30 40",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH v2 04/16] board: j721e: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 board/ti/j721e/evm.c | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 9dc3ed6dfff..d345148be32 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -7,6 +7,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -32,6 +33,43 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+   {
+   .image_type_id = K3_SYSFW_IMAGE_GUID,
+   .fw_name = u"K3_SYSFW",
+   .image_index = 4,
+   }
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 8;tispl.bin raw 8 
20;u-boot.img raw 28 40;sysfw.itb raw 6C 10",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH v2 07/16] configs: beagleplay: Enable DFU for MMC

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 147967d3c11..68e103f58dc 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -70,6 +70,9 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x4
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x18
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
-- 
2.34.1



[PATCH v2 08/16] configs: beagleplay: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 68e103f58dc..23b9c466248 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -124,3 +124,5 @@ CONFIG_EXT4_WRITE=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH v2 10/16] configs: am62px: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index 65dfda19f18..15ba1079760 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -176,3 +176,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH v2 14/16] configs: am62x: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 0e6c94de538..11af7b517d1 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -111,3 +111,5 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH v2 00/16] EFI: ti: Enable EFI capsule updates

2024-04-08 Thread Jonathan Humphreys
Enable on disk capsule updates, which includes defining the firmware components
(tiboot3, spl, u-boot) and enabling processing of raw capsule updates.

This is enabled for several TI SoC based platforms: AM64, AM62, AM62p,
BeaglePlay, J7, and BeagleboneAI.

This series also includes enabling seral flash DFU for AM62 and MMC DFU for
beagleplay, and adding the sysreset controller node for AM62 to enable system
reset.

Changes from v1:
- Added sysfw.itb capsule definition to beagleboneai64
- removed extra commas in structure definitions

Jonathan Humphreys (16):
  board: Define GUIDs for firmware images
  board: am64x: Define capsule update firmware info
  configs: am64x: Enable EFI capsule update
  board: j721e: Define capsule update firmware info
  configs: j721e: Enable EFI capsule update
  board: beagleplay: Define capsule update firmware info
  configs: beagleplay: Enable DFU for MMC
  configs: beagleplay: Enable EFI capsule update
  board: am62px: Define capsule update firmware info
  configs: am62px: Enable EFI capsule update
  configs: am62x: Enable serial flash DFU
  arm: dts: k3-am625-sk-u-boot: Add sysreset-controller node
  board: am62x: Define capsule update firmware info
  configs: am62x: Enable EFI capsule update
  board: beagleboneai64: Define capsule update firmware info
  configs: beagleboneai64: Enable EFI capsule update

 arch/arm/dts/k3-am625-sk-u-boot.dtsi |  9 +
 board/beagle/beagleboneai64/beagleboneai64.c | 38 
 board/beagle/beagleplay/beagleplay.c | 33 +
 board/ti/am62px/evm.c| 32 +
 board/ti/am62x/evm.c | 32 +
 board/ti/am64x/evm.c | 33 +
 board/ti/j721e/evm.c | 38 
 configs/am62px_evm_a53_defconfig |  2 ++
 configs/am62x_beagleplay_a53_defconfig   |  5 +++
 configs/am62x_evm_a53_defconfig  |  3 ++
 configs/am64x_evm_a53_defconfig  |  2 ++
 configs/j721e_beagleboneai64_a72_defconfig   |  2 ++
 configs/j721e_evm_a72_defconfig  |  2 ++
 include/configs/ti_armv7_common.h| 17 +
 14 files changed, 248 insertions(+)

-- 
2.34.1



[PATCH v2 12/16] arm: dts: k3-am625-sk-u-boot: Add sysreset-controller node

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi 
b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
index fa778b0ff4c..35bfeae75a0 100644
--- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
@@ -46,3 +46,12 @@
 _port2 {
status = "disabled";
 };
+
+ {
+   bootph-pre-ram;
+
+   k3_sysreset: sysreset-controller {
+   compatible = "ti,sci-sysreset";
+   bootph-pre-ram;
+   };
+};
-- 
2.34.1



[PATCH 4/7] dts: beagleplay: binman: Include firmware capsules binman nodes

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi | 9 +
 arch/arm/dts/k3-am625-r5-beagleplay.dts  | 5 +
 2 files changed, 14 insertions(+)

diff --git a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi 
b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
index cca0f44b7d8..315f42e7464 100644
--- a/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi
@@ -212,4 +212,13 @@
};
};
 };
+
+#include "k3-binman-capsule.dtsi"
+_name {
+   filename = "tispl.bin_unsigned";
+};
+_name {
+   filename = "u-boot.img_unsigned";
+};
+
 #endif
diff --git a/arch/arm/dts/k3-am625-r5-beagleplay.dts 
b/arch/arm/dts/k3-am625-r5-beagleplay.dts
index 9db58f093c8..5ee0c2bd56d 100644
--- a/arch/arm/dts/k3-am625-r5-beagleplay.dts
+++ b/arch/arm/dts/k3-am625-r5-beagleplay.dts
@@ -114,3 +114,8 @@
 
};
 };
+
+#include "k3-binman-capsule-r5.dtsi"
+_name {
+   filename = "tiboot3-am62x-gp-evm.bin";
+};
-- 
2.34.1



[PATCH 5/7] dts: am62px: binman: Include base K3 firmware capsule binman nodes

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-am62p-sk-binman.dtsi | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/dts/k3-am62p-sk-binman.dtsi 
b/arch/arm/dts/k3-am62p-sk-binman.dtsi
index dea14945bf5..9b27c879f79 100644
--- a/arch/arm/dts/k3-am62p-sk-binman.dtsi
+++ b/arch/arm/dts/k3-am62p-sk-binman.dtsi
@@ -59,6 +59,8 @@
};
 };
 
+#include "k3-binman-capsule-r5.dtsi"
+
 #endif /* CONFIG_TARGET_AM62P5_R5_EVM */
 
 #if IS_ENABLED(CONFIG_TARGET_AM62P5_A53_EVM)
@@ -170,4 +172,6 @@
};
 };
 
+#include "k3-binman-capsule.dtsi"
+
 #endif /* CONFIG_TARGET_AM62P5_A53_EVM */
-- 
2.34.1



[PATCH 1/7] dts: ti: binman: Add base K3 firmware capsule nodes

2024-04-08 Thread Jonathan Humphreys
Create capsule files for tiboot3.bin, tispl.bin, and u-boot.img.

Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-binman-capsule-r5.dtsi | 24 +++
 arch/arm/dts/k3-binman-capsule.dtsi| 42 ++
 2 files changed, 66 insertions(+)
 create mode 100644 arch/arm/dts/k3-binman-capsule-r5.dtsi
 create mode 100644 arch/arm/dts/k3-binman-capsule.dtsi

diff --git a/arch/arm/dts/k3-binman-capsule-r5.dtsi 
b/arch/arm/dts/k3-binman-capsule-r5.dtsi
new file mode 100644
index 000..7a20afa46aa
--- /dev/null
+++ b/arch/arm/dts/k3-binman-capsule-r5.dtsi
@@ -0,0 +1,24 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+// Capsue update GUIDs.  See ti_armv7_common.h.
+#define K3_TIBOOT3_IMAGE_UUID_STR "e672b518-7cd7-4014-bd8d-40724d0ad4dc"
+
+ {
+   capsule-tiboot3 {
+   filename = "tiboot3-capsule.bin";
+   efi-capsule {
+   image-index = <0x1>;
+   image-guid = K3_TIBOOT3_IMAGE_UUID_STR;
+   private-key = "arch/arm/mach-k3/keys/custMpk.pem";
+   public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt";
+   monotonic-count = <0x1>;
+
+   tiboot3_name: blob {
+   filename = "tiboot3.bin";
+   };
+   };
+   };
+};
diff --git a/arch/arm/dts/k3-binman-capsule.dtsi 
b/arch/arm/dts/k3-binman-capsule.dtsi
new file mode 100644
index 000..4f11ca6f0ef
--- /dev/null
+++ b/arch/arm/dts/k3-binman-capsule.dtsi
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+// Capsue update GUIDs.  See ti_armv7_common.h.
+#define K3_SPL_IMAGE_UUID_STR "86f710ad-10cf-46ea-ac67-856ae06efad2"
+#define K3_UBOOT_IMAGE_UUID_STR "81b58fb0-3b00-4add-a20a-c185bbaca1ed"
+
+ {
+   capsule-tispl {
+   filename = "tispl-capsule.bin";
+   efi-capsule {
+   image-index = <0x2>;
+   image-guid = K3_SPL_IMAGE_UUID_STR;
+   private-key = "arch/arm/mach-k3/keys/custMpk.pem";
+   public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt";
+   monotonic-count = <0x1>;
+
+   tispl_name: blob {
+   filename = "tispl.bin";
+   };
+   };
+   };
+};
+
+ {
+   capsule-uboot {
+   filename = "uboot-capsule.bin";
+   efi-capsule {
+   image-index = <0x3>;
+   image-guid = K3_UBOOT_IMAGE_UUID_STR;
+   private-key = "arch/arm/mach-k3/keys/custMpk.pem";
+   public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt";
+   monotonic-count = <0x1>;
+
+   uboot_name: blob {
+   filename = "u-boot.img";
+   };
+   };
+   };
+};
-- 
2.34.1



[PATCH 3/7] dts: j721e: binman: Include firmware capsules binman nodes

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-j721e-binman.dtsi | 32 +++
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/dts/k3-j721e-binman.dtsi 
b/arch/arm/dts/k3-j721e-binman.dtsi
index 75a6e9599b9..9169551c422 100644
--- a/arch/arm/dts/k3-j721e-binman.dtsi
+++ b/arch/arm/dts/k3-j721e-binman.dtsi
@@ -207,6 +207,29 @@
};
};
 };
+
+#include "k3-binman-capsule-r5.dtsi"
+
+// Capsue update GUIDs.  See ti_armv7_common.h.
+#define K3_SYSFW_IMAGE_UUID_STR "6fd10680-361b-431f-80aa-899455819e11"
+
+ {
+   capsule-sysfw {
+   filename = "sysfw-capsule.bin";
+   efi-capsule {
+   image-index = <0x4>;
+   image-guid = K3_SYSFW_IMAGE_UUID_STR;
+   private-key = "arch/arm/mach-k3/keys/custMpk.pem";
+   public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt";
+   monotonic-count = <0x1>;
+
+   blob {
+   filename = "sysfw.itb";
+   };
+   };
+   };
+};
+
 #endif
 
 #ifdef CONFIG_TARGET_J721E_A72_EVM
@@ -585,4 +608,13 @@
};
};
 };
+
+#include "k3-binman-capsule.dtsi"
+_name {
+   filename = "tispl.bin_unsigned";
+};
+_name {
+   filename = "u-boot.img_unsigned";
+};
+
 #endif
-- 
2.34.1



[PATCH 6/7] dts: am62x: binman: Include base K3 firmware capsule binman nodes

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-am625-sk-binman.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/dts/k3-am625-sk-binman.dtsi 
b/arch/arm/dts/k3-am625-sk-binman.dtsi
index 5b058bd03a0..921c2bdcc5e 100644
--- a/arch/arm/dts/k3-am625-sk-binman.dtsi
+++ b/arch/arm/dts/k3-am625-sk-binman.dtsi
@@ -137,6 +137,8 @@
};
 };
 
+#include "k3-binman-capsule-r5.dtsi"
+
 #endif
 
 #ifdef CONFIG_TARGET_AM625_A53_EVM
@@ -315,4 +317,7 @@
};
};
 };
+
+#include "k3-binman-capsule.dtsi"
+
 #endif
-- 
2.34.1



[PATCH 2/7] dts: am64x: binman: Include base K3 firmware capsule binman nodes

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-am64x-binman.dtsi | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/dts/k3-am64x-binman.dtsi 
b/arch/arm/dts/k3-am64x-binman.dtsi
index 37817ba60d2..89cf048db1f 100644
--- a/arch/arm/dts/k3-am64x-binman.dtsi
+++ b/arch/arm/dts/k3-am64x-binman.dtsi
@@ -114,6 +114,8 @@
};
 };
 
+#include "k3-binman-capsule-r5.dtsi"
+
 #endif
 
 #ifdef CONFIG_TARGET_AM642_A53_EVM
@@ -373,4 +375,7 @@
};
};
 };
+
+#include "k3-binman-capsule.dtsi"
+
 #endif
-- 
2.34.1



[PATCH 7/7] dts: beagleboneai64: binman: Include firmware capsules binman nodes

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 .../dts/k3-j721e-beagleboneai64-u-boot.dtsi   |  9 
 arch/arm/dts/k3-j721e-r5-beagleboneai64.dts   | 22 +++
 2 files changed, 31 insertions(+)

diff --git a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi 
b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
index 116ee373118..a3c5fa1f0b5 100644
--- a/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
+++ b/arch/arm/dts/k3-j721e-beagleboneai64-u-boot.dtsi
@@ -355,4 +355,13 @@
};
};
 };
+
+#include "k3-binman-capsule.dtsi"
+_name {
+   filename = "tispl.bin_unsigned";
+};
+_name {
+   filename = "u-boot.img_unsigned";
+};
+
 #endif
diff --git a/arch/arm/dts/k3-j721e-r5-beagleboneai64.dts 
b/arch/arm/dts/k3-j721e-r5-beagleboneai64.dts
index 43da4dafba8..1a98ad9e34f 100644
--- a/arch/arm/dts/k3-j721e-r5-beagleboneai64.dts
+++ b/arch/arm/dts/k3-j721e-r5-beagleboneai64.dts
@@ -183,3 +183,25 @@
};
};
 };
+
+#include "k3-binman-capsule-r5.dtsi"
+
+// Capsue update GUIDs.  See ti_armv7_common.h.
+#define K3_SYSFW_IMAGE_UUID_STR "6fd10680-361b-431f-80aa-899455819e11"
+
+ {
+   capsule-sysfw {
+   filename = "sysfw-capsule.bin";
+   efi-capsule {
+   image-index = <0x4>;
+   image-guid = K3_SYSFW_IMAGE_UUID_STR;
+   private-key = "arch/arm/mach-k3/keys/custMpk.pem";
+   public-key-cert = "arch/arm/mach-k3/keys/custMpk.crt";
+   monotonic-count = <0x1>;
+
+   blob {
+   filename = "sysfw.itb";
+   };
+   };
+   };
+};
-- 
2.34.1



[PATCH 0/7] binman: ti: create binman nodes for EFI capsules

2024-04-08 Thread Jonathan Humphreys
Add binman nodes for EFI capsules of firmware components.

This is enabled for several TI SoC based platforms: AM64, AM62, AM62p,
BeaglePlay, J7, and BeagleboneAI.

Jonathan Humphreys (7):
  dts: ti: binman: Add base K3 firmware capsule nodes
  dts: am64x: binman: Include base K3 firmware capsule binman nodes
  dts: j721e: binman: Include firmware capsules binman nodes
  dts: beagleplay: binman: Include firmware capsules binman nodes
  dts: am62px: binman: Include base K3 firmware capsule binman nodes
  dts: am62x: binman: Include base K3 firmware capsule binman nodes
  dts: beagleboneai64: binman: Include firmware capsules binman nodes

 arch/arm/dts/k3-am625-beagleplay-u-boot.dtsi  |  9 
 arch/arm/dts/k3-am625-r5-beagleplay.dts   |  5 +++
 arch/arm/dts/k3-am625-sk-binman.dtsi  |  5 +++
 arch/arm/dts/k3-am62p-sk-binman.dtsi  |  4 ++
 arch/arm/dts/k3-am64x-binman.dtsi |  5 +++
 arch/arm/dts/k3-binman-capsule-r5.dtsi| 24 +++
 arch/arm/dts/k3-binman-capsule.dtsi   | 42 +++
 .../dts/k3-j721e-beagleboneai64-u-boot.dtsi   |  9 
 arch/arm/dts/k3-j721e-binman.dtsi | 32 ++
 arch/arm/dts/k3-j721e-r5-beagleboneai64.dts   | 22 ++
 10 files changed, 157 insertions(+)
 create mode 100644 arch/arm/dts/k3-binman-capsule-r5.dtsi
 create mode 100644 arch/arm/dts/k3-binman-capsule.dtsi

-- 
2.34.1



[PATCH 05/13] configs: j721e: Enable capsule authentication

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_evm_a72_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 83bc0576821..c522d8cc9ee 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -212,4 +212,5 @@ CONFIG_TI_J721E_UFS=y
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 13/13] configs: beagleboneai64: Enable capsule authentication

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_beagleboneai64_a72_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig 
b/configs/j721e_beagleboneai64_a72_defconfig
index 5aeb4c08d31..c1d30b3db68 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -174,4 +174,5 @@ CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 08/13] configs: am62px: Set capsule update signature list file

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index 15ba1079760..ea72eaf2d42 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -178,3 +178,4 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 10/13] configs: am62x: Set capsule update signature list file

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 11af7b517d1..1accae81564 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -113,3 +113,4 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 03/13] configs: am64x: Enable capsule authentication

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 5594d26844e..8490d4e36a8 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -179,4 +179,5 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 11/13] configs: am62x: Enable capsule authentication

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 1accae81564..772a6551ff2 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -113,4 +113,5 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 06/13] configs: beagleplay: Set capsule update signature list file

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 23b9c466248..4e0dcf70b25 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -126,3 +126,4 @@ CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 07/13] configs: beagleplay: Enable capsule authentication

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 4e0dcf70b25..99258804f92 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -126,4 +126,5 @@ CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 09/13] configs: am62px: Enable capsule authentication

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index ea72eaf2d42..9e633293d49 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -178,4 +178,5 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_AUTHENTICATE=y
 CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 12/13] configs: beagleboneai64: Set capsule update signature list file

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_beagleboneai64_a72_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig 
b/configs/j721e_beagleboneai64_a72_defconfig
index e74ee68e23e..5aeb4c08d31 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -174,3 +174,4 @@ CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 02/13] configs: am64x: Set capsule update signature list file

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 8ba17ea89f9..5594d26844e 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -179,3 +179,4 @@ CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH 00/13] EFI: capsule: ti: enable authenticated capsules

2024-04-08 Thread Jonathan Humphreys
Create an EFI signature list (.esl) file based on the TI dummy key.
Enable capsule authentication for several TI SoC based platforms: AM64, AM62,
AM62p, BeaglePlay, J7, and BeagleboneAI.

Jonathan Humphreys (13):
  ti:keys Add EFI signature list
  configs: am64x: Set capsule update signature list file
  configs: am64x: Enable capsule authentication
  configs: j721e: Set capsule update signature list file
  configs: j721e: Enable capsule authentication
  configs: beagleplay: Set capsule update signature list file
  configs: beagleplay: Enable capsule authentication
  configs: am62px: Set capsule update signature list file
  configs: am62px: Enable capsule authentication
  configs: am62x: Set capsule update signature list file
  configs: am62x: Enable capsule authentication
  configs: beagleboneai64: Set capsule update signature list file
  configs: beagleboneai64: Enable capsule authentication

 arch/arm/mach-k3/keys/custMpk.esl  | Bin 0 -> 1523 bytes
 configs/am62px_evm_a53_defconfig   |   2 ++
 configs/am62x_beagleplay_a53_defconfig |   2 ++
 configs/am62x_evm_a53_defconfig|   2 ++
 configs/am64x_evm_a53_defconfig|   2 ++
 configs/j721e_beagleboneai64_a72_defconfig |   2 ++
 configs/j721e_evm_a72_defconfig|   2 ++
 7 files changed, 12 insertions(+)
 create mode 100644 arch/arm/mach-k3/keys/custMpk.esl

-- 
2.34.1



[PATCH 01/13] ti:keys Add EFI signature list

2024-04-08 Thread Jonathan Humphreys
EFI signature list using TI dummy keys.

Signed-off-by: Jonathan Humphreys 
---
 arch/arm/mach-k3/keys/custMpk.esl | Bin 0 -> 1523 bytes
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-k3/keys/custMpk.esl

diff --git a/arch/arm/mach-k3/keys/custMpk.esl 
b/arch/arm/mach-k3/keys/custMpk.esl
new file mode 100644
index 
..2feb704e0a5fd126410de451d3c0fa4d3edccc52
GIT binary patch
literal 1523
zcmZ1^?2Da*aux2_hA(f&~MnUw(yu0v@E4?-F=u^u*PVqVQ8QZ((-^A*$m*Kg7c
z&78AJODc2mtxpELY@Awc9)w85y}*84Mcd8gd(OvN4CUun9AT2E#ZUJWL@GhWtR)
zKpA!(HkZVloWx>7bput902hy3NNPo5v4Uq_aY<2WZfaf$h@G5YRFGekSdyAzC~P1I
zQpnB26;PC)oLXF*UsMbeWai-t@l*_blshP#N9QH-w`BJNO+QS$x7=il`0?bc6sZ`Vxxl^6N{>i2E;SY*4-T$+0G;)5dxe+2CR
z@4+)sDPWdQb@%6KTpDVdm)v}?GSpG(w_UV)+#e3fJowDZO)JR83lIcbw(hMu}}Y
z2ZZwYAI-LVx@^G;HdkgxaX_l3&{H|3l7uX@Vl5di{>fQQ{pDynFlySp2(z~g)
z{LIBUzm_CMw_SIFfPdcT#zmg6g{#b(Lp`M3Uj
zGOKycyEe+n{G(Rmg}jB!)0ySk-!kkj_R7#OT+}pcG0VXh?f+ftRvnyw#hUea^Iyfn
ze|zgKPKrqe@jYWU?v<50X(n^lZ*G%j$JyCh`*Px|H*K=2WXP)hx>jng+}Q}N^KoDN
z8dh8T-~Dmrp2?yk3O6Gqbz7O@W=dcRVPvS;*B%(4`P|iK>Vg$XDgN9sr}Df{
z7X0es=RPHr8RB+*)}q}h%gn?x9PO4y*Qog};xRCb9PcXWpE>
zKlQ}fzw*izXI|}|r!O*nb#VhHRn;B`1LC^xvIctvLCYhRA_6yCS~2&!0SH1xwv(O~+5t
z^|E$S{MM^8j9J5`sQ6pud{2Lz?k`zncbjvHj%eutjusUol}8;%cbPLCO|e;ZJ^tXe
z_N{pmM}uCi3UWO3=hMciTPl?N16Xv@buq_d@TU`uX0_s{?
zt`1&)Tk-yb?sKMPI~!}xt*d*!tMat!r1`}jul#i@lDB8rnu>ba_-^4!iQ5{|tb3TX
z>fTMIw2!Me3{Dw*WZotC<4@h

[PATCH 04/13] configs: j721e: Set capsule update signature list file

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_evm_a72_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index b8840a556e1..83bc0576821 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -212,3 +212,4 @@ CONFIG_TI_J721E_UFS=y
 CONFIG_EFI_SET_TIME=y
 CONFIG_EFI_CAPSULE_ON_DISK=y
 CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+CONFIG_EFI_CAPSULE_ESL_FILE="arch/arm/mach-k3/keys/custMpk.esl"
-- 
2.34.1



[PATCH] Makefile.lib: find capsule ESL dtsi file with CONFIG_OF_UPSTREAM

2024-04-08 Thread Jonathan Humphreys
When CONFIG_OF_UPSTREAM is enabled, DTS files are in SOC subdirectories (vs the
top level dts directory), but when CONFIG_EFI_CAPSULE_AUTHENTICATE is enabled,
the dynamically created dtsi file containing the capsule ESL DT node is in the
parent directory. This results in a build failure because the #include inserted
in the DTS file is local to the current directory.  Update Makefile to have the
DT preprocessing of #includes search in the parent (dts top level) directory
too.

Signed-off-by: Jonathan Humphreys 
---
 scripts/Makefile.lib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 12857316c58..62f87517c09 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -334,7 +334,7 @@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
(cat $< > $(pre-tmp)); \
$(foreach f,$(subst $(quote),,$(dtsi_include_list)), \
  echo '$(pound)include "$(f)"' >> $(pre-tmp);) \
-   $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) 
$(pre-tmp) ; \
+   $(HOSTCC) -E $(dtc_cpp_flags) -I$(obj) -x assembler-with-cpp -o 
$(dtc-tmp) $(pre-tmp) ; \
$(DTC) -O dtb -o $@ -b 0 \
-i $(dir $<) -i $(u_boot_dtsi_loc) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) || \
-- 
2.34.1



[PATCH 05/16] configs: j721e: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_evm_a72_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 077bf508328..b8840a556e1 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -210,3 +210,5 @@ CONFIG_UFS=y
 CONFIG_CADENCE_UFS=y
 CONFIG_TI_J721E_UFS=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH 07/16] configs: beagleplay: Enable DFU for MMC

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 147967d3c11..68e103f58dc 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -70,6 +70,9 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x4
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x18
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
-- 
2.34.1



[PATCH 02/16] board: am64x: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Define the firmwares updatable via EFI capsule update.

Signed-off-by: Jonathan Humphreys 
---
 board/ti/am64x/evm.c | 33 +
 1 file changed, 33 insertions(+)

diff --git a/board/ti/am64x/evm.c b/board/ti/am64x/evm.c
index b8de69da06c..a151023bb7e 100644
--- a/board/ti/am64x/evm.c
+++ b/board/ti/am64x/evm.c
@@ -7,6 +7,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -27,6 +28,38 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 10;tispl.bin raw 10 
20;u-boot.img raw 30 40",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH 04/16] board: j721e: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 board/ti/j721e/evm.c | 38 ++
 1 file changed, 38 insertions(+)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 9dc3ed6dfff..b8702b83547 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -7,6 +7,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -32,6 +33,43 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+   {
+   .image_type_id = K3_SYSFW_IMAGE_GUID,
+   .fw_name = u"K3_SYSFW",
+   .image_index = 4,
+   },
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 8;tispl.bin raw 8 
20;u-boot.img raw 28 40;sysfw.itb raw 6C 10",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH 01/16] board: Define GUIDs for firmware images

2024-04-08 Thread Jonathan Humphreys
Define GUIDs for the different firmware images (tiboot3.bin, tispl.bin,
u-boot.img, sysfw).

Signed-off-by: Jonathan Humphreys 
---
 include/configs/ti_armv7_common.h | 17 +
 1 file changed, 17 insertions(+)

diff --git a/include/configs/ti_armv7_common.h 
b/include/configs/ti_armv7_common.h
index 3def7b1027e..4ce14a9b84c 100644
--- a/include/configs/ti_armv7_common.h
+++ b/include/configs/ti_armv7_common.h
@@ -16,6 +16,23 @@
 #ifndef __CONFIG_TI_ARMV7_COMMON_H__
 #define __CONFIG_TI_ARMV7_COMMON_H__
 
+/* GUIDs for capsule updatable firmware images */
+#define K3_TIBOOT3_IMAGE_GUID \
+   EFI_GUID(0xe672b518, 0x7cd7, 0x4014, 0xbd, 0x8d, \
+0x40, 0x72, 0x4d, 0x0a, 0xd4, 0xdc)
+
+#define K3_SPL_IMAGE_GUID \
+   EFI_GUID(0x86f710ad, 0x10cf, 0x46ea, 0xac, 0x67, \
+0x85, 0x6a, 0xe0, 0x6e, 0xfa, 0xd2)
+
+#define K3_UBOOT_IMAGE_GUID \
+   EFI_GUID(0x81b58fb0, 0x3b00, 0x4add, 0xa2, 0x0a, \
+0xc1, 0x85, 0xbb, 0xac, 0xa1, 0xed)
+
+#define K3_SYSFW_IMAGE_GUID \
+   EFI_GUID(0x6fd10680, 0x361b, 0x431f, 0x80, 0xaa, \
+0x89, 0x94, 0x55, 0x81, 0x9e, 0x11)
+
 /*
  * We setup defaults based on constraints from the Linux kernel, which should
  * also be safe elsewhere.  We have the default load at 32MB into DDR (for
-- 
2.34.1



[PATCH 00/16] EFI: ti: Enable EFI capsule updates

2024-04-08 Thread Jonathan Humphreys
Enable on disk capsule updates, which includes defining the firmware components
(tiboot3, spl, u-boot) and enabling processing of raw capsule updates.

This is enabled for several TI SoC based platforms: AM64, AM62, AM62p,
BeaglePlay, J7, and BeagleboneAI.

This series also includes enabling seral flash DFU for AM62 and MMC DFU for
beagleplay, and adding the sysreset controller node for AM62 to enable system
reset.

Jonathan Humphreys (16):
  board: Define GUIDs for firmware images
  board: am64x: Define capsule update firmware info
  configs: am64x: Enable EFI capsule update
  board: j721e: Define capsule update firmware info
  configs: j721e: Enable EFI capsule update
  board: beagleplay: Define capsule update firmware info
  configs: beagleplay: Enable DFU for MMC
  configs: beagleplay: Enable EFI capsule update
  board: am62px: Define capsule update firmware info
  configs: am62px: Enable EFI capsule update
  configs: am62x: Enable serial flash DFU
  arm: dts: k3-am625-sk-u-boot: Add sysreset-controller node
  board: am62x: Define capsule update firmware info
  configs: am62x: Enable EFI capsule update
  board: beagleboneai64: Define capsule update firmware info
  configs: beagleboneai64: Enable EFI capsule update

 arch/arm/dts/k3-am625-sk-u-boot.dtsi |  9 +
 board/beagle/beagleboneai64/beagleboneai64.c | 33 +
 board/beagle/beagleplay/beagleplay.c | 33 +
 board/ti/am62px/evm.c| 32 +
 board/ti/am62x/evm.c | 32 +
 board/ti/am64x/evm.c | 33 +
 board/ti/j721e/evm.c | 38 
 configs/am62px_evm_a53_defconfig |  2 ++
 configs/am62x_beagleplay_a53_defconfig   |  5 +++
 configs/am62x_evm_a53_defconfig  |  3 ++
 configs/am64x_evm_a53_defconfig  |  2 ++
 configs/j721e_beagleboneai64_a72_defconfig   |  2 ++
 configs/j721e_evm_a72_defconfig  |  2 ++
 include/configs/ti_armv7_common.h| 17 +
 14 files changed, 243 insertions(+)

-- 
2.34.1



[PATCH 08/16] configs: beagleplay: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 68e103f58dc..23b9c466248 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -124,3 +124,5 @@ CONFIG_EXT4_WRITE=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH 13/16] board: am62x: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Define the firmwares updatable via EFI capsule update.

Signed-off-by: Jonathan Humphreys 
---
 board/ti/am62x/evm.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/board/ti/am62x/evm.c b/board/ti/am62x/evm.c
index b3e8680dfab..595c98982bb 100644
--- a/board/ti/am62x/evm.c
+++ b/board/ti/am62x/evm.c
@@ -7,6 +7,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -46,6 +47,37 @@ int splash_screen_prepare(void)
 }
 #endif
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 8;tispl.bin raw 8 
20;u-boot.img raw 28 48",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH 12/16] arm: dts: k3-am625-sk-u-boot: Add sysreset-controller node

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 arch/arm/dts/k3-am625-sk-u-boot.dtsi | 9 +
 1 file changed, 9 insertions(+)

diff --git a/arch/arm/dts/k3-am625-sk-u-boot.dtsi 
b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
index fa778b0ff4c..35bfeae75a0 100644
--- a/arch/arm/dts/k3-am625-sk-u-boot.dtsi
+++ b/arch/arm/dts/k3-am625-sk-u-boot.dtsi
@@ -46,3 +46,12 @@
 _port2 {
status = "disabled";
 };
+
+ {
+   bootph-pre-ram;
+
+   k3_sysreset: sysreset-controller {
+   compatible = "ti,sci-sysreset";
+   bootph-pre-ram;
+   };
+};
-- 
2.34.1



[PATCH 11/16] configs: am62x: Enable serial flash DFU

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index d650b8575b6..0e6c94de538 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -67,6 +67,7 @@ CONFIG_SPL_OF_TRANSLATE=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_DFU_SF=y
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
-- 
2.34.1



[PATCH 14/16] configs: am62x: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 0e6c94de538..11af7b517d1 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -111,3 +111,5 @@ CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH 16/16] configs: beagleboneai64: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_beagleboneai64_a72_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig 
b/configs/j721e_beagleboneai64_a72_defconfig
index 3d234bc1a8f..e74ee68e23e 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -172,3 +172,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6163
 CONFIG_SPL_DFU=y
 CONFIG_LZO=y
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH 06/16] board: beagleplay: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 board/beagle/beagleplay/beagleplay.c | 33 
 1 file changed, 33 insertions(+)

diff --git a/board/beagle/beagleplay/beagleplay.c 
b/board/beagle/beagleplay/beagleplay.c
index af36439e2e2..1d19a78305b 100644
--- a/board/beagle/beagleplay/beagleplay.c
+++ b/board/beagle/beagleplay/beagleplay.c
@@ -6,6 +6,7 @@
  * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -15,6 +16,38 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;tispl.bin fat 0 
1;u-boot.img fat 0 1",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH 15/16] board: beagleboneai64: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 board/beagle/beagleboneai64/beagleboneai64.c | 33 
 1 file changed, 33 insertions(+)

diff --git a/board/beagle/beagleboneai64/beagleboneai64.c 
b/board/beagle/beagleboneai64/beagleboneai64.c
index c5b4ff7df47..9caf63b9834 100644
--- a/board/beagle/beagleboneai64/beagleboneai64.c
+++ b/board/beagle/beagleboneai64/beagleboneai64.c
@@ -7,6 +7,7 @@
  * Copyright (C) 2022-2023 Robert Nelson, BeagleBoard.org Foundation
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -14,6 +15,38 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "mmc 0=tiboot3.bin raw 0 2000 mmcpart 1;tispl.bin fat 0 
1;u-boot.img fat 0 1",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH 09/16] board: am62px: Define capsule update firmware info

2024-04-08 Thread Jonathan Humphreys
Define the firmwares updatable via EFI capsule update.

Signed-off-by: Jonathan Humphreys 
---
 board/ti/am62px/evm.c | 32 
 1 file changed, 32 insertions(+)

diff --git a/board/ti/am62px/evm.c b/board/ti/am62px/evm.c
index 97a95ce8cc2..980cc172b2f 100644
--- a/board/ti/am62px/evm.c
+++ b/board/ti/am62px/evm.c
@@ -6,6 +6,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -13,6 +14,37 @@
 #include 
 #include 
 
+#if IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT)
+struct efi_fw_image fw_images[] = {
+   {
+   .image_type_id = K3_TIBOOT3_IMAGE_GUID,
+   .fw_name = u"K3_TIBOOT3",
+   .image_index = 1,
+   },
+   {
+   .image_type_id = K3_SPL_IMAGE_GUID,
+   .fw_name = u"K3_SPL",
+   .image_index = 2,
+   },
+   {
+   .image_type_id = K3_UBOOT_IMAGE_GUID,
+   .fw_name = u"K3_UBOOT",
+   .image_index = 3,
+   },
+};
+
+struct efi_capsule_update_info update_info = {
+   .dfu_string = "sf 0:0=tiboot3.bin raw 0 8;tispl.bin raw 8 
20;u-boot.img raw 28 40",
+   .num_images = ARRAY_SIZE(fw_images),
+   .images = fw_images,
+};
+
+void set_dfu_alt_info(char *interface, char *devstr)
+{
+   env_set("dfu_alt_info", update_info.dfu_string);
+}
+#endif /* EFI_HAVE_CAPSULE_SUPPORT */
+
 int board_init(void)
 {
return 0;
-- 
2.34.1



[PATCH 10/16] configs: am62px: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index 65dfda19f18..15ba1079760 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -176,3 +176,5 @@ CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH 03/16] configs: am64x: Enable EFI capsule update

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 61b498b49a6..8ba17ea89f9 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -177,3 +177,5 @@ CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_EFI_SET_TIME=y
+CONFIG_EFI_CAPSULE_ON_DISK=y
+CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
-- 
2.34.1



[PATCH 04/15] configs: j721e: Enable basic EFI CMD support

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_evm_a72_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 019ddcca7e8..5028caa1782 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -63,7 +63,9 @@ CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x28
 CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_ASKENV=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_DFU=y
 # CONFIG_CMD_FLASH is not set
 CONFIG_CMD_GPIO=y
@@ -75,6 +77,7 @@ CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_UFS=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_MTDIDS_DEFAULT="nor0=4704.spi.0,nor0=47034000.hyperbus"
-- 
2.34.1



[PATCH 15/15] configs: beagleboneai64: Enable RTC emulation

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_beagleboneai64_a72_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig 
b/configs/j721e_beagleboneai64_a72_defconfig
index 31923d70d94..3d234bc1a8f 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -146,6 +146,8 @@ CONFIG_SPL_RAM=y
 CONFIG_REMOTEPROC_TI_K3_DSP=y
 CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_RESET_TI_SCI=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_EMULATION=y
 CONFIG_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
@@ -169,3 +171,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x6163
 CONFIG_SPL_DFU=y
 CONFIG_LZO=y
+CONFIG_EFI_SET_TIME=y
-- 
2.34.1



[PATCH 13/15] configs: am62x: Enable RTC emulation

2024-04-08 Thread Jonathan Humphreys
This is required to pass SystemReadyIR tests.

Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index ee585b3bc84..d650b8575b6 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -96,6 +96,8 @@ CONFIG_TI_SCI_POWER_DOMAIN=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_RESET_TI_SCI=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_EMULATION=y
 CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
 CONFIG_SOC_DEVICE_TI_K3=y
@@ -107,3 +109,4 @@ CONFIG_SYSRESET=y
 CONFIG_SPL_SYSRESET=y
 CONFIG_SYSRESET_TI_SCI=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_EFI_SET_TIME=y
-- 
2.34.1



[PATCH 07/15] configs: beagleplay: Enable RTC emulation

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index 5592328af76..147967d3c11 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -108,6 +108,8 @@ CONFIG_DM_REGULATOR_TPS65219=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_RESET_TI_SCI=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_EMULATION=y
 CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
 CONFIG_SOC_DEVICE_TI_K3=y
@@ -118,3 +120,4 @@ CONFIG_SYSRESET_TI_SCI=y
 CONFIG_EXT4_WRITE=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
 CONFIG_LZO=y
+CONFIG_EFI_SET_TIME=y
-- 
2.34.1



[PATCH 10/15] configs: am62px: Enable RTC emulation

2024-04-08 Thread Jonathan Humphreys
This is required to pass SystemReadyIR tests.

Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index a8b8ee76ca7..65dfda19f18 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -146,6 +146,8 @@ CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_REMOTEPROC_TI_K3_DSP=y
 CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_RESET_TI_SCI=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_EMULATION=y
 CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
 CONFIG_SOC_DEVICE_TI_K3=y
@@ -173,3 +175,4 @@ CONFIG_USB_GADGET_VENDOR_NUM=0x0451
 CONFIG_USB_GADGET_PRODUCT_NUM=0x6165
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_EFI_SET_TIME=y
-- 
2.34.1



[PATCH 14/15] configs: beagleboneai64: Enable basic EFI CMD support

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_beagleboneai64_a72_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/j721e_beagleboneai64_a72_defconfig 
b/configs/j721e_beagleboneai64_a72_defconfig
index c100ec48582..31923d70d94 100644
--- a/configs/j721e_beagleboneai64_a72_defconfig
+++ b/configs/j721e_beagleboneai64_a72_defconfig
@@ -59,11 +59,14 @@ CONFIG_SPL_RAM_DEVICE=y
 CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_ASKENV=y
 CONFIG_CMD_DFU=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPIO_READ=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
-- 
2.34.1



[PATCH 05/15] configs: j721e: Enable RTC emulation

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/j721e_evm_a72_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/j721e_evm_a72_defconfig b/configs/j721e_evm_a72_defconfig
index 5028caa1782..077bf508328 100644
--- a/configs/j721e_evm_a72_defconfig
+++ b/configs/j721e_evm_a72_defconfig
@@ -177,6 +177,8 @@ CONFIG_SPL_RAM=y
 CONFIG_REMOTEPROC_TI_K3_DSP=y
 CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_RESET_TI_SCI=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_EMULATION=y
 CONFIG_SCSI=y
 CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
@@ -207,3 +209,4 @@ CONFIG_SPL_DFU=y
 CONFIG_UFS=y
 CONFIG_CADENCE_UFS=y
 CONFIG_TI_J721E_UFS=y
+CONFIG_EFI_SET_TIME=y
-- 
2.34.1



[PATCH 11/15] configs: am62x: cosmetic config cleanup

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 4c1e4d7cc42..3e174ec37aa 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -17,6 +17,10 @@ CONFIG_DM_RESET=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x80c8
+CONFIG_SPL_BSS_MAX_SIZE=0x8
+CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SIZE_LIMIT=0x4
 CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0x800
 CONFIG_SPL_FS_FAT=y
@@ -32,12 +36,8 @@ CONFIG_SYS_BOOTM_LEN=0x80
 CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x58000
-CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x80c8
-CONFIG_SPL_BSS_MAX_SIZE=0x8
 CONFIG_SPL_SYS_REPORT_STACK_F_USAGE=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
-- 
2.34.1



[PATCH 12/15] configs: am62x: Enable basic EFI CMD support

2024-04-08 Thread Jonathan Humphreys
This is required to pass SystemReadyIR tests.

Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_evm_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_evm_a53_defconfig b/configs/am62x_evm_a53_defconfig
index 3e174ec37aa..ee585b3bc84 100644
--- a/configs/am62x_evm_a53_defconfig
+++ b/configs/am62x_evm_a53_defconfig
@@ -49,7 +49,10 @@ CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x28
 CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_MULTI_DTB_FIT=y
-- 
2.34.1



[PATCH 08/15] configs: am62px: cosmetic config cleanup

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 15 +--
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index 2621abb8ce1..db9e6635dce 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -1,6 +1,5 @@
 CONFIG_ARM=y
 CONFIG_ARCH_K3=y
-CONFIG_TI_SECURE_DEVICE=y
 CONFIG_SYS_MALLOC_F_LEN=0x8000
 CONFIG_SPL_GPIO=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
@@ -14,7 +13,6 @@ CONFIG_SF_DEFAULT_SPEED=2500
 CONFIG_ENV_SIZE=0x4
 CONFIG_DM_GPIO=y
 CONFIG_SPL_DM_SPI=y
-CONFIG_OF_UPSTREAM=y
 CONFIG_DEFAULT_DEVICE_TREE="ti/k3-am62p5-sk"
 CONFIG_SPL_TEXT_BASE=0x8008
 CONFIG_OF_LIBFDT_OVERLAY=y
@@ -22,6 +20,10 @@ CONFIG_DM_RESET=y
 CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x80a0
+CONFIG_SPL_BSS_MAX_SIZE=0x8
+CONFIG_SPL_STACK_R=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -30,15 +32,10 @@ CONFIG_SPL_SPI=y
 CONFIG_SPL_LOAD_FIT=y
 CONFIG_SPL_LOAD_FIT_ADDRESS=0x8100
 CONFIG_BOOTSTD_FULL=y
-CONFIG_BOOTSTD_DEFAULTS=y
 CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
 CONFIG_SPL_MAX_SIZE=0x58000
 CONFIG_SPL_PAD_TO=0x0
-CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x80a0
-CONFIG_SPL_BSS_MAX_SIZE=0x8
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x1400
 CONFIG_SPL_DMA=y
@@ -46,7 +43,6 @@ CONFIG_SPL_ENV_SUPPORT=y
 CONFIG_SPL_FS_LOAD_PAYLOAD_NAME="u-boot.img"
 CONFIG_SPL_I2C=y
 CONFIG_SPL_DM_MAILBOX=y
-CONFIG_SPL_MTD_SUPPORT=y
 CONFIG_SPL_DM_SPI_FLASH=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_RAM_SUPPORT=y
@@ -57,10 +53,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x28
 CONFIG_SPL_THERMAL=y
 CONFIG_SPL_YMODEM_SUPPORT=y
-CONFIG_SYS_MAXARGS=64
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
-CONFIG_CMD_DM=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
@@ -75,6 +69,7 @@ CONFIG_CMD_MTDPARTS=y
 CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_UPSTREAM=y
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT_NO_COMPRESSION=y
-- 
2.34.1



[PATCH 06/15] configs: beagleplay: Enable basic EFI CMD support

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am62x_beagleplay_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62x_beagleplay_a53_defconfig 
b/configs/am62x_beagleplay_a53_defconfig
index d9751bca666..5592328af76 100644
--- a/configs/am62x_beagleplay_a53_defconfig
+++ b/configs/am62x_beagleplay_a53_defconfig
@@ -47,10 +47,13 @@ CONFIG_SPL_I2C=y
 CONFIG_SPL_DM_MAILBOX=y
 CONFIG_SPL_POWER_DOMAIN=y
 CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_GPIO_READ=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_OF_CONTROL=y
-- 
2.34.1



[PATCH 09/15] configs: am62px: Enable basic EFI CMD support

2024-04-08 Thread Jonathan Humphreys
This is required to pass SystemReadyIR tests.

Signed-off-by: Jonathan Humphreys 
---
 configs/am62px_evm_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am62px_evm_a53_defconfig b/configs/am62px_evm_a53_defconfig
index db9e6635dce..a8b8ee76ca7 100644
--- a/configs/am62px_evm_a53_defconfig
+++ b/configs/am62px_evm_a53_defconfig
@@ -53,6 +53,8 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x28
 CONFIG_SPL_THERMAL=y
 CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_CLK=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPIO=y
@@ -63,6 +65,7 @@ CONFIG_CMD_MTD=y
 CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_USB_MASS_STORAGE=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_EXT4_WRITE=y
 CONFIG_CMD_MTDPARTS=y
-- 
2.34.1



[PATCH 02/15] configs: am64x: Enable basic EFI CMD support

2024-04-08 Thread Jonathan Humphreys
This is required to pass SystemReadyIR tests.

Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 35cbbee93d5..1cb7684c46c 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -63,12 +63,15 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x30
 CONFIG_SPL_THERMAL=y
 CONFIG_SPL_YMODEM_SUPPORT=y
+CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_ASKENV=y
+CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_DFU=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_USB=y
+CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
-- 
2.34.1



[PATCH 01/15] configs: am64x: cosmetic config cleanup

2024-04-08 Thread Jonathan Humphreys
Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index b7057be3d65..35cbbee93d5 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -24,6 +24,10 @@ CONFIG_SPL_MMC=y
 CONFIG_SPL_SERIAL=y
 CONFIG_SPL_DRIVERS_MISC=y
 CONFIG_SPL_STACK_R_ADDR=0x8200
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x80a0
+CONFIG_SPL_BSS_MAX_SIZE=0x8
+CONFIG_SPL_STACK_R=y
 CONFIG_SPL_FS_FAT=y
 CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
@@ -35,12 +39,8 @@ CONFIG_BOOTSTD_FULL=y
 CONFIG_BOOTCOMMAND="run envboot; bootflow scan -lb"
 CONFIG_BOARD_LATE_INIT=y
 CONFIG_SPL_MAX_SIZE=0x18
-CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
-CONFIG_SPL_BSS_START_ADDR=0x80a0
-CONFIG_SPL_BSS_MAX_SIZE=0x8
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_SPL_SYS_MALLOC_SIMPLE=y
-CONFIG_SPL_STACK_R=y
 CONFIG_SPL_SYS_MALLOC=y
 CONFIG_SPL_SYS_MALLOC_SIZE=0x80
 CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR=y
@@ -74,6 +74,7 @@ CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
+CONFIG_OF_UPSTREAM=y
 CONFIG_OF_LIST="ti/k3-am642-evm ti/k3-am642-sk"
 CONFIG_MULTI_DTB_FIT=y
 CONFIG_SPL_MULTI_DTB_FIT=y
@@ -170,4 +171,3 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
-CONFIG_OF_UPSTREAM=y
-- 
2.34.1



[PATCH 03/15] configs: am64x: Enable RTC emulation

2024-04-08 Thread Jonathan Humphreys
This is required to pass SystemReadyIR tests.

Signed-off-by: Jonathan Humphreys 
---
 configs/am64x_evm_a53_defconfig | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 1cb7684c46c..61b498b49a6 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -143,6 +143,8 @@ CONFIG_DM_REGULATOR_TPS65219=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
 CONFIG_RESET_TI_SCI=y
+CONFIG_DM_RTC=y
+CONFIG_RTC_EMULATION=y
 CONFIG_DM_SERIAL=y
 CONFIG_SOC_DEVICE=y
 CONFIG_SOC_DEVICE_TI_K3=y
@@ -174,3 +176,4 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_EFI_SET_TIME=y
-- 
2.34.1



[PATCH 00/15] configs: ti: Enable basic settings for SystemReady ACS

2024-04-08 Thread Jonathan Humphreys
Set basic settings needed for System Ready IR ACS testing, for several TI SoC
based platforms: AM64, AM62, AM62p, BeaglePlay, J7, and BeagleboneAI.

For AM64, AM62, and AM62p, also includes some config cleanup.  Should be no
functional change.

Jonathan Humphreys (15):
  configs: am64x: cosmetic config cleanup
  configs: am64x: Enable basic EFI CMD support
  configs: am64x: Enable RTC emulation
  configs: j721e: Enable basic EFI CMD support
  configs: j721e: Enable RTC emulation
  configs: beagleplay: Enable basic EFI CMD support
  configs: beagleplay: Enable RTC emulation
  configs: am62px: cosmetic config cleanup
  configs: am62px: Enable basic EFI CMD support
  configs: am62px: Enable RTC emulation
  configs: am62x: cosmetic config cleanup
  configs: am62x: Enable basic EFI CMD support
  configs: am62x: Enable RTC emulation
  configs: beagleboneai64: Enable basic EFI CMD support
  configs: beagleboneai64: Enable RTC emulation

 configs/am62px_evm_a53_defconfig   | 21 +++--
 configs/am62x_beagleplay_a53_defconfig |  6 ++
 configs/am62x_evm_a53_defconfig| 14 ++
 configs/am64x_evm_a53_defconfig| 16 +++-
 configs/j721e_beagleboneai64_a72_defconfig |  6 ++
 configs/j721e_evm_a72_defconfig|  6 ++
 6 files changed, 50 insertions(+), 19 deletions(-)

-- 
2.34.1



Re: [PATCH 2/2] mmc: Add support for the no-mmc-hs400 prop

2024-04-08 Thread Dragan Simic

On 2024-04-08 23:06, Jonas Karlman wrote:

The linux commit f722e650d965 ("mmc: core: add support for disabling
HS400 mode via DT") added support for a no-mmc-hs400 prop.

Add support for the no-mmc-hs400 prop to disable HS400 host caps.

Signed-off-by: Jonas Karlman 


The description above should use "Linux" instead od "linux", but that's
perhaps not worth sending the v2.

Otherwise, looking good to me.  Great job catching this!

Reviewed-by: Dragan Simic 


---
 drivers/mmc/mmc-uclass.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 1349da72b102..1b454e8ec758 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -256,6 +256,9 @@ int mmc_of_parse(struct udevice *dev, struct
mmc_config *cfg)
cfg->host_caps |= MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-enhanced-strobe"))
cfg->host_caps |= MMC_CAP(MMC_HS_400_ES);
+   if (dev_read_bool(dev, "no-mmc-hs400"))
+   cfg->host_caps &= ~(MMC_CAP(MMC_HS_400) |
+   MMC_CAP(MMC_HS_400_ES));

if (dev_read_bool(dev, "non-removable")) {
cfg->host_caps |= MMC_CAP_NONREMOVABLE;


Re: [PATCH 1/2] mmc: Imply HS200 cap with mmc-hs400 prop to match linux

2024-04-08 Thread Dragan Simic

Hello Jonas,

On 2024-04-08 23:06, Jonas Karlman wrote:
eMMC nodes in linux device tree files typically only contain a 
mmc-hs400
prop to signal support for both HS400 and HS200. However, U-Boot 
require

an explicit mmc-hs200 prop to signal support for the HS200 mode.

Fix this by follow linux and imply HS200 cap when HS400 cap is signaled
using a mmc-hs400 prop.

Signed-off-by: Jonas Karlman 


The description above should use "Linux" instead od "linux", but that's
perhaps not worth sending the v2.

Otherwise, looking good to me.  Great job catching this!

Reviewed-by: Dragan Simic 


---
This fixes booting from eMMC on nanopc-t6-rk3588 and quartzpro64-rk3588
that probably broke with commit 6de9d7b2f13c ("rockchip: rk35xx: Enable
eMMC HS200 mode by default").
---
 drivers/mmc/mmc-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 328456831dd2..1349da72b102 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -251,9 +251,9 @@ int mmc_of_parse(struct udevice *dev, struct
mmc_config *cfg)
if (dev_read_bool(dev, "mmc-hs200-1_2v"))
cfg->host_caps |= MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-1_8v"))
-   cfg->host_caps |= MMC_CAP(MMC_HS_400);
+   cfg->host_caps |= MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-1_2v"))
-   cfg->host_caps |= MMC_CAP(MMC_HS_400);
+   cfg->host_caps |= MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-enhanced-strobe"))
cfg->host_caps |= MMC_CAP(MMC_HS_400_ES);


[PATCH 2/2] mmc: Add support for the no-mmc-hs400 prop

2024-04-08 Thread Jonas Karlman
The linux commit f722e650d965 ("mmc: core: add support for disabling
HS400 mode via DT") added support for a no-mmc-hs400 prop.

Add support for the no-mmc-hs400 prop to disable HS400 host caps.

Signed-off-by: Jonas Karlman 
---
 drivers/mmc/mmc-uclass.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 1349da72b102..1b454e8ec758 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -256,6 +256,9 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config 
*cfg)
cfg->host_caps |= MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-enhanced-strobe"))
cfg->host_caps |= MMC_CAP(MMC_HS_400_ES);
+   if (dev_read_bool(dev, "no-mmc-hs400"))
+   cfg->host_caps &= ~(MMC_CAP(MMC_HS_400) |
+   MMC_CAP(MMC_HS_400_ES));
 
if (dev_read_bool(dev, "non-removable")) {
cfg->host_caps |= MMC_CAP_NONREMOVABLE;
-- 
2.43.2



[PATCH 1/2] mmc: Imply HS200 cap with mmc-hs400 prop to match linux

2024-04-08 Thread Jonas Karlman
eMMC nodes in linux device tree files typically only contain a mmc-hs400
prop to signal support for both HS400 and HS200. However, U-Boot require
an explicit mmc-hs200 prop to signal support for the HS200 mode.

Fix this by follow linux and imply HS200 cap when HS400 cap is signaled
using a mmc-hs400 prop.

Signed-off-by: Jonas Karlman 
---
This fixes booting from eMMC on nanopc-t6-rk3588 and quartzpro64-rk3588
that probably broke with commit 6de9d7b2f13c ("rockchip: rk35xx: Enable
eMMC HS200 mode by default").
---
 drivers/mmc/mmc-uclass.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c
index 328456831dd2..1349da72b102 100644
--- a/drivers/mmc/mmc-uclass.c
+++ b/drivers/mmc/mmc-uclass.c
@@ -251,9 +251,9 @@ int mmc_of_parse(struct udevice *dev, struct mmc_config 
*cfg)
if (dev_read_bool(dev, "mmc-hs200-1_2v"))
cfg->host_caps |= MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-1_8v"))
-   cfg->host_caps |= MMC_CAP(MMC_HS_400);
+   cfg->host_caps |= MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-1_2v"))
-   cfg->host_caps |= MMC_CAP(MMC_HS_400);
+   cfg->host_caps |= MMC_CAP(MMC_HS_400) | MMC_CAP(MMC_HS_200);
if (dev_read_bool(dev, "mmc-hs400-enhanced-strobe"))
cfg->host_caps |= MMC_CAP(MMC_HS_400_ES);
 
-- 
2.43.2



Pull request efi-2024-07-rc1

2024-04-08 Thread Heinrich Schuchardt

Dear Tom,

The following changes since commit 9cba29b19f43f9450117e8bc89e7dda691ed5ab5:

  Merge tag 'u-boot-imx-master-20240405' of
https://gitlab.denx.de/u-boot/custodians/u-boot-imx (2024-04-05 17:23:58
-0400)

are available in the Git repository at:

  https://source.denx.de/u-boot/custodians/u-boot-efi.git
tags/efi-2024-07-rc1

for you to fetch changes up to 3f8d13044b32ddd906bb9f2fc705b988ec93df35:

  efi_loader: access __efi_runtime_rel_start/stop without & (2024-04-08
13:05:50 +0200)

Gitlab CI showed no issues:
https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/20252


Pull request efi-2024-07-rc1

Documentation:

* improve description of FAT partition name generation
* add missing :: in doc/usage/cmd/itest.rst

UEFI:

* fix address mode for __efi_runtime_start/stop,
  __efi_runtime_rel_start/stop
* fix size of variable attribute constants
* enable booting via EFI boot manager by default
* correct the sequence of the EFI boot methods
* correct finding the default EFI binary
* don't delete variable from memory if update failed
* fix append write behavior to non-existent variable
* Use binman for testing capsule updates on the sandbox
* Consider capsule test files in .gitignore and make clean


Heinrich Schuchardt (9):
  doc: missing :: in doc/usage/cmd/itest.rst
  doc: improve description of FAT partition name generation
  efi_loader: all variable attributes are 32bit
  efi_loader: EFI_VARIABLE_READ_ONLY should be 32bit
  efi_loader: handle EFI_VARIABLE_ENHANCED_AUTHENTICATED_ACCESS
  boot: correct the default sequence of boot methods
  boot: enable booting via EFI boot manager by default
  efi_loader: move HOST_ARCH to version_autogenerated.h
  boot: correct finding the default EFI binary

Ilias Apalodimas (3):
  efi_loader: Don't delete variable from memory if adding a new one
failed
  efi_loader: access __efi_runtime_start/stop without &
  efi_loader: access __efi_runtime_rel_start/stop without &

Masahisa Kojima (1):
  efi_loader: fix append write behavior to non-existent variable

Sughosh Ganu (4):
  sandbox: capsule: remove capsule related configs
  sandbox: capsule: binman: generate some capsules as part of build
  capsule: add the generated capsules to gitignore
  capsule: Makefile: add the generated files to CLEAN_FILES list

 .gitignore |   3 +
 Makefile   |   4 +-
 arch/sandbox/config.mk |   2 -
 arch/sandbox/dts/sandbox.dts   |   4 +
 arch/sandbox/dts/sandbox_capsule.dtsi  | 169
+
 arch/sandbox/dts/test.dts  |   4 +
 boot/Kconfig   |  10 ++
 boot/Makefile  |   2 +-
 boot/bootmeth_efi.c|  46 +-
 boot/bootmeth_efi_mgr.c|   2 +-
 boot/bootmeth_pxe.c|   2 +-
 configs/sandbox64_defconfig|   5 -
 configs/sandbox_noinst_defconfig   |   2 -
 configs/sandbox_spl_defconfig  |   2 -
 configs/sandbox_vpl_defconfig  |   2 -
 doc/usage/cmd/itest.rst|   2 +
 doc/usage/partitions.rst   |  17 ++-
 include/efi.h  |  18 ++-
 include/efi_variable.h |   2 +-
 include/host_arch.h|   2 +
 lib/efi_loader/Kconfig |   1 -
 lib/efi_loader/Makefile|   3 +-
 lib/efi_loader/efi_memory.c|   4 +-
 lib/efi_loader/efi_runtime.c   |   6 +-
 lib/efi_loader/efi_var_common.c|   2 +-
 lib/efi_loader/efi_variable.c  |  45 --
 lib/efi_selftest/efi_selftest_variables.c  |  48 +-
 test/boot/bootflow.c   |   6 +-
 .../tests/test_efi_capsule/capsule_gen_binman.dts  | 167
+---
 test/py/tests/test_efi_capsule/conftest.py |   1 +
 30 files changed, 326 insertions(+), 257 deletions(-)
 create mode 100644 arch/sandbox/dts/sandbox_capsule.dtsi


[PATCH 2/2] arch: zynqmp: Move CMD_ZYNQMP Kconfig from board to arch

2024-04-08 Thread Charlie Johnston
Since the previous commit moved the zynqmp command to cmds and the
command depends on the arch rather than the board, this commit
moves the Kconfig entry into the arch/arm/mach-zynqmp/Kconfig

Signed-off-by: Charlie Johnston 
---
 arch/arm/mach-zynqmp/Kconfig | 13 -
 board/xilinx/zynqmp/Kconfig  | 19 ---
 2 files changed, 12 insertions(+), 20 deletions(-)
 delete mode 100644 board/xilinx/zynqmp/Kconfig

diff --git a/arch/arm/mach-zynqmp/Kconfig b/arch/arm/mach-zynqmp/Kconfig
index 6a7be0b427..ed0aa29c12 100644
--- a/arch/arm/mach-zynqmp/Kconfig
+++ b/arch/arm/mach-zynqmp/Kconfig
@@ -212,7 +212,18 @@ config SD1_LSHFT_MODE
 
 endchoice
 
+config CMD_ZYNQMP
+   bool "Enable ZynqMP specific commands"
+   depends on ZYNQMP_FIRMWARE
+   default y
+   help
+ Enable ZynqMP specific commands like "zynqmp secure"
+ which is used for zynqmp secure image verification.
+ The secure image is a xilinx specific BOOT.BIN with
+ either authentication or encryption or both encryption
+ and authentication feature enabled while generating
+ BOOT.BIN using Xilinx bootgen tool.
+
 source "board/xilinx/Kconfig"
-source "board/xilinx/zynqmp/Kconfig"
 
 endif
diff --git a/board/xilinx/zynqmp/Kconfig b/board/xilinx/zynqmp/Kconfig
deleted file mode 100644
index ffa2f0215d..00
--- a/board/xilinx/zynqmp/Kconfig
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright (c) 2018, Xilinx, Inc.
-#
-# SPDX-License-Identifier: GPL-2.0
-
-if ARCH_ZYNQMP
-
-config CMD_ZYNQMP
-   bool "Enable ZynqMP specific commands"
-   depends on ZYNQMP_FIRMWARE
-   default y
-   help
- Enable ZynqMP specific commands like "zynqmp secure"
- which is used for zynqmp secure image verification.
- The secure image is a xilinx specific BOOT.BIN with
- either authentication or encryption or both encryption
- and authentication feature enabled while generating
- BOOT.BIN using Xilinx bootgen tool.
-
-endif
-- 
2.34.1



[PATCH 1/2] board: zynqmp: Move zynqmp commands from board/ to cmd/

2024-04-08 Thread Charlie Johnston
The zynqmp cmds.c is currently tied to the board but the commands
contained within are more closely tied to the architecture. To
allow usage of those commands when the architecture is ZynqMP but
the board is not, this change moves the cmds into the cmd/ tree
instead of the board tree that would only be included if the board
were also a ZynqMP predefined board.

Signed-off-by: Charlie Johnston 
---
 board/xilinx/zynqmp/Makefile   | 4 
 cmd/Makefile   | 3 +++
 board/xilinx/zynqmp/cmds.c => cmd/zynqmp.c | 0
 3 files changed, 3 insertions(+), 4 deletions(-)
 rename board/xilinx/zynqmp/cmds.c => cmd/zynqmp.c (100%)

diff --git a/board/xilinx/zynqmp/Makefile b/board/xilinx/zynqmp/Makefile
index 204e4fadf0..9ab50eca40 100644
--- a/board/xilinx/zynqmp/Makefile
+++ b/board/xilinx/zynqmp/Makefile
@@ -40,10 +40,6 @@ $(obj)/pm_cfg_obj.o: $(shell cd $(srctree); readlink -f 
$(CONFIG_ZYNQMP_SPL_PM_C
 endif
 endif
 
-ifndef CONFIG_SPL_BUILD
-obj-$(CONFIG_CMD_ZYNQMP) += cmds.o
-endif
-
 # Suppress "warning: function declaration isn't a prototype"
 CFLAGS_REMOVE_psu_init_gpl.o := -Wstrict-prototypes
 
diff --git a/cmd/Makefile b/cmd/Makefile
index 87133cc27a..7afb1c9a7c 100644
--- a/cmd/Makefile
+++ b/cmd/Makefile
@@ -232,6 +232,9 @@ obj-$(CONFIG_CMD_SCP03) += scp03.o
 
 obj-$(CONFIG_HUSH_SELECTABLE) += cli.o
 
+# ZynqMP
+obj-$(CONFIG_CMD_ZYNQMP) += zynqmp.o
+
 obj-$(CONFIG_ARM) += arm/
 obj-$(CONFIG_RISCV) += riscv/
 obj-$(CONFIG_SANDBOX) += sandbox/
diff --git a/board/xilinx/zynqmp/cmds.c b/cmd/zynqmp.c
similarity index 100%
rename from board/xilinx/zynqmp/cmds.c
rename to cmd/zynqmp.c
-- 
2.34.1



[PATCH 0/2] arch: zynqmp: Make zynqmp command more accessible.

2024-04-08 Thread Charlie Johnston
While working on a third-party board using a ZynqMP, I was unable to use
the zynqmp command even with the proper config definitions. While that
command appears tied to the architecture, it was being included based on
the board selection instead.

This patch series moves the command to be accessible to any ZynqMP arch
based board.




Re: [PATCH] doc: build: update docker image to latest

2024-04-08 Thread Tom Rini
On Fri, Apr 05, 2024 at 08:16:19AM +0200, Mattijs Korpershoek wrote:


> commit cacc0b2678c0 ("CI: Move to latest container image") updated the
> docker container image.
> 
> Reflect the change in the documentation.
> 
> Signed-off-by: Mattijs Korpershoek 

I'm fine with updating this for now, so:

Reviewed-by: Tom Rini 

But I think longer term we/I should reword the section to be clear
that's an example syntax not a "recreate the current tag" since only I
can push that result.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 00/14] rockchip: rk3308: Sync DT with linux v6.8 and update defconfigs

2024-04-08 Thread Tom Rini
On Mon, Apr 08, 2024 at 09:55:59PM +0200, Jonas Karlman wrote:
> Hi Tom,
> 
> On 2024-04-08 21:38, Tom Rini wrote:
> > On Mon, Apr 08, 2024 at 06:13:57PM +, Jonas Karlman wrote:
> >> This series adds support for new clocks used in linux v6.8 device trees,
> >> enables use of FIT signature check for checksum validation and fixes
> >> loading FIT from SD-card when loading FIT from eMMC fails.
> >>
> >> It should be possible to move RK3308 boards to use OF_UPSTREAM in a
> >> future series after this has been applied.
> >>
> >> I have runtime tested this series on a Radxa ROCK Pi S v1.3 having a
> >> RK3308B SoC. Following was tested and now working after this: SD-card,
> >> eMMC (SD NAND), Ethernet, USB host and USB gadget (RockUSB and UMS).
> >>
> >> Changes in v2:
> >> - Add clocks and resets props to otp node
> >> - Add bootph-some-ram to emmc and sdmmc pinctrl nodes
> >> - Sort bootph-all prop after compatible and reg props
> >> - Fix rk3308-evb debug uart
> >> - New patch to move cru and grf include files to arch-rockchip
> > 
> > Sorry if I missed the answer in v1, but why aren't we switching to
> > OF_UPSTREAM here, which is also on v6.8 currently? Thanks.
> > 
> 
> I would like to keep the switch to OF_UPSTREAM in a separate series
> because of reviewability, some of the device tree files has not been
> updated since v5.5-rc1, also I would like to have the option of
> cherry-picking these patches to e.g. a 2024.04 branch.
> 
> What is the expected update cadence on OF_UPSTREAM, will there be an
> update to v6.9 before v2024.07 or will U-Boot be one version behind
> linux at release time?

If v6.9 comes out before I open the next branch, yes, it will be in
v2024.07 otherwise no. I have to double check my emails before
repeating if it's rc2 or rc3 I'm trying to regularly do that with, and
then update doc/develop/release_cycle.rst to list it clearly.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH v2 00/14] rockchip: rk3308: Sync DT with linux v6.8 and update defconfigs

2024-04-08 Thread Jonas Karlman
Hi Tom,

On 2024-04-08 21:38, Tom Rini wrote:
> On Mon, Apr 08, 2024 at 06:13:57PM +, Jonas Karlman wrote:
>> This series adds support for new clocks used in linux v6.8 device trees,
>> enables use of FIT signature check for checksum validation and fixes
>> loading FIT from SD-card when loading FIT from eMMC fails.
>>
>> It should be possible to move RK3308 boards to use OF_UPSTREAM in a
>> future series after this has been applied.
>>
>> I have runtime tested this series on a Radxa ROCK Pi S v1.3 having a
>> RK3308B SoC. Following was tested and now working after this: SD-card,
>> eMMC (SD NAND), Ethernet, USB host and USB gadget (RockUSB and UMS).
>>
>> Changes in v2:
>> - Add clocks and resets props to otp node
>> - Add bootph-some-ram to emmc and sdmmc pinctrl nodes
>> - Sort bootph-all prop after compatible and reg props
>> - Fix rk3308-evb debug uart
>> - New patch to move cru and grf include files to arch-rockchip
> 
> Sorry if I missed the answer in v1, but why aren't we switching to
> OF_UPSTREAM here, which is also on v6.8 currently? Thanks.
> 

I would like to keep the switch to OF_UPSTREAM in a separate series
because of reviewability, some of the device tree files has not been
updated since v5.5-rc1, also I would like to have the option of
cherry-picking these patches to e.g. a 2024.04 branch.

What is the expected update cadence on OF_UPSTREAM, will there be an
update to v6.9 before v2024.07 or will U-Boot be one version behind
linux at release time?

Regards,
Jonas



Re: [PATCH v2 00/14] rockchip: rk3308: Sync DT with linux v6.8 and update defconfigs

2024-04-08 Thread Tom Rini
On Mon, Apr 08, 2024 at 06:13:57PM +, Jonas Karlman wrote:
> This series adds support for new clocks used in linux v6.8 device trees,
> enables use of FIT signature check for checksum validation and fixes
> loading FIT from SD-card when loading FIT from eMMC fails.
> 
> It should be possible to move RK3308 boards to use OF_UPSTREAM in a
> future series after this has been applied.
> 
> I have runtime tested this series on a Radxa ROCK Pi S v1.3 having a
> RK3308B SoC. Following was tested and now working after this: SD-card,
> eMMC (SD NAND), Ethernet, USB host and USB gadget (RockUSB and UMS).
> 
> Changes in v2:
> - Add clocks and resets props to otp node
> - Add bootph-some-ram to emmc and sdmmc pinctrl nodes
> - Sort bootph-all prop after compatible and reg props
> - Fix rk3308-evb debug uart
> - New patch to move cru and grf include files to arch-rockchip

Sorry if I missed the answer in v1, but why aren't we switching to
OF_UPSTREAM here, which is also on v6.8 currently? Thanks.

-- 
Tom


signature.asc
Description: PGP signature


Re: Can't get U-Boot working on Geniatech XPI-3566-ZERO

2024-04-08 Thread Jonas Karlman
Hi Z,

On 2024-04-08 09:40, Mizsei Zoltán wrote:
> Hi,
> 
> I'm trying to get a mainline U-Boot running on the Geniatech XPI-3566-ZERO 
> RK3566 based SBC [1], but all my attempts have failed so far.
> 
> The SBC doesn't have any SD-Card slot, please keep this in mind!
> 
> I can build U-Boot, but when I write the resulting binary to the eMMC using 
> rkdeveloptool, the boot stops and I see no output on the UART pins using 
> 150 baud transfer rate.
> 
> My steps were the following:
> 
> - git clone https://github.com/u-boot/u-boot
> - cd u-boot
> - CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make rk3568_defconfig

There is no rk3568_defconfig target but generic-rk3568_defconfig may work 
better.

> - ROCKCHIP_TPL='rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.21.bin'  
> BL31='rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- 
> make
> - rkdeveloptool db MiniLoaderAll.bin
> - rkdeveloptool wl 64 u-boot-rockchip.bin
> 
> After that I can no longer communicate with the board via UART and it no 
> longer boots.

After looking at the specification for this board it looks like GPIO pin 8 and 
10 is connected to uart1 and not uart2 that is typically used for debug uart on 
rockchip devices.

> 
> I've built uboot countless times, I've followed all sorts of guides, I've 
> tried modifying FDT and transplanting the DTS from the official SDK, I have 
> tried vanilla defconfigs and tried to modify them aswell, I think I've tried 
> everything, but no matter what I do I just can't get it working.
> The vendored U-Boot works ok, but I plant to run OpenBSD, for which an 
> upstream U-Boot would be better situated (according to the OBSD mailing list).
> 
> Please give me some hints because I'm running out of ideas. I've spent 
> countless hours trying to get this to work but haven't succeeded.

You can try changing stdout-path to "serial1:150n8" and enable the uart1 
node in generic-rk3568.dts.
Also change to CONFIG_DEBUG_UART_BASE=0xFE65, and also use rkbin 
tools/ddrbin_tool and change to use uart1 on ddr bin.

After that you should probably start seeing something on uart and that may help 
you get a little bit further.

Regards,
Jonas

> 
> Thank You very much!
> 
> Best Regards,
> 
> --Z--
> 
> [1] https://www.geniatech.com/product/xpi-3566-zero/



Issues reading large files from nand ubifs ARM64

2024-04-08 Thread Matthew Rainey
Hello U-Boot community,

I am having issues reading large files (~20 MiB and larger) from nand flash on 
an arm64 development board. Smaller files load and work as intended. I have 
tested this in linux, which also works as intended. However, in U-Boot, it 
gives the following error:

ubifsload 0x9000 "core-image-minimal-ls1046afrwy.cpio.gz.u-boot"
Loading file 'core-image-minimal-ls1046afrwy.cpio.gz.u-boot' to addr 
0x9000...
UBIFS error (ubi0:0 pid 0): do_readpage: cannot read page 5553 of inode 66, 
error -12
Error reading file 'core-image-minimal-ls1046afrwy.cpio.gz.u-boot'
** File not found core-image-minimal-ls1046afrwy.cpio.gz.u-boot **

It seems to fail on a random page between 300 and 6000. Nand reads after this 
error cause U-Boot to panic.

Digging a bit deeper, error -12 (-ENOMEM) seems to come from line 274 and 413 
in tnc_misc.c. It seems to alternate between the two.
https://github.com/u-boot/u-boot/blob/master/fs/ubifs/tnc_misc.c

I looked around and don’t see an obvious memory leak. I have 4 GiB of ram, 
which should be plenty. This issue also doesn’t exist using just UBI (not 
ubifs) to the same location, so It feels like the ubifs driver is messing up. I 
have tried U-Boot 2019.10 and 2022.04, and they both present the same issue.

I’m using this to load a rootfs ramdisk (~141 MiB) into ram. As an absolute 
last resort, I could split the rootfs into 16 MiB files, and stitch them 
together in u-boot. Hopefully I won’t have to do that 

If you need additional information, please do not hesitate to contact me.
Thank you,
Matt


U-Boot/UKI Relationship Regarding Multiple DTBs

2024-04-08 Thread vindicator
Is u-boot capable of selecting the correct DTB in a UKI during boot?

I saw "doc/README.multi-dtb-fit", which at least somewhat addresses
what I'm looking for I think, but I'm not sure if that will relate
directly with executing a UKI that has multiple DTBs...

For my one board, I was working on building a workable "tinyconfig"
kernel, but then also had the thought to maybe also build another
"allyesconfig" kernel (one time) so I can figure out everything that
gets used for ANY board (supported for $ARCH).
Then another thought came after that, that maybe I could pile in all
of the DTBs the kernel supports into a UKI (via "ukify"), which is
where I came across https://github.com/systemd/systemd/issues/31946
(convenient timing being so recent).

So it looks like my thinking is "doable", but just hasn't been done
yet in "ukify", and I'd thought I'd check here if there's anything
that needs to be done from u-boot's end as well.


Re: [PATCH v2 11/11] net: dwc_eth_qos: Add support for st, ext-phyclk property

2024-04-08 Thread Christophe ROULLIER

-Original Message-
From: Marek Vasut
Sent: Tuesday, March 26, 2024 1:08 PM
To:u-boot@lists.denx.de
Cc: Marek Vasut; Christophe ROULLIER; Joe 
Hershberger; Patrice CHOTARD - foss; Patrick 
DELAUNAY - foss; Ramon 
Fried;u-b...@dh-electronics.com;uboot-st...@st-md-mailman.stormreply.com
Subject: [PATCH v2 11/11] net: dwc_eth_qos: Add support for st,ext-phyclk 
property

The "st,ext-phyclk" property is a unification of "st,eth-clk-sel"
and "st,eth-ref-clk-sel" properties. All three properties define ETH CK clock 
direction, however:
- "st,eth-clk-sel" selects clock direction for GMII/RGMII mode
- "st,eth-ref-clk-sel" selects clock direction for RMII mode
- "st,ext-phyclk" selects clock direction for all RMII/GMII/RGMII modes The 
"st,ext-phyclk" is the preferrable property to use.

Signed-off-by: Marek Vasut
---
Cc: Christophe Roullier
Cc: Joe Hershberger
Cc: Patrice Chotard
Cc: Patrick Delaunay
Cc: Ramon Fried
Cc:u-b...@dh-electronics.com
Cc:uboot-st...@st-md-mailman.stormreply.com
---
V2: New patch
---
  drivers/net/dwc_eth_qos_stm32.c | 30 +++---
  1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/drivers/net/dwc_eth_qos_stm32.c b/drivers/net/dwc_eth_qos_stm32.c 
index 435473f99a6..9ee82b54c62 100644
--- a/drivers/net/dwc_eth_qos_stm32.c
+++ b/drivers/net/dwc_eth_qos_stm32.c
@@ -140,6 +140,8 @@ static int eqos_probe_syscfg_stm32(struct udevice *dev,
 const bool is_mp13 = device_is_compatible(dev, "st,stm32mp13-dwmac");
 /* Gigabit Ethernet 125MHz clock selection. */
 const bool eth_clk_sel = dev_read_bool(dev, "st,eth-clk-sel");
+   /* Ethernet clock source is RCC. */
+   const bool ext_phyclk = dev_read_bool(dev, "st,ext-phyclk");
 struct regmap *regmap;
 u32 regmap_mask;
 u32 value;
@@ -156,6 +158,12 @@ static int eqos_probe_syscfg_stm32(struct udevice *dev,
 dev_dbg(dev, "PHY_INTERFACE_MODE_MII\n");
 value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK,
SYSCFG_PMCSETR_ETH_SEL_GMII_MII);
+   /*
+* STM32MP15xx supports both MII and GMII, STM32MP13xx MII only.
+* SYSCFG_PMCSETR ETH_SELMII is present only on STM32MP15xx and
+* acts as a selector between 0:GMII and 1:MII. As STM32MP13xx
+* supports only MII, ETH_SELMII is not present.
+*/
 if (!is_mp13)   /* Select MII mode on STM32MP15xx */
 value |= SYSCFG_PMCSETR_ETH_SELMII;
 break;
@@ -163,14 +171,25 @@ static int eqos_probe_syscfg_stm32(struct udevice *dev,
 dev_dbg(dev, "PHY_INTERFACE_MODE_GMII\n");
 value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK,
SYSCFG_PMCSETR_ETH_SEL_GMII_MII);
-   if (eth_clk_sel)
+   /*
+* If eth_clk_sel is set, use internal ETH_CLKx clock from RCC,
+* otherwise use external clock from IO pin (requires matching
+* GPIO block AF setting of that pin).
+*/
+   if (eth_clk_sel || ext_phyclk)
 value |= SYSCFG_PMCSETR_ETH_CLK_SEL;
 break;
 case PHY_INTERFACE_MODE_RMII:
 dev_dbg(dev, "PHY_INTERFACE_MODE_RMII\n");
 value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK,
SYSCFG_PMCSETR_ETH_SEL_RMII);
-   if (eth_ref_clk_sel)
+   /*
+* If eth_ref_clk_sel is set, use internal clock from RCC,
+* otherwise use external clock from ETHn_RX_CLK/ETHn_REF_CLK
+* IO pin (requires matching GPIO block AF setting of that
+* pin).
+*/
+   if (eth_ref_clk_sel || ext_phyclk)
 value |= SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
 break;
 case PHY_INTERFACE_MODE_RGMII:
@@ -180,7 +199,12 @@ static int eqos_probe_syscfg_stm32(struct udevice *dev,
 dev_dbg(dev, "PHY_INTERFACE_MODE_RGMII\n");
 value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK,
SYSCFG_PMCSETR_ETH_SEL_RGMII);
-   if (eth_clk_sel)
+   /*
+* If eth_clk_sel is set, use internal ETH_CLKx clock from RCC,
+* otherwise use external clock from ETHx_CLK125 pin (requires
+* matching GPIO block AF setting of that pin).
+*/
+   if (eth_clk_sel || ext_phyclk)
 value |= SYSCFG_PMCSETR_ETH_CLK_SEL;
 break;
 default:
--
2.43.0


Reviewed-by: Christophe ROULLIER 


Re: [PATCH v2 10/11] net: dwc_eth_qos: Add support of STM32MP13xx platform

2024-04-08 Thread Christophe ROULLIER

-Original Message-
From: Marek Vasut
Sent: Tuesday, March 26, 2024 1:08 PM
To:u-boot@lists.denx.de
Cc: Christophe ROULLIER; Patrice CHOTARD - 
foss; Marek Vasut; Joe 
Hershberger; Patrick DELAUNAY - foss; Ramon 
Fried;u-b...@dh-electronics.com;uboot-st...@st-md-mailman.stormreply.com
Subject: [PATCH v2 10/11] net: dwc_eth_qos: Add support of STM32MP13xx platform

From: Christophe Roullier

Add compatible "st,stm32mp13-dwmac" to manage STM32MP13 boards.

Reviewed-by: Patrice Chotard
Signed-off-by: Christophe Roullier
Signed-off-by: Marek Vasut  # Rebase, reshuffle, squash code
---
Cc: Christophe Roullier
Cc: Joe Hershberger
Cc: Patrice Chotard
Cc: Patrick Delaunay
Cc: Ramon Fried
Cc:u-b...@dh-electronics.com
Cc:uboot-st...@st-md-mailman.stormreply.com
---
V2: Add RB from Patrice
---
  drivers/net/dwc_eth_qos.c   |  4 
  drivers/net/dwc_eth_qos.h   |  1 +
  drivers/net/dwc_eth_qos_stm32.c | 11 +++
  3 files changed, 16 insertions(+)

diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c index 
203bfc0848c..e02317905e5 100644
--- a/drivers/net/dwc_eth_qos.c
+++ b/drivers/net/dwc_eth_qos.c
@@ -1505,6 +1505,10 @@ static const struct udevice_id eqos_ids[] = {
 },
  #endif
  #if IS_ENABLED(CONFIG_DWC_ETH_QOS_STM32)
+   {
+   .compatible = "st,stm32mp13-dwmac",
+   .data = (ulong)_stm32mp13_config
+   },
 {
 .compatible = "st,stm32mp1-dwmac",
 .data = (ulong)_stm32mp15_config diff --git 
a/drivers/net/dwc_eth_qos.h b/drivers/net/dwc_eth_qos.h index 
bafd0d339fb..8b3d0d464d3 100644
--- a/drivers/net/dwc_eth_qos.h
+++ b/drivers/net/dwc_eth_qos.h
@@ -290,5 +290,6 @@ int eqos_null_ops(struct udevice *dev);  extern struct 
eqos_config eqos_imx_config;  extern struct eqos_config eqos_rockchip_config;  
extern struct eqos_config eqos_qcom_config;
+extern struct eqos_config eqos_stm32mp13_config;
  extern struct eqos_config eqos_stm32mp15_config;  extern struct eqos_config 
eqos_jh7110_config; diff --git a/drivers/net/dwc_eth_qos_stm32.c 
b/drivers/net/dwc_eth_qos_stm32.c index 5a20fe5bea2..435473f99a6 100644
--- a/drivers/net/dwc_eth_qos_stm32.c
+++ b/drivers/net/dwc_eth_qos_stm32.c
@@ -279,6 +279,17 @@ static struct eqos_ops eqos_stm32_ops = {
 .eqos_get_tick_clk_rate = eqos_get_tick_clk_rate_stm32  };

+struct eqos_config __maybe_unused eqos_stm32mp13_config = {
+   .reg_access_always_ok = false,
+   .mdio_wait = 1,
+   .swr_wait = 50,
+   .config_mac = EQOS_MAC_RXQ_CTRL0_RXQ0EN_ENABLED_DCB,
+   .config_mac_mdio = EQOS_MAC_MDIO_ADDRESS_CR_250_300,
+   .axi_bus_width = EQOS_AXI_WIDTH_32,
+   .interface = dev_read_phy_mode,
+   .ops = _stm32_ops
+};
+
  struct eqos_config __maybe_unused eqos_stm32mp15_config = {
 .reg_access_always_ok = false,
 .mdio_wait = 1,
--
2.43.0


Reviewed-by: Christophe ROULLIER 


Re: [PATCH v2 09/11] net: dwc_eth_qos: Add DT parsing for STM32MP13xx platform

2024-04-08 Thread Christophe ROULLIER

-Original Message-
From: Marek Vasut
Sent: Tuesday, March 26, 2024 1:08 PM
To:u-boot@lists.denx.de
Cc: Christophe ROULLIER; Marek Vasut; Joe 
Hershberger; Patrice CHOTARD - foss; Patrick 
DELAUNAY - foss; Ramon 
Fried;u-b...@dh-electronics.com;uboot-st...@st-md-mailman.stormreply.com
Subject: [PATCH v2 09/11] net: dwc_eth_qos: Add DT parsing for STM32MP13xx 
platform

From: Christophe Roullier

Manage 2 ethernet instances, select which instance to configure with mask If 
mask is not present in DT, it is stm32mp15 platform.

Signed-off-by: Christophe Roullier
Signed-off-by: Marek Vasut  # Rework the code
---
Cc: Christophe Roullier
Cc: Joe Hershberger
Cc: Patrice Chotard
Cc: Patrick Delaunay
Cc: Ramon Fried
Cc:u-b...@dh-electronics.com
Cc:uboot-st...@st-md-mailman.stormreply.com
---
V2: - Drop unrelated clock frequency validation
 - Move "st,ext-phyclk" property support into separate patch
 - This leaves only the regmap parts here
---
  drivers/net/dwc_eth_qos_stm32.c | 41 ++---
  1 file changed, 28 insertions(+), 13 deletions(-)

diff --git a/drivers/net/dwc_eth_qos_stm32.c b/drivers/net/dwc_eth_qos_stm32.c 
index 0b13d01346b..5a20fe5bea2 100644
--- a/drivers/net/dwc_eth_qos_stm32.c
+++ b/drivers/net/dwc_eth_qos_stm32.c
@@ -23,6 +23,7 @@
  #include 
  #include 
  #include 
+#include 
  #include 
  #include 
  #include 
@@ -33,11 +34,16 @@

  /* SYSCFG registers */
  #define SYSCFG_PMCSETR 0x04
-#define SYSCFG_PMCCLRR 0x44
+#define SYSCFG_PMCCLRR_MP130x08
+#define SYSCFG_PMCCLRR_MP150x44
+
+#define SYSCFG_PMCSETR_ETH1_MASK   GENMASK(23, 16)
+#define SYSCFG_PMCSETR_ETH2_MASK   GENMASK(31, 24)

  #define SYSCFG_PMCSETR_ETH_CLK_SEL BIT(16)
  #define SYSCFG_PMCSETR_ETH_REF_CLK_SEL BIT(17)

+/* STM32MP15xx specific bit */
  #define SYSCFG_PMCSETR_ETH_SELMII  BIT(20)

  #define SYSCFG_PMCSETR_ETH_SEL_MASKGENMASK(23, 21)
@@ -130,23 +136,30 @@ static int eqos_probe_syscfg_stm32(struct udevice *dev,  {
 /* Ethernet 50MHz RMII clock selection. */
 const bool eth_ref_clk_sel = dev_read_bool(dev, "st,eth-ref-clk-sel");
+   /* SoC is STM32MP13xx with two ethernet MACs */
+   const bool is_mp13 = device_is_compatible(dev, "st,stm32mp13-dwmac");
 /* Gigabit Ethernet 125MHz clock selection. */
 const bool eth_clk_sel = dev_read_bool(dev, "st,eth-clk-sel");
-   u8 *syscfg;
+   struct regmap *regmap;
+   u32 regmap_mask;
 u32 value;

-   syscfg = (u8 *)syscon_get_first_range(STM32MP_SYSCON_SYSCFG);
-   if (!syscfg)
-   return -ENODEV;
+   regmap = syscon_regmap_lookup_by_phandle(dev, "st,syscon");
+   if (IS_ERR(regmap))
+   return PTR_ERR(regmap);
+
+   regmap_mask = dev_read_u32_index_default(dev, "st,syscon", 2,
+SYSCFG_PMCSETR_ETH1_MASK);

 switch (interface_type) {
 case PHY_INTERFACE_MODE_MII:
 dev_dbg(dev, "PHY_INTERFACE_MODE_MII\n");
 value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK,
SYSCFG_PMCSETR_ETH_SEL_GMII_MII);
-   value |= SYSCFG_PMCSETR_ETH_REF_CLK_SEL;
+   if (!is_mp13)   /* Select MII mode on STM32MP15xx */
+   value |= SYSCFG_PMCSETR_ETH_SELMII;
 break;
-   case PHY_INTERFACE_MODE_GMII:
+   case PHY_INTERFACE_MODE_GMII:   /* STM32MP15xx only */
 dev_dbg(dev, "PHY_INTERFACE_MODE_GMII\n");
 value = FIELD_PREP(SYSCFG_PMCSETR_ETH_SEL_MASK,
SYSCFG_PMCSETR_ETH_SEL_GMII_MII); @@ 
-177,13 +190,15 @@ static int eqos_probe_syscfg_stm32(struct udevice *dev,
 return -EINVAL;
 }

-   /* clear and set ETH configuration bits */
-   writel(SYSCFG_PMCSETR_ETH_SEL_MASK | SYSCFG_PMCSETR_ETH_SELMII |
-  SYSCFG_PMCSETR_ETH_REF_CLK_SEL | SYSCFG_PMCSETR_ETH_CLK_SEL,
-  syscfg + SYSCFG_PMCCLRR);
-   writel(value, syscfg + SYSCFG_PMCSETR);
+   /* Shift value at correct ethernet MAC offset in SYSCFG_PMCSETR */
+   value <<= ffs(regmap_mask) - ffs(SYSCFG_PMCSETR_ETH1_MASK);

-   return 0;
+   /* Update PMCCLRR (clear register) */
+   regmap_write(regmap, is_mp13 ?
+SYSCFG_PMCCLRR_MP13 : SYSCFG_PMCCLRR_MP15,
+regmap_mask);
+
+   return regmap_update_bits(regmap, SYSCFG_PMCSETR, regmap_mask, value);
  }

  static int eqos_probe_resources_stm32(struct udevice *dev)
--
2.43.0

Reviewed-by: Christophe ROULLIER 


[PATCH v3 1/1] fastboot: introduce 'oem board' subcommand

2024-04-08 Thread Alexey Romanov
Currently, fastboot protocol in U-Boot has no opportunity
to execute vendor custom code with verifed boot. This patch
introduce new fastboot subcommand fastboot oem board:,
which allow to run custom oem_board function.

Default implementation is __weak. Vendor must redefine it in
board/ folder with his own logic.

For example, some vendors have their custom nand/emmc partition
flashing or erasing. Here some typical command for such use cases:

- flashing:

  $ fastboot stage bootloader.img
  $ fastboot oem board:write_bootloader

- erasing:

  $ fastboot oem board:erase_env

Signed-off-by: Alexey Romanov 
---
 doc/android/fastboot.rst  | 18 ++
 drivers/fastboot/Kconfig  |  7 +++
 drivers/fastboot/fb_command.c | 30 ++
 include/fastboot.h|  1 +
 4 files changed, 56 insertions(+)

diff --git a/doc/android/fastboot.rst b/doc/android/fastboot.rst
index 05d8f77759..2020590657 100644
--- a/doc/android/fastboot.rst
+++ b/doc/android/fastboot.rst
@@ -30,6 +30,7 @@ The following OEM commands are supported (if enabled):
 - ``oem bootbus``  - this executes ``mmc bootbus %x %s`` to configure eMMC
 - ``oem run`` - this executes an arbitrary U-Boot command
 - ``oem console`` - this dumps U-Boot console record buffer
+- ``oem board`` - this executes an custom board function which is defined by 
vendor
 
 Support for both eMMC and NAND devices is included.
 
@@ -246,6 +247,23 @@ including multiple commands (using e.g. ``;`` or ``&&``) 
and control structures
 (``if``, ``while``, etc.). The exit code of ``fastboot`` will reflect the exit
 code of the command you ran.
 
+Running Custom Vendor Code
+^^
+
+U-Boot allows you to execute custom fastboot logic, which can be defined
+in board/ files. It can still be used for production devices with verified
+boot, because vendor define logic at compile time by overriding weak
+implementation of fastboot_oem_board() function. The attacker will
+not able to execute his commands / code. For example, this can be useful
+for custom flashing or erasing protocols::
+
+$ fastboot stage bootloader.img
+$ fastboot oem board:write_bootloader
+
+In this case, ``cmd_parameter`` argument of the function 
``fastboot_oem_board()``
+will contain string "write_bootloader" and ``data`` argument is a pointer to
+fastboot input buffer, which containing the contents of bootloader.img file.
+
 References
 --
 
diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
index 5e5855a76c..937a39f54a 100644
--- a/drivers/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -249,6 +249,13 @@ config FASTBOOT_CMD_OEM_CONSOLE
  Add support for the "oem console" command to input and read console
  record buffer.
 
+config FASTBOOT_OEM_BOARD
+   bool "Enable the 'oem board' command"
+   help
+ This extends the fastboot protocol with an "oem board" command. This
+ command allows running vendor custom code defined in board/ files.
+ Otherwise, it will do nothing and send fastboot fail.
+
 endif # FASTBOOT
 
 endmenu
diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
index f95f4e4ae1..96c27afc60 100644
--- a/drivers/fastboot/fb_command.c
+++ b/drivers/fastboot/fb_command.c
@@ -42,6 +42,7 @@ static void oem_format(char *, char *);
 static void oem_partconf(char *, char *);
 static void oem_bootbus(char *, char *);
 static void oem_console(char *, char *);
+static void oem_board(char *, char *);
 static void run_ucmd(char *, char *);
 static void run_acmd(char *, char *);
 
@@ -113,6 +114,10 @@ static const struct {
.command = "oem console",
.dispatch = CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_CONSOLE, 
(oem_console), (NULL))
},
+   [FASTBOOT_COMMAND_OEM_BOARD] = {
+   .command = "oem board",
+   .dispatch = CONFIG_IS_ENABLED(FASTBOOT_OEM_BOARD, (oem_board), 
(NULL))
+   },
[FASTBOOT_COMMAND_UCMD] = {
.command = "UCmd",
.dispatch = CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT, (run_ucmd), 
(NULL))
@@ -542,3 +547,28 @@ static void __maybe_unused oem_console(char 
*cmd_parameter, char *response)
else
fastboot_response(FASTBOOT_MULTIRESPONSE_START, response, NULL);
 }
+
+/**
+ * fastboot_oem_board() - Execute the OEM board command. This is default
+ * weak implementation, which may be overwritten in board/ files.
+ *
+ * @cmd_parameter: Pointer to command parameter
+ * @data: Pointer to fastboot input buffer
+ * @size: Size of the fastboot input buffer
+ * @response: Pointer to fastboot response buffer
+ */
+void __weak fastboot_oem_board(char *cmd_parameter, void *data, u32 size, char 
*response)
+{
+   fastboot_fail("oem board function not defined", response);
+}
+
+/**
+ * oem_board() - Execute the OEM board command
+ *
+ * @cmd_parameter: Pointer to command parameter
+ * @response: Pointer to fastboot response 

[PATCH v3 0/1] Introduce fastboot oem board command

2024-04-08 Thread Alexey Romanov
Changes V1 -> V2 [1]:
  - Added an example of using the command as requested
by Sean Anderson [2].

Changes V2 -> V3 [3]:
  - Rebase over uboot/master.
  - Add documentation.
  - Remove example added in V2 [1].

Links:
[1] 
https://lore.kernel.org/all/20231228152522.83291-1-avroma...@salutedevices.com/
[2] 
https://lore.kernel.org/all/72ac233d-c18d-4f57-bc66-451fe0bd2...@seco.com/
[3] 
https://lore.kernel.org/all/20240201092027.6258-1-avroma...@salutedevices.com/

Alexey Romanov (1):
  fastboot: introduce 'oem board' subcommand

 doc/android/fastboot.rst  | 18 ++
 drivers/fastboot/Kconfig  |  7 +++
 drivers/fastboot/fb_command.c | 30 ++
 include/fastboot.h|  1 +
 4 files changed, 56 insertions(+)

-- 
2.34.1



Can't get U-Boot working on Geniatech XPI-3566-ZERO

2024-04-08 Thread Mizsei Zoltán
Hi,

I'm trying to get a mainline U-Boot running on the Geniatech XPI-3566-ZERO 
RK3566 based SBC [1], but all my attempts have failed so far.

The SBC doesn't have any SD-Card slot, please keep this in mind!

I can build U-Boot, but when I write the resulting binary to the eMMC using 
rkdeveloptool, the boot stops and I see no output on the UART pins using 
150 baud transfer rate.

My steps were the following:

- git clone https://github.com/u-boot/u-boot
- cd u-boot
- CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 make rk3568_defconfig
- ROCKCHIP_TPL='rkbin/bin/rk35/rk3566_ddr_1056MHz_v1.21.bin'  
BL31='rkbin/bin/rk35/rk3568_bl31_v1.44.elf' CROSS_COMPILE=aarch64-linux-gnu- 
make
- rkdeveloptool db MiniLoaderAll.bin
- rkdeveloptool wl 64 u-boot-rockchip.bin

After that I can no longer communicate with the board via UART and it no longer 
boots.

I've built uboot countless times, I've followed all sorts of guides, I've tried 
modifying FDT and transplanting the DTS from the official SDK, I have tried 
vanilla defconfigs and tried to modify them aswell, I think I've tried 
everything, but no matter what I do I just can't get it working.
The vendored U-Boot works ok, but I plant to run OpenBSD, for which an upstream 
U-Boot would be better situated (according to the OBSD mailing list).

Please give me some hints because I'm running out of ideas. I've spent 
countless hours trying to get this to work but haven't succeeded.

Thank You very much!

Best Regards,

--Z--

[1] https://www.geniatech.com/product/xpi-3566-zero/


  1   2   >