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=-4.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 CAC25C636C9 for ; Thu, 15 Jul 2021 19:11:20 +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 341AC6141E for ; Thu, 15 Jul 2021 19:11:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 341AC6141E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A9E2F82A13; Thu, 15 Jul 2021 21:11:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N6m2VPkW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 365AF82BDC; Thu, 15 Jul 2021 21:11:14 +0200 (CEST) Received: from mail-ot1-x335.google.com (mail-ot1-x335.google.com [IPv6:2607:f8b0:4864:20::335]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F01BE80C94 for ; Thu, 15 Jul 2021 21:11:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mr.nuke.me@gmail.com Received: by mail-ot1-x335.google.com with SMTP id 42-20020a9d012d0000b02904b98d90c82cso7302076otu.5 for ; Thu, 15 Jul 2021 12:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=uzM7ByjExLgBI5x/ZM0cBkavYvHV6mr5r8qebi86spM=; b=N6m2VPkWCvT/s00Wfhz3zG9IYzxZGQcym+3FyYYoBuR5eukjJOTcDwAmD4CFt6Tj6V 42HLGQk5ofE0H3OV7s6B7hdTeOXmclPcIa8ztm7GP2H0YdcHjtzZAz9wYAe6Qe7ZK7P7 rik9bFMvOXAQiYqPm0DrDzkRR6BCxKInKQiGUGUoLQja9FhDT3uFv2EwTSSRsyBZQNsq ERkS6WIZjfZ4MqlCjZdKB7sR4gkWFNoi2YK63fuZk/30LrkTi6T59KClN5OQ9jIQl7Rs +ikmo1PQUv8crO/qD15MAgVmxRcljuGDzlDiEXViRa4eQoZzHDJKiMBj712FNT0HU09G jV6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=uzM7ByjExLgBI5x/ZM0cBkavYvHV6mr5r8qebi86spM=; b=sDq+1/0pqYNygvyKJ3MUDlA3weKjjnwYxKmKYu6NiOON3PFBAy3CEyoJgg0odvTMG0 a/rTaYoa0Q3dzG5p11O0f3g5PcFSI/brQw2DXDX9fUOi5zNhomHrgx0uH8gRExaCFe+4 vfC7uo4BxCpSVg6wRwtbeYBAXFNBGUtHWFyHNjV2nQuEtXNZ1kCDR9iJdLxYRBESlCNJ tqATJv5Z+uZf0AQ4YZq8YsUt27AJ5sAO2xXh0GExzbI583ISbIP42K/ysUUbQW9zND+/ NFNQbsZftIii1JhOnhrCRdw/HJ/8YwxAi3prg957P49bEuDMiYp28sPuh/QEXljSQ8S4 cj9g== X-Gm-Message-State: AOAM532WbD21mZ367FfGNQvMrvDGkLLAryuVfow42UdpLyIGoB2THzLY 58p/Fy7uYLhri86u1KaiH6o= X-Google-Smtp-Source: ABdhPJy4Px6Z5l/JP0mglDhdArDY7LA8YQ2b3Z9Dqoh9wfQTdb4wCTcJ4IUnHNK8MiYgsJ111k+KDw== X-Received: by 2002:a05:6830:1f2b:: with SMTP id e11mr5074514oth.336.1626376269468; Thu, 15 Jul 2021 12:11:09 -0700 (PDT) Received: from nuclearis3.gtech (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id x129sm1414632oia.26.2021.07.15.12.11.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Jul 2021 12:11:08 -0700 (PDT) Subject: Re: [PATCH v4 1/5] spl: mmc: Support OP-TEE payloads in Falcon mode To: Patrick DELAUNAY , u-boot@lists.denx.de, trini@konsulko.com Cc: sjg@chromium.org, etienne.carriere@linaro.org, Patrice CHOTARD , U-Boot STM32 References: <20210531174314.1395666-1-mr.nuke.me@gmail.com> <20210531174314.1395666-2-mr.nuke.me@gmail.com> From: "Alex G." Message-ID: <6610a43e-d4af-b0ab-d8fa-13f0d2c9a6bc@gmail.com> Date: Thu, 15 Jul 2021 14:11:07 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit 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 7/15/21 1:27 PM, Patrick DELAUNAY wrote: > Hi, [snip] > When I merge this patch on master branch, I get the error: > > arm:  +   imx6dl_mamoj > +spl/u-boot-spl.bin exceeds file size limit: > +  limit:  0xefa0 bytes > +  actual: 0xf41d bytes > +  excess: 0x47d bytes > +make[1]: *** [Makefile:1997: spl/u-boot-spl.bin] Error 1 > +make[1]: *** Deleting file 'spl/u-boot-spl.bin' > +make: *** [Makefile:177: sub-make] Error 2 > This issue need to be solved before I accept and merge the serie. Okay, I'll have to drop the call to genimg_get_os_name(). > But I think again about the title of this patch : > > - spl: mmc: Support OP-TEE payloads in Falcon mode > > > If I unterstood after the serie the sequence for MMC is: > >      ROM code => SPL => TEE (as raw OS) => U-Boot > > > but it is not really the Falcon mode and > OP-TEE + falcon mode is not really supported... > > > And the patch title is disturbing. > > > For me the correct sequence is in Falcon mode is : > >     ROM code => SPL => TEE (secure world) => kernel (normal world) > This is exactly the use case that this patch intends to support. > > With the TEE and the kernel loaded by the SPL...... > > > and without falcon mode : > > (A)    ROM code => SPL => TEE (secure world) => U-Boot > > or > > (B)    ROM code => SPL (TZ) => U-Boot (TZ) execute bootm => TEE (secure > world) => kernel > > > what it your expected sequence in spl_load_simple_fit in this serie / in > your defconfig ? > > Today with the normal world address can be: > > 1/ = spl_image->entry_point (bootm_os.c in U-Boot proprer) > > 2/ = CONFIG_SYS_TEXT_BASE (hardcoded for SPL in spl_optee.S) > > > for 2/ When U-Boot is not used after SPL =  in falcon mode, > > the LR register shoud be set to kernel entry point. How does SPL know where OP-TEE should jump to? One could parse the FIT image, and try to figure out which of the loadables is the kernel. But what if there's a linux and u-boot, with different "/configurations" nodes? Figuring out where OP-TEE wants to start the normal world is a hard problem that the u=boot infrastructure is not prepared for. The solution I'm using is to build OP-TEE with CFG_NS_ENTRY_ADDR=[linux entry addr] Then LR is irrelevant. Alex