From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT 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 8163BC433EF for ; Wed, 8 Sep 2021 00:00:43 +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 DCDB961104 for ; Wed, 8 Sep 2021 00:00:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DCDB961104 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 5A11882BD6; Wed, 8 Sep 2021 02:00:25 +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="aZIWMtNY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F209683308; Wed, 8 Sep 2021 01:59:54 +0200 (CEST) Received: from mail-qv1-xf29.google.com (mail-qv1-xf29.google.com [IPv6:2607:f8b0:4864:20::f29]) (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 1758C832DD for ; Wed, 8 Sep 2021 01:59:45 +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-qv1-xf29.google.com with SMTP id u4so409131qvb.6 for ; Tue, 07 Sep 2021 16:59:45 -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=aZIWMtNYzJH0kN2N8QwuYU8L7qrkf4roYb++w0XgmkNsH8Jp2spdXLRxr0mT03zra9 RZo7wZHV6O8a9gPVuJoqkd9GaWCrs5LwoUYWLTgd9PKI2G2AZKHDZU1IVPR1Dw3zDtCq 49dlIPoIe1IZPXiUPPj3Bb1AZAX1DZB4q+3gq5RMSOfVVhrX2EQZ2TkdeV/UtZHtkU6e tTkNUEsmmEpzmEpxoieHbV7n1IEocodE1fngoyn+92stVxeRxnk03PBsabb72YRgkhTE KYtygx9F3SI0aBpYvENZthQ7gmnOIsH0OggGDBBqqIWx0e/wNDxyber/aGs4bt+VDJFC iHFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8OpHEYlQb8Mu5hcRIaotjRf4RRob815sMXJYLVBAtjw=; b=JlsrkDbvUZDHbyD/TNOIIuJtfzc8pObk0AYyRbYnn3uMlMXcSf3pyH69XMb7psFQg+ ZOvniSodZ1V3VSSY8TFU2Mogkg14OWweOE5w4cYyVpRDx23syUnvRr3JEaef6qMqQwSS A/B0pL1lN/yFkjZRm3ShwzjhQ/LXO6P4H8mI6XzT1cnf8mIgyIwBHlbhVEEcIWke4O24 9RJmcN4P5gKHz553ruW+rC/6fwu3Suc8HDNDgaEsKxfzndT9wG0XD2MdgbYvIcMA7nuV 7tWuh+d1+P89SkBHid+EPbeoSxCuR/EAe1AG8LyEkoG9/QRMEXt9nSXRQNMeNDr9V+V+ OJPQ== X-Gm-Message-State: AOAM532U2TzrDxy3k8GPt/xxYYNQtP7bc+L19lWBFfsdxHhhTAtnpTQY H8V03/fO+eb7BgtLf8A/CEVTuBWbkr4= X-Google-Smtp-Source: ABdhPJzh7CtRvGDDYBlx/2zpufAF1nIlbQ8x/irGVXi68pR0IClvlSKf8D4OPQbxyLYFaFNq/DXTWw== X-Received: by 2002:a05:6214:94c:: with SMTP id dn12mr811016qvb.60.1631059183474; Tue, 07 Sep 2021 16:59:43 -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 d78sm460351qkg.92.2021.09.07.16.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Sep 2021 16:59:43 -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 v2 06/11] arm: stm32mp: bsec: Update OTP shadow registers in SPL Date: Tue, 7 Sep 2021 18:59:28 -0500 Message-Id: <20210907235933.2798330-7-mr.nuke.me@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210907235933.2798330-1-mr.nuke.me@gmail.com> References: <20210907235933.2798330-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