On 22/04/25 20:06, Andrew Davis wrote:
> On 4/22/25 4:54 AM, Beleswar Padhi wrote:
>> Pack the HSM firmware in tispl.bin fit image so that it can be unloaded
>> and used by R5 SPL to boot the HSM core. By default, point to the
>> firmware for HS-SE device type. This needs to be changed to point to
>> appropriate firmware when using a different device type.
>>
>> Signed-off-by: Beleswar Padhi <b-pa...@ti.com>
>> ---
>>   arch/arm/dts/k3-j721s2-binman.dtsi | 12 ++++++++++++
>>   arch/arm/dts/k3-j784s4-binman.dtsi | 14 ++++++++++++++
>>   2 files changed, 26 insertions(+)
>>
>> diff --git a/arch/arm/dts/k3-j721s2-binman.dtsi 
>> b/arch/arm/dts/k3-j721s2-binman.dtsi
>> index d121d8c0c54..1e6cdf92421 100644
>> --- a/arch/arm/dts/k3-j721s2-binman.dtsi
>> +++ b/arch/arm/dts/k3-j721s2-binman.dtsi
>> @@ -280,6 +280,14 @@
>>                         };
>>                   };
>> +#ifdef CONFIG_K3_HSM_FW
>
> Is there some way to make this blob "optional" so that
> we don't need all this #ifdef stuff everywhere? It makes
> the image structures here harder to follow.


That was the initial thought. But I don't think 'optional' is working the way 
we expect it to be.
Currently, if I mark the node as optional and build U-Boot without the 
firmware, I get errors:

```
BINMAN  .binman_stamp
Image 'tispl' has faked external blobs and is non-functional: 
hsm-demo-firmware-j784s4-hs.bin
Image 'tispl' is missing optional external blobs but is still functional: 
blob-ext
/binman/tispl/fit/images/hsm/blob-ext (ti-hsm/hsm-demo-firmware-j784s4-hs.bin):
   Missing blob

Some images are invalid
make[2]: *** [/src/u-boot/Makefile:1135: .binman_stamp] Error 103
```

There has been some discussion in getting optional working[0], but I am not 
sure what is the conclusion.

[0]: 
https://lore.kernel.org/all/20250129-binman_faked_optional-v1-0-a4534bc67...@phytec.de/

Thanks,
Beleswar

>
> Andrew
>
>> +                hsm {
>> +                    hsm: blob-ext {
>> +                        filename = "ti-hsm/hsm-demo-firmware-j721s2-hs.bin";
>> +                    };
>> +                };
>> +#endif
>> +
>>                   dm {
>>                       ti-secure {
>>                           content = <&dm>;
>> @@ -312,7 +320,11 @@
>>                   conf-0 {
>>                       description = "k3-j721s2-common-proc-board";
>>                       firmware = "atf";
>> +#ifdef CONFIG_K3_HSM_FW
>> +                    loadables = "hsm", "tee", "dm", "spl";
>> +#else
>>                       loadables = "tee", "dm", "spl";
>> +#endif
>>                       fdt = "fdt-0";
>>                   };
>>               };
>> diff --git a/arch/arm/dts/k3-j784s4-binman.dtsi 
>> b/arch/arm/dts/k3-j784s4-binman.dtsi
>> index 0553825b383..ab417a47034 100644
>> --- a/arch/arm/dts/k3-j784s4-binman.dtsi
>> +++ b/arch/arm/dts/k3-j784s4-binman.dtsi
>> @@ -159,6 +159,16 @@
>>             fit {
>>               images {
>> +
>> +#ifdef CONFIG_K3_HSM_FW
>> +                hsm {
>> +                    hsm: blob-ext {
>> +                        filename = "ti-hsm/hsm-demo-firmware-j784s4-hs.bin";
>> +                    };
>> +                };
>> +
>> +#endif
>> +
>>                   dm {
>>                       ti-secure {
>>                           content = <&dm>;
>> @@ -194,7 +204,11 @@
>>                   conf-0 {
>>                       description = BOARD_DESCRIPTION;
>>                       firmware = "atf";
>> +#ifdef CONFIG_K3_HSM_FW
>> +                    loadables = "hsm", "tee", "dm", "spl";
>> +#else
>>                       loadables = "tee", "dm", "spl";
>> +#endif
>>                       fdt = "fdt-0";
>>                   };
>>               };

Reply via email to