From patchwork Wed Sep 30 15:45:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Delaunay X-Patchwork-Id: 313907 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:1081:0:0:0:0 with SMTP id r1csp324554ilj; Wed, 30 Sep 2020 08:45:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwdrfldwPSgF0H7N46WEy5Xb98xqcwfMfkZupMEn/vujva1eLm++t8x33IJ0J4ndIrr0T2L X-Received: by 2002:a05:6402:1d05:: with SMTP id dg5mr3359540edb.67.1601480748253; Wed, 30 Sep 2020 08:45:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601480748; cv=none; d=google.com; s=arc-20160816; b=Ry4xJjUVPhiqBSMdxQRXA764KF3qbWvD+WUqXL3fFZoh1UbQHAQ/Y+jEoIrd6Dlo2b kIK8WFYB5kYSFFUtcDEDZlvzKJx0yJ25vdC/Xt+28XjhVE4olYIjlmZdLOgAMw72Wy/j ZaJBD49WOn/c7CR9HA1LleQe0Wv0+z3lfMOrKGbD5VERL8ddSJEln5pTcaUhF9mAHuV7 6GVDikKYhfyhoaQNLV18kU6OJ0izn9lXcOJkFNzyIL43j5POTn0G54lG/jZWSizaVulI SWfyl6hSwddcr/iHlmlF/vjwpe8Jr8YaVkYa42oadiHCVeb+bMRGhVi64zo2uEFum1Fg V9aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=axmC5IziFGKIgN5cJT3ympSdYK3MH4dvLsYktKcuNpA=; b=ZCUJMeyCegpOR92BWe1kuvynVcYEMfb7psq/SeMsRn/uFLlWdC2Yt8RhwZ+986ZhG4 WM5CcxAs5hogQWvmalrceVIHJ95e0mJwa7lncv7UXKrUbgONQgf11r+NmghjXLEKpUIJ ndfBx+5uGZOkjnQHcfGox5W9PxSC10/1yrTB3qj76itAOxzuAvHNB4p+ql2fshhIMWv8 xoe9gmnKFOXMseCXD3mcIim51WopOmaE5qN28g0NoWFgaFN7RpB3mxN7f8KmxJduZhDV mC0IbWUyMYECc/lV83uZrfXw2fu8B8SC7rPfIP98kxicRCvoG5ijc+ZH2fqsWxlQ+Cux eiRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="xN80Ro+/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id b15si1348060edy.258.2020.09.30.08.45.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Sep 2020 08:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b="xN80Ro+/"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0DA9D82384; Wed, 30 Sep 2020 17:45:41 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=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=st.com header.i=@st.com header.b="xN80Ro+/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42D4F8237B; Wed, 30 Sep 2020 17:45:39 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) (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 2F2818237B for ; Wed, 30 Sep 2020 17:45:35 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=patrick.delaunay@st.com Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UFWnW7010572; Wed, 30 Sep 2020 17:45:22 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : mime-version : content-type; s=STMicroelectronics; bh=axmC5IziFGKIgN5cJT3ympSdYK3MH4dvLsYktKcuNpA=; b=xN80Ro+/2uK6hCQTtqsmslFHS2Ak2wj/AE2dEvB4jlzziPdN/KfTSf7zSZOMsXgvk2k4 cp/TXGDplTOHMaj33sCcD/x6qhrOo6NKbEJybaQsDDFp2yb5RyNMa+3qlhyIS545APzi FJUzrgIHyxNW4qHQ+O7KUgtnCQCTMbpJEUg53Aydc5YCYs99+o0ziuXBMiLmpxCRldmJ McIfsl+L4pQiV8fW5I6ZYHE/vdAkeXnmjoHIg8EV+E0hHnuPquPRcBEljO+oaheeWXUo O2iyy16vTBhwHJTFqbv/TD4wm/dnp9bnBTVV2yyqFvKJMGfoflaweWLXybfLO3ZfKcu+ ZQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 33sts80hjn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 17:45:22 +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 6173210002A; Wed, 30 Sep 2020 17:45:21 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 28B052B205F; Wed, 30 Sep 2020 17:45:21 +0200 (CEST) Received: from localhost (10.75.127.46) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 30 Sep 2020 17:45:20 +0200 From: Patrick Delaunay To: CC: Tom Rini , Etienne Carriere , Heiko Stuebner , Yann GAUTIER , Patrick Delaunay , Jens Wiklander , Simon Glass , Tero Kristo , Thirupathaiah Annapureddy , chenshuo , U-Boot STM32 Subject: [PATCH v2] optee: copy FDT OP-TEE related nodes before generic FDT changes Date: Wed, 30 Sep 2020 17:45:08 +0200 Message-ID: <20200930174454.v2.1.I3f984b644583cb7080d779898cebfed8669d3f33@changeid> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG5NODE1.st.com (10.75.127.13) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-09-30_08:2020-09-30, 2020-09-30 signatures=0 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.102.3 at phobos.denx.de X-Virus-Status: Clean From: Etienne Carriere Move call to optee_copy_fdt_nodes() introduced by [1] before generic changes in kernel FDT so that platform specific changes are not overridden by the changes made by this function. Link: [1] commit 6ccb05eae01b ("image: fdt: copy possible optee nodes to a loaded devicetree") Fixes: 6ccb05eae01b ('image: fdt: copy possible optee nodes to a loaded devicetree') Signed-off-by: Etienne Carriere Signed-off-by: Patrick Delaunay --- Changes in v2: - rebase on master branch - add Fixes tag common/image-fdt.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/common/image-fdt.c b/common/image-fdt.c index f13eefb061..3d6935ad40 100644 --- a/common/image-fdt.c +++ b/common/image-fdt.c @@ -557,6 +557,14 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, printf("ERROR: arch-specific fdt fixup failed\n"); goto err; } + + fdt_ret = optee_copy_fdt_nodes(gd->fdt_blob, blob); + if (fdt_ret) { + printf("ERROR: transfer of optee nodes to new fdt failed: %s\n", + fdt_strerror(fdt_ret)); + goto err; + } + /* Update ethernet nodes */ fdt_fixup_ethernet(blob); if (IMAGE_OF_BOARD_SETUP) { @@ -576,13 +584,6 @@ int image_setup_libfdt(bootm_headers_t *images, void *blob, } } - fdt_ret = optee_copy_fdt_nodes(gd->fdt_blob, blob); - if (fdt_ret) { - printf("ERROR: transfer of optee nodes to new fdt failed: %s\n", - fdt_strerror(fdt_ret)); - goto err; - } - /* Delete the old LMB reservation */ if (lmb) lmb_free(lmb, (phys_addr_t)(u32)(uintptr_t)blob,