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 3DA6FC433EF for ; Fri, 8 Oct 2021 19:58:21 +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 B17FB60F57 for ; Fri, 8 Oct 2021 19:58:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B17FB60F57 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 230A083631; Fri, 8 Oct 2021 21:57:35 +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="YqQ7mr0T"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CBB838362A; Fri, 8 Oct 2021 21:57:14 +0200 (CEST) Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) (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 6905483612 for ; Fri, 8 Oct 2021 21:57:08 +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-oi1-x229.google.com with SMTP id u69so2719977oie.3 for ; Fri, 08 Oct 2021 12:57:08 -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=8OpHEYlQb8Mu5hcRIaotjRf4RRob815sMXJYLVBAtjw=; b=YqQ7mr0TFBia75a+cg+WHgSYEreOHXuZCXYzjMwpoApfkBqWjdfnIz5Jru2pgCrkMe oovdOvyy2LPDs3Yekd8GaRqbpGq3H7xNjvldqunr5WsIIdXbuZYJV+kVdCXpekGNxej7 wWQeMvFSPbk7cH3Vll5QZdYqvHKfhbfYx37as9LxqOpykYT09ItATjzSzZWPtvUZzxns R1vJl1tdlU9CFsjmutmTjYaySz8ISv1lljcfoSYEp0it2ceNA62LNISfMYdJVYEVYwBO gZkgyNHt+qVNb+huoLjfqQhNgo8/6hRB+Hilt6IIOBGZgzxeVb+o8Y9s6Y+1iYQ+xEl/ vlKQ== 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=8OpHEYlQb8Mu5hcRIaotjRf4RRob815sMXJYLVBAtjw=; b=6LgZgWN+emdUrLFxV2x+UC3RRsPKQJx7BkFi/N5aSlg/WwDq+3p+DhCT4oJBbgHdjA pJw6lbLpKSGGgPVgqSUVoVqVNx4LkqZJWBVRT6IfoGVqSnoYf6wyCvQs/jodWLtHiYrw ewnnqr4ldkM8WLLPgezwKYNm0BioaxcqB3hJ3/AN1/RHnC9ZEk5N8A3+iUUjdaa8kmQ6 Hyt6hUX4zMib+BcWO1W/7fFPZ3fEeXdvkl09bDGp1pfRlvu9JBuqMiFXEwH/lDaTBIq6 gG6ffe/DrAZZt1JhzvSSLMvkMO4Nm9lALyeKwmb8JIjW6NLC9R98UvGmCRE+FWwHyoly yecg== X-Gm-Message-State: AOAM5321gZ0kKXxlA/WS8jdJM3IGbGRiR6qWSLbxSTwFSuJ0r7FkH3in nfqlyxd7QMQCc94ksGAd+/dY8vvLqcE= X-Google-Smtp-Source: ABdhPJx5LZenvi9nDjXeSCWg5gpD/8gr7nOmHDriWDD/YOdNe+LdHhxd4+iIu33t8P/GrxuN45b1fw== X-Received: by 2002:aca:3c8a:: with SMTP id j132mr9623413oia.171.1633723026840; Fri, 08 Oct 2021 12:57:06 -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.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 12:57:06 -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 07/13] arm: stm32mp: bsec: Update OTP shadow registers in SPL Date: Fri, 8 Oct 2021 14:56:49 -0500 Message-Id: <20211008195655.46046-8-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 For TFABOOT and SPL_BUILD, stm32mp_bsec_probe() skipped updating the OTP shadow registers. The idea is that we can't access BSEC from the normal world. This is true with TFABOOT. However, in SPL, we are in the secure world, so skipping probe is incorrect. In fact, SPL is not even built when TFABOOT is selected. Thus, do not skip this step for SPL_BUILD. Note that because SPL is now doing this step, we no longer need to do it in u-boot. The new logic is "let the FSBL do it", which is simpler. Signed-off-by: Alexandru Gagniuc --- arch/arm/mach-stm32mp/bsec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-stm32mp/bsec.c b/arch/arm/mach-stm32mp/bsec.c index fe39bd80cf..41ed5f3cf5 100644 --- a/arch/arm/mach-stm32mp/bsec.c +++ b/arch/arm/mach-stm32mp/bsec.c @@ -503,10 +503,10 @@ static int stm32mp_bsec_probe(struct udevice *dev) /* * update unlocked shadow for OTP cleared by the rom code - * only executed in U-Boot proper when TF-A is not used + * Executed only by FSBL (SPL or TF-A) */ - if (!IS_ENABLED(CONFIG_TFABOOT) && !IS_ENABLED(CONFIG_SPL_BUILD)) { + if (IS_ENABLED(CONFIG_SPL_BUILD)) { plat = dev_get_plat(dev); for (otp = 57; otp <= BSEC_OTP_MAX_VALUE; otp++) -- 2.31.1