From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-21.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6966C4338F for ; Mon, 16 Aug 2021 14:35:29 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 1B7AF60F5C for ; Mon, 16 Aug 2021 14:35:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1B7AF60F5C Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36C038296A; Mon, 16 Aug 2021 16:35:27 +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="kF1gk4Xd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E335E8297D; Mon, 16 Aug 2021 16:35:24 +0200 (CEST) Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) (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 373B780C87 for ; Mon, 16 Aug 2021 16:35:20 +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=s-anna@ti.com Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 17GEZIYU002789; Mon, 16 Aug 2021 09:35:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1629124518; bh=6P26iXzisSYT18mIqPc/3zJKTGYNyP/QwxfE6+xhF4c=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=kF1gk4Xd0JNlzrg1X8D3TyrQ+wZjBJXzc46SGYUQSvegVC/Rsf+niGO+3WzPHc3Z/ 4OKgcoHFwVF/xk3qsrGi3DNNYP+h8FFGffAytoscmiLSalCf5UsQ38b4iGkqMfOsrv r6AXFPzXftRXN6ZgA8gzZeDFOfbj9iOZ/oF46psU= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 17GEZIWX081603 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 16 Aug 2021 09:35:18 -0500 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 16 Aug 2021 09:35:17 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2 via Frontend Transport; Mon, 16 Aug 2021 09:35:17 -0500 Received: from [10.250.35.174] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 17GEZHH1022818; Mon, 16 Aug 2021 09:35:17 -0500 Subject: Re: [PATCH] tools: k3_fit_atf: Fix DM binary FIT load addresses To: Lokesh Vutla CC: Tero Kristo , Praneeth Bajjuri , Dave Gerlach , Hari Nagalla , References: <20210814064901.3840-1-s-anna@ti.com> From: Suman Anna Message-ID: <9a04729e-f154-e072-ba44-cf9d43f5f7f6@ti.com> Date: Mon, 16 Aug 2021 09:35:17 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210814064901.3840-1-s-anna@ti.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 8/14/21 1:49 AM, Suman Anna wrote: > The DM binary runs on the MCU R5F Core0 after R5 SPL on J721E and J7200 > SoCs. The binary is built alongside the TFA, OPTEE and A72 SPL binaries > and included in the tispl.bin FIT image. The R5 SPL loads the DM binary > at 0xA000000 address, based on the value used in the FIT image build I had a typo here and below, missed a zero in the address. It should be 0xA0000000. Let me know if you want me to post a v2 for that. regards Suman > script. The DM binary though is an ELF image and not a regular binary > file, and so is processed further to load the actual program segments > using the U-Boot's standard ELF loader library. > > The DM binary does leverage a certain portion of DDR for its program > segments, and typically reserves 16 MB of DDR at 0xA000000 with the > 1st MB used for IPC between Linux and the remote processor, and > remaining memory for firmware segments. This can cause an incomplete > loading of the program segments if the DM binary is larger than 1 MB, > due to overlap of the initial loaded binary and the actual program > segments. > > Fix this by using the address 0x89000000, which matches the current > "addr_mcur5f0_0load" env variable used by R5 SPL before the DM firmware > inclusion into the tispl.bin. > > Fixes: df5363a67f35 ("tools: k3_fit_atf: add DM binary to the FIT image") > Signed-off-by: Suman Anna > --- > Hi Lokesh, > > This issue is found recently when attempting to use an unstripper DM > firmware binary, it was masked with the existing DM binary since it's > size was very small. > > The script can do with some overhaul, as it is not generic and uses > hard-coded addresses. It should be possible to place ATF, OPTEE and > use a complete different memory layout for firmware images. The ATF > address selection is adjusted recently, but the others remain. > > regards > Suman > > tools/k3_fit_atf.sh | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/tools/k3_fit_atf.sh b/tools/k3_fit_atf.sh > index 3a476ced98b1..7bc07ad07468 100755 > --- a/tools/k3_fit_atf.sh > +++ b/tools/k3_fit_atf.sh > @@ -67,8 +67,8 @@ cat << __HEADER_EOF > arch = "arm32"; > compression = "none"; > os = "DM"; > - load = <0xa0000000>; > - entry = <0xa0000000>; > + load = <0x89000000>; > + entry = <0x89000000>; > }; > spl { > description = "SPL (64-bit)"; >