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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 07DA6EE4993 for ; Tue, 22 Aug 2023 11:25:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B9233864F1; Tue, 22 Aug 2023 13:23:02 +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="EHigiWRj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D05BF86489; Tue, 22 Aug 2023 13:22:57 +0200 (CEST) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) (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 140608649F for ; Tue, 22 Aug 2023 13:22: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=clamor95@gmail.com Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-9a1869f2c06so528632266b.0 for ; Tue, 22 Aug 2023 04:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692703374; x=1693308174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5cW+07bhSOomjaYX5vGjjnMdrOVTNnKyr7x3yMQzkYk=; b=EHigiWRjE/5dGT5fSN9AadnBbI93tHSfkudAIlSLvDllK58Ju+NaWYA9wUDvvcg8sW 0PFgbMtMeETDZTjCiW54KIlHhgAp3pMj8in8GT2pMwd9N796+4ZHu4UGgvIT+Tl9fccM jPCex7wZPduSAIVzxtN8Nos2BXFGGn3hky8tXUykZggNYaU61Vzpr2PEQoPeZvWc1TOY F2WiID952ApWZB5IJ13V5DbJYVEfpXYX+Q/GUW6oIc2L1DABPPw/LpVh0PETOtJCke7o GKHqBCqXVctLYyHTifAzPm3J9nxRI8dfPZT1ofM5Dv93f2pYhzNBKjin4s1zzytdUrjW LVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692703374; x=1693308174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5cW+07bhSOomjaYX5vGjjnMdrOVTNnKyr7x3yMQzkYk=; b=g7y8duklg+GUvAs42KbdMp4z3bZdY1epfJxvY0BnM9BhN8Bsa/XP+frtM9CQbFfSt1 MyjLtD41vc4YnUJfAYQPlcA1zmg4G/sKxOOzdaZgxoPofJrl0X/BD7Ors3z0t/GFuWuq UuwlHIGcKltzNtHqt/cARtfW37efv8ecC3zPXiapsPvdbQQH5s1E4/rLZeDHuCA6PC8r YTT7t1OwRAR+KkIXJ1UldjBgmuazkiHLxz1eOw4Kpeco/MaxnrjQm5jp4oduVL/zxNJb IUvAOn5lJZuK1oVCVlwkADLlCYO+dVojyefqgJG8fSfQXGFacMsCTBnuunIvaWA5L7K2 xpvw== X-Gm-Message-State: AOJu0Yy6cwHTr+yGdBGoZn/ZSEnOgDSmOKSq52iO2Xcdz/PppG6RCy5U Fyr7o87V8UF5d0BDBS0Cg57yGlvP9xzl7w== X-Google-Smtp-Source: AGHT+IEWPNcPQdHvux0hDhJmwDA2iypoIhXvzxvm4/C9z0sqv3MNV6JHzjQTdRRzSdq2rye9pluskg== X-Received: by 2002:a17:907:75f9:b0:992:2f67:cd34 with SMTP id jz25-20020a17090775f900b009922f67cd34mr10617048ejc.22.1692703374453; Tue, 22 Aug 2023 04:22:54 -0700 (PDT) Received: from xeon.. ([188.163.112.52]) by smtp.gmail.com with ESMTPSA id mh9-20020a170906eb8900b009934855d8f1sm8041456ejb.34.2023.08.22.04.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Aug 2023 04:22:54 -0700 (PDT) From: Svyatoslav Ryhel To: Thierry Reding , Svyatoslav Ryhel Cc: u-boot@lists.denx.de Subject: [PATCH v1 17/19] ARM: tegra: dt-setup: convert TrustZone remove into config Date: Tue, 22 Aug 2023 14:22:15 +0300 Message-Id: <20230822112217.4646-18-clamor95@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230822112217.4646-1-clamor95@gmail.com> References: <20230822112217.4646-1-clamor95@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.8 at phobos.denx.de X-Virus-Status: Clean Remove of TrustZone nodes is required by many product devices which require repetable calls of same function from device board. To simplify this, TZ remove is converted into Kconfig option. Signed-off-by: Svyatoslav Ryhel --- arch/arm/mach-tegra/Kconfig | 14 ++++++++++++++ arch/arm/mach-tegra/dt-setup.c | 7 +++++++ 2 files changed, 21 insertions(+) diff --git a/arch/arm/mach-tegra/Kconfig b/arch/arm/mach-tegra/Kconfig index 464bd0798f..650f5c7984 100644 --- a/arch/arm/mach-tegra/Kconfig +++ b/arch/arm/mach-tegra/Kconfig @@ -172,6 +172,20 @@ config TEGRA_DISCONNECT_UDC_ON_BOOT USB controller when U-Boot boots to avoid leaving a stale USB device present. +config TEGRA_REMOVE_TZ_NODES + bool "Remove TrustZone node and alias from Linux DTS before boot" + depends on !SKIP_LOWLEVEL_INIT + select OF_LIBFDT + help + U-Boot cannot deploy TrustZone on its own on product devices since + vendors usually do not provide device specific TrustOS images. Same + time vendor bootloaders establish TrustZone and Linux device trees + take this into account and bind Trusted Foundation devices. If u-boot + tries to boot such tree it will stuck. This option automatically + removes TZ nodes from device tree used for booting Linux kernel to + avoid bootloop and preserve compatibility of Linux device trees with + vendor kernels. + config CI_UDC_HAS_HOSTPC def_bool y depends on CI_UDC && !TEGRA20 diff --git a/arch/arm/mach-tegra/dt-setup.c b/arch/arm/mach-tegra/dt-setup.c index c11494722b..8f8e1aee1b 100644 --- a/arch/arm/mach-tegra/dt-setup.c +++ b/arch/arm/mach-tegra/dt-setup.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -32,6 +33,12 @@ int ft_system_setup(void *blob, struct bd_info *bd) return ret; } +#ifdef CONFIG_TEGRA_REMOVE_TZ_NODES + /* Remove TrustZone nodes */ + fdt_del_node_and_alias(blob, "/firmware"); + fdt_del_node_and_alias(blob, "/reserved-memory/trustzone@bfe00000"); +#endif + return 0; } -- 2.39.2