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=-18.2 required=3.0 tests=BAYES_00,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, 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 B8A4FC432BE for ; Tue, 31 Aug 2021 17:24: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 01B7A61101 for ; Tue, 31 Aug 2021 17:24:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 01B7A61101 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.st.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 CDF6882AC8; Tue, 31 Aug 2021 19:24:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.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=foss.st.com header.i=@foss.st.com header.b="kcRBq48+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 506F4831C7; Tue, 31 Aug 2021 19:24:15 +0200 (CEST) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) (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 284768346F for ; Tue, 31 Aug 2021 19:24:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=foss.st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=prvs=3877e84d46=patrick.delaunay@foss.st.com Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.0.43) with SMTP id 17VFRv9K013088; Tue, 31 Aug 2021 19:24:08 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=selector1; bh=zbuTJRc6c3MRECANGxa4dV668McZb3uKKvMeHUn3gLw=; b=kcRBq48+GhCBpIfFjoU+jQnAg3eNpjDRsmHN7ce4tf4wOgXOenLATqCfpo6wJc15NDa8 oCr0s8sAG5PyoaGz0+WOEYfJxeAe4OXqmDW08G4XFaqT45l3k9y9kAvTNi3/jKPFMQoL qiYyihMzweipA73HP/fWKiKnBAeAw7XB52QtrVQSuvvm5LWR+H1e/UM2L1wPqgdQamNJ /DZtluwxVvZrzpXr6CAJp9sZSkcPzQb6Ni7Er6oqo57lmabesxi3SLuHm1pq+Fb1nQfm lbBqOQPAAXKIZOjBangAiGRXHNtk2kvjbjcGXC6kOHoDwD5+Swb98sEGnd8Qr4SbdxXR VQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 3asc7e4dnw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 31 Aug 2021 19:24:08 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D8ABA10002A; Tue, 31 Aug 2021 19:24:06 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag2node3.st.com [10.75.127.6]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id CB9D12570BB; Tue, 31 Aug 2021 19:24:06 +0200 (CEST) Received: from lmecxl0994.lme.st.com (10.75.127.50) by SFHDAG2NODE3.st.com (10.75.127.6) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 31 Aug 2021 19:24:06 +0200 Subject: Re: [PATCH 10/10] stm32mp1: spl: Copy optee nodes to target FDT for OP-TEE payloads To: Alexandru Gagniuc , CC: , Patrice CHOTARD , Etienne Carriere , U-Boot STM32 References: <20210826214209.254461-1-mr.nuke.me@gmail.com> <20210826214209.254461-11-mr.nuke.me@gmail.com> From: Patrick DELAUNAY Message-ID: <1afb6206-e2e9-30e7-33f5-695341e88841@foss.st.com> Date: Tue, 31 Aug 2021 19:24:05 +0200 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: <20210826214209.254461-11-mr.nuke.me@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG2NODE3.st.com (10.75.127.6) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-08-31_08,2021-08-31_01,2020-04-07_01 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 Hi, On 8/26/21 11:42 PM, Alexandru Gagniuc wrote: > OP-TEE does not take a devicetree for its own use. However, it does > pass the devicetree to the normal world OS. In most cases that will > be some other devicetree-bearing platform, such as linux. > > As in other cases where there's an OPTEE payload (e.g. BOOTM_OPTEE), > it is required to copy the optee nodes to he target's FDT. Do this as > part of spl_board_prepare_for_optee(). > > Signed-off-by: Alexandru Gagniuc > --- > arch/arm/mach-stm32mp/spl.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/mach-stm32mp/spl.c b/arch/arm/mach-stm32mp/spl.c > index d9fdc5926c..94fbb45cf9 100644 > --- a/arch/arm/mach-stm32mp/spl.c > +++ b/arch/arm/mach-stm32mp/spl.c > @@ -19,6 +19,7 @@ > #include > #include > #include > +#include > > u32 spl_boot_device(void) > { > @@ -182,6 +183,7 @@ void stm32_init_tzc_for_optee(void) > void spl_board_prepare_for_optee(void *fdt) > { > stm32_fdt_setup_mac_addr(fdt); > + optee_copy_fdt_nodes(fdt); > stm32_init_tzc_for_optee(); > } > NAK the OP-TEE nodes are ADDED by the OP-TEE firmware in the unsecure device tree (when CFG_DT is activated) before to jump to the kernel (that remove the need to have DT allignement with U-Boot SPL device tree) => SPL should not copy the OP-TEE nodes in next stage DT reference in optee_os = core/arch/arm/kernel/boot.c: add_optee_dt_node() add_optee_dt_node() <= update_external_dt() <= paged_init_primary() It is the expected configuration for OP-TEE on STM32MP15 platform. regards Patrick