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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 360D9C433F5 for ; Fri, 8 Oct 2021 19:59:26 +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 B03CA60F57 for ; Fri, 8 Oct 2021 19:59:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B03CA60F57 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 3E8F083652; Fri, 8 Oct 2021 21:57:55 +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="jevKCOu0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7D67E83622; Fri, 8 Oct 2021 21:57:21 +0200 (CEST) Received: from mail-ot1-x336.google.com (mail-ot1-x336.google.com [IPv6:2607:f8b0:4864:20::336]) (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 8C7CA8361E for ; Fri, 8 Oct 2021 21:57:13 +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-x336.google.com with SMTP id k2-20020a056830168200b0054e523d242aso3474276otr.6 for ; Fri, 08 Oct 2021 12:57:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XlUg7RO7kw4MoUmpYMCmlrfg8HxVGqffXkzZtrTrT/4=; b=jevKCOu08ANeWGrr+OkDOab5ffKT448fxrszUAmYsuCYyMG2xG8zKgcuvZ1aoiy2f1 AfWmrXg9IU7GIPIXNa2azQi+PDq340439GDDl2dYZd09iK7DPQnOS1HjbuwGx5A2kNOZ FoCSKHb3y4G9NrG6VffycB/89dezW7s7Lx9UEstSy1Zq61Bw58NjWhgJbhNAII3Ybdrm DfTnTrJZYEko1DjZCFvB+9jRd711KanP0Fk4HbqWO3Ts2nBMOvgc7Gdl+horNnulKCg+ XXj7aSrvbREDTcDGjAuWXSNJKW1IhYKMGFnrUMl8igpoioDM4jGMXefsiridxf3e2EhI DDGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XlUg7RO7kw4MoUmpYMCmlrfg8HxVGqffXkzZtrTrT/4=; b=tmAwAvzrcUcc4PSLHPLRehmtd6lhGsLRxY9/zQPQ9pQwqkC1iCMTWu31CUUBnT1qPf bCA+w9ZwqdbkQx75AlpL2Moc62qWaLioxkdP4xUWh0jm/K6KtxqLzhA8Ew6y2TcMUsPU EhoY+0u0hzgorwjXqqaB8u7nP8oKe4+KLsjMCKRaArqjAgpsZnygWPtTwaRJXXohkshL LrpM+SucW4tScJkdzATDd+HnehkNnMrE+P51FdPgIpxqgrX0N0l5jRZ2RW6Y/5Ph8/br pUO8rgymMXXgFWN4d/D2N9UAuCAZ1FCrA7xgP7uxv8jm6JYaQaJBgk2OxOYXDdbAuFyt h6lw== X-Gm-Message-State: AOAM5330fnCWebwx57oYBrO+dQLJ7xl1Cb2LUHXjCKOW7aJStengJYgS AZpigvdX9mdmd2/b43Q0RuEFyJKo5V0= X-Google-Smtp-Source: ABdhPJxHChx9Yt47Fr789vkG/oFJGI+0HHP6QVbtgPrXvjObGOIgve+Y+tueSf9oQ/Iz/ZQjsiOhhg== X-Received: by 2002:a9d:734f:: with SMTP id l15mr3799034otk.4.1633723031973; Fri, 08 Oct 2021 12:57:11 -0700 (PDT) Received: from nuclearis3.lan (c-98-195-139-126.hsd1.tx.comcast.net. [98.195.139.126]) by smtp.gmail.com with ESMTPSA id x8sm67409otg.31.2021.10.08.12.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 12:57:11 -0700 (PDT) From: Alexandru Gagniuc To: u-boot@lists.denx.de, uboot-stm32@st-md-mailman.stormreply.com, patrick.delaunay@foss.st.com Cc: Alexandru Gagniuc , patrice.chotard@foss.st.com, etienne.carriere@linaro.org Subject: [PATCH v3 12/13] stm32mp1: spl: Copy optee nodes to target FDT for OP-TEE payloads Date: Fri, 8 Oct 2021 14:56:54 -0500 Message-Id: <20211008195655.46046-13-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211008195655.46046-1-mr.nuke.me@gmail.com> References: <20211008195655.46046-1-mr.nuke.me@gmail.com> MIME-Version: 1.0 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 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. OP-TEE is capable of patching the devicetree and adding the required "/firmware" and "/reserved-memory" nodes. Not all OP-TEE configurations do so, and it would need to be explicitly enabled (CFG_DT=y). There is a measurable boot time penalty to enabling this feature, and sometimes it is preferrable to do it in SPL for this exact reason. As such, there are cases where 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(); } -- 2.31.1