Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A6B2C433EF for ; Wed, 1 Jun 2022 12:48:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AFB1083EF9; Wed, 1 Jun 2022 14:48:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="KskKbVsK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D940283F24; Wed, 1 Jun 2022 14:48:02 +0200 (CEST) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6A5E283EC6 for ; Wed, 1 Jun 2022 14:47:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=afd@ti.com Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 251Clp09036427; Wed, 1 Jun 2022 07:47:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1654087671; bh=kCIw+bMkxi4XFKs3xqCHKg8EZrRXsYPNgikcyME6rL0=; h=Date:Subject:To:CC:References:From:In-Reply-To; b=KskKbVsK6Oqz3J+LwpLi5D0khADh31DfXPxiWWTlEPEn/ajP1D7X+EiLo6mhP54yh wnjm+A6ScyWRGYyKjPwBw/puyJA6UBgvqXtPAWLT7b8pYc6NlZSt12gnZN94+N6sL2 xc6CS3UMlNZlbORnkVkW5weOkZH3ETGcR1z9hav8= Received: from DLEE111.ent.ti.com (dlee111.ent.ti.com [157.170.170.22]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 251Clpij004693 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 1 Jun 2022 07:47:51 -0500 Received: from DLEE107.ent.ti.com (157.170.170.37) by DLEE111.ent.ti.com (157.170.170.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Wed, 1 Jun 2022 07:47:51 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE107.ent.ti.com (157.170.170.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Wed, 1 Jun 2022 07:47:51 -0500 Received: from [10.250.32.110] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id 251CloQY021289; Wed, 1 Jun 2022 07:47:50 -0500 Message-ID: <248e9917-6086-5ca4-d76e-0077368009c0@ti.com> Date: Wed, 1 Jun 2022 07:47:50 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH RFC v2 11/11] ti: dtsi: j721e: Use binman to package tispl.bin Content-Language: en-US To: Roger Quadros , Neha Malcom Francis , CC: Alper Nebi Yasak References: <20220506043759.8193-1-n-francis@ti.com> <20220506043759.8193-12-n-francis@ti.com> <8c30d625-c7eb-b55d-e0d6-3b43b15f5627@kernel.org> <0523d0a0-de58-63ba-79a2-492276af8a84@ti.com> <38c25cbb-5f5d-9a20-a5c9-af4be81c31c0@kernel.org> From: Andrew Davis In-Reply-To: <38c25cbb-5f5d-9a20-a5c9-af4be81c31c0@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 6/1/22 5:55 AM, Roger Quadros wrote: > > > On 01/06/2022 13:42, Neha Malcom Francis wrote: >> Hi Roger, >> >> On 01/06/22 14:53, Roger Quadros wrote: >>> Hi, >>> >>> On 01/06/2022 09:08, Neha Malcom Francis wrote: >>>> Hi Roger, >>>> >>>> On 31/05/22 16:32, Roger Quadros wrote: >>>>> >>>>> >>>>> On 06/05/2022 07:37, Neha Malcom Francis wrote: >>>>>> Explicit make commands were earlier used to generate tispl.bin image, >>>>>> now it is replaced using binman. >>>>>> >>>>>> Binman picks up and packages entries according to the description of >>>>>> entries given in the binman node in the device tree. The make commands >>>>>> that were earlier responsible for generating tispl.bin has been removed. >>>>>> >>>>>> k3-j721e-a72-binman.dtsi has been introduced for A72 specific binman node. >>>>>> It can be included in files that require it like >>>>>> k3-j721e-common-proc-board-u-boot.dtsi. >>>>>> >>>>>> Note that make commands for secure devices has also been removed as >>>>>> focus is on general purpose devices at present time. >>>>>> >>>>>> Signed-off-by: Tarun Sahu >>>>>> [n-francis@ti.com: prepared patch for upstreaming] >>>>>> Signed-off-by: Neha Malcom Francis >>>>>> --- >>>>>>    arch/arm/dts/k3-j721e-a72-binman.dtsi         | 86 +++++++++++++++++++ >>>>>>    .../k3-j721e-common-proc-board-u-boot.dtsi    |  1 + >>>>>>    arch/arm/mach-k3/config.mk                    | 33 ------- >>>>>>    board/ti/j721e/Kconfig                        |  1 + >>>>>>    scripts/Makefile.spl                          |  4 - >>>>>>    5 files changed, 88 insertions(+), 37 deletions(-) >>>>>>    create mode 100644 arch/arm/dts/k3-j721e-a72-binman.dtsi >>>>>> >>>>>> diff --git a/arch/arm/dts/k3-j721e-a72-binman.dtsi b/arch/arm/dts/k3-j721e-a72-binman.dtsi >>>>>> new file mode 100644 >>>>>> index 0000000000..beb3424bb9 >>>>>> --- /dev/null >>>>>> +++ b/arch/arm/dts/k3-j721e-a72-binman.dtsi >>>>>> @@ -0,0 +1,86 @@ >>>>>> +// SPDX-License-Identifier: GPL-2.0+ >>>>>> +// Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/ >>>>>> + >>>>>> +#include >>>>>> + >>>>>> +#ifdef CONFIG_ARM64 >>>>>> +/ { >>>>>> +    binman: binman { >>>>>> +        multiple-images; >>>>>> +    }; >>>>>> +}; >>>>>> + >>>>>> +&binman { >>>>>> +    tispl { >>>>>> +        filename = "tispl.bin"; >>>>>> +        fit { >>>>>> +            description = "FIT IMAGE"; >>>>>> +            #address-cells = <1>; >>>>>> +            images { >>>>>> +                atf { >>>>>> +                    description = "ARM Trusted Firmware"; >>>>>> +                    type = "firmware"; >>>>>> +                    arch = "arm64"; >>>>>> +                    compression = "none"; >>>>>> +                    os = "arm-trusted-firmware"; >>>>>> +                    load = ; >>>>>> +                    entry = ; >>>>>> +                    atf-bl31 { >>>>>> +                    }; >>>>>> +                }; >>>>>> +                tee { >>>>>> +                    description = "OPTEE"; >>>>>> +                    type = "tee"; >>>>>> +                    arch = "arm64"; >>>>>> +                    compression = "none"; >>>>>> +                    os = "tee"; >>>>>> +                    load = <0x9e800000>; >>>>>> +                    entry = <0x9e800000>; >>>>>> +                    tee-os { >>>>>> +                    }; >>>>>> +                }; >>>>>> +                dm { >>>>>> +                    description = "DM binary"; >>>>>> +                    type = "firmware"; >>>>>> +                    arch = "arm32"; >>>>>> +                    compression = "none"; >>>>>> +                    os = "DM"; >>>>>> +                    load = <0x89000000>; >>>>>> +                    entry = <0x89000000>; >>>>>> +                    ti-dm { >>>>>> +                    }; >>>>>> +                }; >>>>>> +                spl { >>>>>> +                    description = "SPL (64-bit)"; >>>>>> +                    type = "standalone"; >>>>>> +                    os = "U-Boot"; >>>>>> +                    arch = "arm64"; >>>>>> +                    compression = "none"; >>>>>> +                    load = ; >>>>>> +                    entry = ; >>>>>> +                    u-boot-spl-nodtb { >>>>>> +                    }; >>>>>> +                }; >>>>>> +                k3-j721e-common-proc-board.dtb { >>>>>> +                    description = "k3-j721e-common-proc-board"; >>>>>> +                    type = "flat_dt"; >>>>>> +                    arch = "arm"; >>>>>> +                    compression = "none"; >>>>>> +                    blob-ext { >>>>>> +                    filename = "spl/dts/k3-j721e-common-proc-board.dtb"; >>>>>> +                    }; >>>>>> +                }; >>>>>> +            }; >>>>>> +            configurations { >>>>>> +                default = "conf"; >>>>>> +                conf { >>>>>> +                    description = "k3-j721e-common-proc-board"; >>>>>> +                    firmware = "atf"; >>>>>> +                    loadables = "tee", "dm", "spl"; >>>>>> +                    fdt = "k3-j721e-common-proc-board.dtb"; >>>>>> +                }; >>>>>> +            }; >>>>>> +        }; >>>>>> +    }; >>>>>> +}; >>>>>> +#endif >>>>>> 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 677a72d2a2..6490d71f7e 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 >>>>>> @@ -4,6 +4,7 @@ >>>>>>     */ >>>>>>      #include >>>>>> +#include "k3-j721e-a72-binman.dtsi" >>>>>>      / { >>>>>>        chosen { >>>>>> diff --git a/arch/arm/mach-k3/config.mk b/arch/arm/mach-k3/config.mk >>>>>> index 49f80ae79b..e0d9ea97c9 100644 >>>>>> --- a/arch/arm/mach-k3/config.mk >>>>>> +++ b/arch/arm/mach-k3/config.mk >>>>>> @@ -52,38 +52,5 @@ ifeq ($(CONFIG_SOC_K3_J721E),) >>>>>>    export DM := /dev/null >>>>>>    endif >>>>>>    -ifeq ($(CONFIG_TI_SECURE_DEVICE),y) >>>>>> -SPL_ITS := u-boot-spl-k3_HS.its >>>>>> -$(SPL_ITS): export IS_HS=1 >>>>>> -INPUTS-y    += tispl.bin_HS >>>>>> -else >>>>>> -SPL_ITS := u-boot-spl-k3.its >>>>>> -INPUTS-y    += tispl.bin >>>>>> -endif >>>>>> - >>>>>> -ifeq ($(CONFIG_SPL_OF_LIST),) >>>>>> -LIST_OF_DTB := $(CONFIG_DEFAULT_DEVICE_TREE) >>>>>> -else >>>>>> -LIST_OF_DTB := $(CONFIG_SPL_OF_LIST) >>>>>>    endif >>>>>> - >>>>>> -quiet_cmd_k3_mkits = MKITS   $@ >>>>>> -cmd_k3_mkits = \ >>>>>> -    $(srctree)/tools/k3_fit_atf.sh \ >>>>>> -    $(CONFIG_K3_ATF_LOAD_ADDR) \ >>>>>> -    $(patsubst %,$(obj)/dts/%.dtb,$(subst ",,$(LIST_OF_DTB))) > $@ >>>>>> - >>>>>> -$(SPL_ITS): FORCE >>>>>> -    $(call cmd,k3_mkits) >>>>>>    endif >>>>>> - >>>>>> -else >>>>>> - >>>>>> -ifeq ($(CONFIG_TI_SECURE_DEVICE),y) >>>>>> -INPUTS-y    += u-boot.img_HS >>>>>> -else >>>>>> -INPUTS-y    += u-boot.img >>>>>> -endif >>>>>> -endif >>>>>> - >>>>>> -include $(srctree)/arch/arm/mach-k3/config_secure.mk >>>>> >>>>> You can't yet remove these as all K3 platforms are not converted to use binman. >>>>> Please include them under #ifndef CONFIG_BINMAN...#endif >>>>> >>>>> One more question I have is that how are _HS binaries being created with binman? >>>>> >>>> >>>> I will make the changes accordingly that do not affect any of the other builds. _HS binaries are not being created with binman in this series. >>>> >>>> But there is a patch series that does create HS images (tispl.bin and u-boot.img) using binman for AM64x: https://patchwork.ozlabs.org/project/uboot/patch/20220509072936.12899-4-rogerq@kernel.org/ >>> >>> That series still depends on "TI_SECURE_DEV_PKG//scripts/secure-binary-image.sh" >>> to sign the image. >>> >>> Funny thing is that I'm no longer able to download the above package from ti.com >>> to see what it is doing. Any pointers on how to get it? >>> >>> cheers, >>> -roger >>> >> >> Did you try to access using the browser using https link? >> >> I am able to access the script by cloning git://git.ti.com/security-development-tools/core-secdev-k3.git >> > > Aha! sure I can access that. > But according to doc/README.ti-secure I should be getting it from > http://www.ti.com/mysecuresoftware > And I couldn't get anything there. > > Looks like we need to update the doc to point to the git repo instead? > The mysecuresoftware is for the AM335x-AM57x class devices, that is still the place to get the tools for those. For K3 forward the git.ti.com is the right spot. We can add a new doc for K3 devices. Andrew >>>> >>>>>> diff --git a/board/ti/j721e/Kconfig b/board/ti/j721e/Kconfig >>>>>> index a3a9d504ae..3cf05f0d3b 100644 >>>>>> --- a/board/ti/j721e/Kconfig >>>>>> +++ b/board/ti/j721e/Kconfig >>>>>> @@ -14,6 +14,7 @@ config TARGET_J721E_A72_EVM >>>>>>        select BOARD_LATE_INIT >>>>>>        imply TI_I2C_BOARD_DETECT >>>>>>        select SYS_DISABLE_DCACHE_OPS >>>>>> +    select BINMAN >>>>>>      config TARGET_J721E_R5_EVM >>>>>>        bool "TI K3 based J721E EVM running on R5" >>>>>> diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl >>>>>> index 6ad82cecfb..5f8a8487c5 100644 >>>>>> --- a/scripts/Makefile.spl >>>>>> +++ b/scripts/Makefile.spl >>>>>> @@ -577,7 +577,3 @@ $(obj)/$(SPL_BIN).multidtb.fit.gz: $(obj)/$(SPL_BIN).multidtb.fit >>>>>>    $(obj)/$(SPL_BIN).multidtb.fit.lzo: $(obj)/$(SPL_BIN).multidtb.fit >>>>>>        @lzop -f9 $< > $@ >>>>>>    -ifdef CONFIG_ARCH_K3 >>>>>> -tispl.bin: $(obj)/u-boot-spl-nodtb.bin $(SHRUNK_ARCH_DTB) $(SPL_ITS) FORCE >>>>>> -    $(call if_changed,mkfitimage) >>>>>> -endif >>>>> >>>>> Please don't remove this but include it under #ifndef CONFIG_BINMAN...#endif >>>>> >>>>> cheers, >>>>> -roger >>>> >> > > cheers, > -roger