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=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 862EAC432BE for ; Fri, 27 Aug 2021 09:20: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 C11EC6054F for ; Fri, 27 Aug 2021 09:20:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C11EC6054F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=foundries.io 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 68AB583273; Fri, 27 Aug 2021 11:20:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io 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=foundries.io header.i=@foundries.io header.b="YOuRiDKy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EC6448328B; Fri, 27 Aug 2021 11:20:15 +0200 (CEST) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 E5DF683271 for ; Fri, 27 Aug 2021 11:20:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jorge@foundries.io Received: by mail-wm1-x32a.google.com with SMTP id 79-20020a1c0452000000b002e6cf79e572so8733935wme.1 for ; Fri, 27 Aug 2021 02:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aLIyl5m2aKp9nET21L7VP8YVtpGNt7W5hNFM0RA+z3A=; b=YOuRiDKyVSs/kMP/qSxMrude4uPJqK4R43VMlGUtJXEi/dLc3e02Yb3WN5c2Kfewsc dJHAfgyH6XN1XjOQyrifMDxApkyb1+86CyoGQ0uhoRPhG0frvvpwUx4zEd4nU7ffGpD6 Y7aXZl5gW18+mD3nylbV8J6rLiCTBVUHxkRpos/FblAG2pNnLA2JPb+Dh94v4Pl83OvE dTlwlRdcTR5U3HvBdGubfzqo4+5py+qfrEDgapDFRlsIsxTZpOexAptqW29lH019VFKC tEi/WIlNB4oYdoT528uk6RG2YCBUqUueYnpUI6OCThKC+I9XdStD4a+mMC1+QJjzfTmw ROCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aLIyl5m2aKp9nET21L7VP8YVtpGNt7W5hNFM0RA+z3A=; b=PamWOmq8RLTRA+CspQhnUeqGQWrfVnpyta/bn6TV9SH4DpMvAV5/kJdIvjujcgrhst DuDxAunbVQfgNVzhByMRkpp56j8JoqXgEATWhrPERbALwuDSoOl04VwSSzVyEVxQKvCn p++mbbgvNLWY30bYO9He+mPcxtxwzXa8+muqBO0iExXlj8jP3ofIxm6Q+W+4RvuN+cvp HQ5rq+J7Z4K4Mg6W4ppEM1/CAiEVV4X/CA3KybevWtsJ8rGnmQ01sj2kYGieaBocnTK7 J6bYnycOAYRrGrQKroNMos/WbK4DSEGCxG3sJVs6/sZD98BDaWa2DCbaHne4323q1OEa WPbg== X-Gm-Message-State: AOAM5311AmijWTnRlUXwYR0/t1MyyUOXwcE5gUgdb5HOqDfbPF4lULrp rmTk9YWT19yMXJ8DhkA0pp+/6g== X-Google-Smtp-Source: ABdhPJw++xh5SOsx8LMIGLSAE8fE4HB71IL8q89yA9v8O2KNTr0lihwGDaNZy8/yrMKuFJilc99oMA== X-Received: by 2002:a7b:c005:: with SMTP id c5mr7771521wmb.59.1630056010258; Fri, 27 Aug 2021 02:20:10 -0700 (PDT) Received: from trex (66.red-81-34-51.dynamicip.rima-tde.net. [81.34.51.66]) by smtp.gmail.com with ESMTPSA id d145sm10530478wmd.3.2021.08.27.02.20.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Aug 2021 02:20:09 -0700 (PDT) From: "Jorge Ramirez-Ortiz, Foundries" X-Google-Original-From: "Jorge Ramirez-Ortiz, Foundries" Date: Fri, 27 Aug 2021 11:20:08 +0200 To: Michal Simek Cc: Jorge Ramirez-Ortiz , adrian.fiergolski@fastree3d.com, sjg@chromium.org, ibai.erkiaga-elorza@xilinx.com, t.karthik.reddy@xilinx.com, u-boot@lists.denx.de, ricardo@foundries.io Subject: Re: [PATCH] arm64: zynqmp: Print the secure boot status information in EL3 Message-ID: <20210827092008.GB2289@trex> References: <20210722111932.5544-1-jorge@foundries.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 On 12/08/21, Michal Simek wrote: > > > On 7/22/21 1:19 PM, Jorge Ramirez-Ortiz wrote: > > Confirm the secure boot configuration on the console. > > > > Signed-off-by: Jorge Ramirez-Ortiz > > --- > > arch/arm/mach-zynqmp/include/mach/hardware.h | 3 ++- > > board/xilinx/zynqmp/zynqmp.c | 16 +++++++++++++++- > > 2 files changed, 17 insertions(+), 2 deletions(-) > > > > diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h > > index 3776499070..3d3ffa086e 100644 > > --- a/arch/arm/mach-zynqmp/include/mach/hardware.h > > +++ b/arch/arm/mach-zynqmp/include/mach/hardware.h > > @@ -139,7 +139,8 @@ struct apu_regs { > > #define ZYNQMP_SILICON_VER_SHIFT 0 > > > > struct csu_regs { > > - u32 reserved0[4]; > > + u32 status; > > + u32 reserved0[3]; > > u32 multi_boot; > > u32 reserved1[11]; > > u32 idcode; > > diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c > > index 1748fec2e4..b7d11630d1 100644 > > --- a/board/xilinx/zynqmp/zynqmp.c > > +++ b/board/xilinx/zynqmp/zynqmp.c > > @@ -355,6 +355,18 @@ static int multi_boot(void) > > return 0; > > } > > > > +static void secure_boot(void) > > +{ > > + u32 status; > > + > > + status = readl(&csu_base->status); > > + if (status & (BIT(0) | BIT(1))) { > > please create macros for these bits. ok > > {} around are not needed. yep > > > > + printf("Secure Boot:\t%s%s\n", > > + status & BIT(0) ? "authenticated" : "not authenticated", > > + status & BIT(1) ? ", encrypted" : ", not encrypted"); > > Isn't this more space efficient? > printf("Secure Boot:\t%sauthenticated, %sencrypted\n", > status & BIT(0) ? "" : "not ", > status & BIT(1) ? "" : "not "); > > And as I see it is. > aarch64: (for 1/1 boards) all -33.0 rodata -17.0 spl/u-boot-spl:all > -33.0 spl/u-boot-spl:rodata -17.0 spl/u-boot-spl:text -16.0 text -16.0 > xilinx_zynqmp_virt: all -33 rodata -17 spl/u-boot-spl:all > -33 spl/u-boot-spl:rodata -17 spl/u-boot-spl:text -16 text -16 > spl-u-boot-spl: add: 0/0, grow: 0/-1 bytes: 0/-16 (-16) > > ok with me > > + } > > +} > > + > > #define PS_SYSMON_ANALOG_BUS_VAL 0x3210 > > #define PS_SYSMON_ANALOG_BUS_REG 0xFFA50914 > > > > @@ -391,8 +403,10 @@ int board_init(void) > > fpga_add(fpga_xilinx, &zynqmppl); > > #endif > > > > - if (current_el() == 3) > > + if (current_el() == 3) { > > multi_boot(); > > + secure_boot(); > > + } > > Please take a look at > https://lists.denx.de/pipermail/u-boot/2021-July/456382.html > I have changed multi_boot function a little bit. ok > > Thanks, > Michal > > -- > Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91 > w: www.monstr.eu p: +42-0-721842854 > Maintainer of Linux kernel - Xilinx Microblaze > Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs > U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs >