[RFC PATCH 3/4] arm: dts: k3-j721e: Separate boot binary build
Neha Malcom Francis
n-francis at ti.com
Fri Mar 1 06:30:50 CET 2024
Hi Manorit
On 01/03/24 10:56, Manorit Chawdhry wrote:
> Hi Neha,
>
> On 16:50-20240228, Neha Malcom Francis wrote:
>> Separate out the boot binaries built for J721E boards; J721E EVM and
>> J721E SK by using the common templates in k3-j721e-binman.dtsi.
>>
>> Only the required boot binaries can be built from the templates in the
>> boards' respective -u-boot.dtsi file. FDTs and configurations are also
>> moved to the -u-boot.dtsi file to allow clear distinction between the
>> SoC common stuff vs. what is needed to boot up a board.
>>
>> Signed-off-by: Neha Malcom Francis <n-francis at ti.com>
>> ---
>> Note: I have added "dummy" sections so that node for a phandle is found
>> correctly. The node for a phandle is searched for among sub-nodes of a
>> section (check tools/binman/etype/section.py GetContentsByPhandle) and
>> having a template as the section instead, causes failure to find the
>> phandle despite it being present in the FDT. So the dummy section
>> bypasses this.
>>
>> Avoided correct DTS alignment for the RFC at least so that it's clear
>> what is actually being changed.
>>
>> arch/arm/dts/k3-j721e-binman.dtsi | 178 +++++-------------
>> .../k3-j721e-common-proc-board-u-boot.dtsi | 138 ++++++++++++++
>> arch/arm/dts/k3-j721e-sk-u-boot.dtsi | 104 ++++++++++
>> 3 files changed, 284 insertions(+), 136 deletions(-)
>>
>
> [snip]
>
>> diff --git a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
>> index 7ae7cf3d4c9..ff96bc3f724 100644
>> --- a/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
>> +++ b/arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
>> @@ -187,3 +187,141 @@
>> &mcu_fss0_ospi1_pins_default {
>> bootph-all;
>> };
>> +
>> +#ifdef CONFIG_TARGET_J721E_R5_EVM
>> +
>> +&binman {
>> + tiboot3-j721e-sr1-1-hs-evm {
>> + insert-template = <&tiboot3_j721e_sr1_1_hs>;
>> + };
>> + sysfw-j721e-sr1-1-hs-evm {
>> + insert-template = <&sysfw>;
>> + };
>> + itb-j721e-sr1-1-hs-evm {
>> + insert-template = <&itb>;
>> + };
>> +};
>> +
>> +&binman {
>> + tiboot3-j721e-sr2-hs-evm {
>> + insert-template = <&tiboot3_j721e_sr2_hs>;
>> + };
>> + sysfw-j721e-sr2-hs-evm {
>> + insert-template = <&sysfw_sr2>;
>> + };
>> + itb-j721e-sr2-hs-evm {
>> + insert-template = <&itb_sr2>;
>> + };
>> +};
>> +
>> +&binman {
>> + tiboot3-j721e-sr2-hs-fs-evm {
>> + insert-template = <&tiboot3_j721e_sr2_hs_fs>;
>> + };
>> + sysfw-j721e-sr2-hs-fs-evm {
>> + insert-template = <&sysfw_fs>;
>> + };
>> + itb-j721e-sr2-hs-fs-evm {
>> + insert-template = <&itb_fs>;
>> + };
>> +};
>> +
>> +&binman {
>> + tiboot3-j721e-gp-evm {
>> + insert-template = <&tiboot3_j721e_gp>;
>> + };
>> + sysfw-j721e-gp-evm {
>> + insert-template = <&sysfw_gp>;
>> + };
>> + itb-j721e-gp-evm {
>> + insert-template = <&itb_gp>;
>> + };
>> +};
>> +
>> +#else
>> +
>> +#define SPL_J721E_EVM_DTB "spl/dts/k3-j721e-common-proc-board.dtb"
>> +
>
> Trying to gauge the changes that are required for EVM to SK, I notice a
> few only ( let me know if I missed ).
>
> 1. DTB
> 2. Description name.
>
> Considering this, templating does seem good but I was thinking of a
> different design as well. Let me know what you think about it.
>
> I was thinking that the binman node can remain as is with some generic
> macros like taking the fdt-0 node of tispl.bin
>
> We can have something like this.
>
> in arch/arm/dts/k3-j721e-binman.dtsi:
>
> fit {
> images {
> fdt-0 {
> description = BOARD_DESCRIPTION;
> ti-secure {
> content = <&spl_j721e_dtb>;
> keyfile = "custMpk.pem";
> }
> spl_j721e_dtb: blob-ext {
> filename = BOARD_SPL_DTB;
> }
> }
> }
> }
>
> And then in the board specific -u-boot overrides, we can have something
> like this -
>
> in arch/arm/dts/k3-j721e-common-proc-board-u-boot.dtsi
>
> #define BOARD_DESCRIPTION "k3-j721e-common-proc-board";
> #define BOARD_SPL_DTB "spl/dts/k3-j721e-common-proc-board.dtb";
> #include <k3-j721e-binman.dtsi>
>
> in arch/arm/dts/k3-j721e-sk-u-boot.dtsi
>
> #define BOARD_DESCRIPTION "k3-j721e-sk";
> #define BOARD_SPL_DTB "spl/dts/k3-j721e-sk.dtb"
> #include <k3-j721e-binman.dtsi>
>
> I think if we have a less enough diff only between these two then I am
> hoping something like this can be better maybe. Let me know what your
> thoughts would be on that.
>
> Regards,
> Manorit
>
Yes this can reduce the code size nicely and cleanly, I will take this into
account in the proper version, thanks!
>> +&binman {
>> + tispl {
>> + insert-template = <&ti_spl>;
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-common-proc-board";
>> + ti-secure {
>> + content = <&spl_j721e_evm_dtb>;
>> + keyfile = "custMpk.pem";
>> + };
>> + spl_j721e_evm_dtb: blob-ext {
>> + filename = SPL_J721E_EVM_DTB;
>> + };
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-common-proc-board";
>> + };
>> + };
>> + };
>> + };
>> +
>> + u-boot {
>> + insert-template = <&u_boot>;
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-common-proc-board";
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-common-proc-board";
>> + };
>> + };
>> + };
>> + };
>> +
>> + tispl-unsigned {
>> + insert-template = <&ti_spl_unsigned>;
>> +
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-common-proc-board";
>> + blob {
>> + filename = SPL_J721E_EVM_DTB;
>> + };
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-common-proc-board";
>> + };
>> + };
>> + };
>> + };
>> +
>> + u-boot-unsigned {
>> + insert-template = <&u_boot_unsigned>;
>> +
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-common-proc-board";
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-common-proc-board";
>> + };
>> + };
>> + };
>> + };
>> +};
>> +
>> +#endif
>> diff --git a/arch/arm/dts/k3-j721e-sk-u-boot.dtsi b/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
>> index 479b7bcd6f8..ca18dd5f8ed 100644
>> --- a/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
>> +++ b/arch/arm/dts/k3-j721e-sk-u-boot.dtsi
>> @@ -163,3 +163,107 @@
>> };
>> };
>> };
>> +
>> +#ifndef CONFIG_ARM64
>> +
>> +&binman {
>> + tiboot3-j721e-gp-sk {
>> + insert-template = <&tiboot3_j721e_gp>;
>> + filename = "tiboot3-j721e-gp-sk.bin";
>> + };
>> + sysfw-j721e-gp-sk {
>> + insert-template = <&sysfw_gp>;
>> + };
>> + itb-j721e-gp-sk {
>> + insert-template = <&itb_gp>;
>> + filename = "sysfw-j721e-gp-sk.itb";
>> + };
>> +};
>> +
>> +#else
>> +
>> +#define SPL_J721E_SK_DTB "spl/dts/k3-j721e-sk.dtb"
>> +
>> +&binman {
>> + tispl {
>> + insert-template = <&ti_spl>;
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-sk";
>> + ti-secure {
>> + content = <&spl_j721e_sk_dtb>;
>> + keyfile = "custMpk.pem";
>> + };
>> + spl_j721e_sk_dtb: blob-ext {
>> + filename = SPL_J721E_SK_DTB;
>> + };
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-sk";
>> + };
>> + };
>> + };
>> + };
>> +
>> + u-boot {
>> + insert-template = <&u_boot>;
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-sk";
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-sk";
>> + };
>> + };
>> + };
>> + };
>> +
>> + tispl-unsigned {
>> + insert-template = <&ti_spl_unsigned>;
>> +
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-sk";
>> + blob {
>> + filename = SPL_J721E_SK_DTB;
>> + };
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-sk";
>> + };
>> + };
>> + };
>> + };
>> +
>> + u-boot-unsigned {
>> + insert-template = <&u_boot_unsigned>;
>> +
>> + fit {
>> + images {
>> + fdt-0 {
>> + description = "k3-j721e-sk";
>> + };
>> + };
>> +
>> + configurations {
>> + conf-0 {
>> + description = "k3-j721e-sk";
>> + };
>> + };
>> + };
>> + };
>> +};
>> +
>> +#endif
>> --
>> 2.34.1
>>
--
Thanking You
Neha Malcom Francis
More information about the U-Boot
mailing list