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 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 85C95C433F5 for ; Fri, 4 Feb 2022 07:47:20 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 315C083A50; Fri, 4 Feb 2022 08:47:18 +0100 (CET) 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="bssL23aL"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4C02E83A61; Fri, 4 Feb 2022 08:47:16 +0100 (CET) Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) (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 386E183A4F for ; Fri, 4 Feb 2022 08:47:13 +0100 (CET) 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-wr1-x436.google.com with SMTP id v10so104314wrv.10 for ; Thu, 03 Feb 2022 23:47:13 -0800 (PST) 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; bh=m0umPnE68NPfFOceqSbBIh+BFnIlPikkGFWMdLpkuWY=; b=bssL23aL/bybnyvUWdA7UKEtNbBltjRSqsvWgsXN4pmZTBRg+pnBB8JnqXrzQGbcWA aCHS2Bm7qN86Uj8Bsx0fL4HY+lc1F8MgwL4wGpQz3Vvb8JFdunGj+ZjDBB1cK3BrFpj+ qGeHI7RUfsNIfYfKQZZJbSIylx2ZFCHuiFqWynkHOsDx2rpycEvOe3lDkCYZs1Glj15c kP+YFeNrFH3c2C9E3z0u6GaI+Nr2TF/OQrwSn+ve5WNhnomT+v72zmKOJoZNsdStpmzM RJtjdPS4QRpKjm1uAM20vAwpbAGyaxY4YPSCZr3AwaWYK0mshPUIyD3J8z1X5h8DvZqw T7PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=m0umPnE68NPfFOceqSbBIh+BFnIlPikkGFWMdLpkuWY=; b=JiT1wYDaMeSTFZxQdthslWOawyX2plxsVVEGAaCsqcO0HD4GixMsbVW6jWaKqJgh7m XZ3EVLZ9NW8aI7BUBzPPumolMgUPS20ijGsfzGmyYCGt1NbCzLZKqDfyKFT8/Ah+Ti1T ZZx8SucMIbBDtwbNQlNPvjDl/CsJgF+AArOlFEc1EvfegP2+4aRA8VP2bWJDGeVsIvUk 3duRYJeSniyNJw6tbo35miC9DYYbrutsb99h+psVp3KLOjLToOS/ZFdfXR6afYaaMDJ6 Vs1iXw4b5572qIfr6D/AdfyuhZplNR8L2gGKos3lwov22IJ7+Wu3zg/5rKSDzRKJypCt jzsg== X-Gm-Message-State: AOAM532X65GJ+Jk6NAWQ/ohYjSiQWz00NA63hUTO7NPsVxR+fQwYpTys LjZwGU8OIGAjSyegUGeZGM2ye8Bic7IexQ== X-Google-Smtp-Source: ABdhPJznqUN5T+aAoN2aYK0rD/eqCFsbGVWvDarPapFqQZUgnaW9W0dumdETCaWpoa15lHeOKTN1LA== X-Received: by 2002:a5d:64e6:: with SMTP id g6mr1466703wri.184.1643960831636; Thu, 03 Feb 2022 23:47:11 -0800 (PST) Received: from trex (111.red-83-34-191.dynamicip.rima-tde.net. [83.34.191.111]) by smtp.gmail.com with ESMTPSA id u18sm334070wrn.110.2022.02.03.23.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 23:47:11 -0800 (PST) From: "Jorge Ramirez-Ortiz, Foundries" X-Google-Original-From: "Jorge Ramirez-Ortiz, Foundries" Date: Fri, 4 Feb 2022 08:47:09 +0100 To: Jorge Ramirez-Ortiz Cc: monstr@monstr.eu, 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: [PATCHv2] arm64: zynqmp: Print the secure boot status information Message-ID: <20220204074709.GA525606@trex> References: <20211013170447.10414-1-jorge@foundries.io> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013170447.10414-1-jorge@foundries.io> 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.5 at phobos.denx.de X-Virus-Status: Clean On 13/10/21, Jorge Ramirez-Ortiz wrote: > Output the secure boot configuration to the console. Hi, Michal was there any reason for not merging this patch? thanks Jorge > > Signed-off-by: Jorge Ramirez-Ortiz > --- > > v2: > Michal review 12 Aug 2021 > print information on SPL and UBOOT > improve the print command > add macros to mask the status > > arch/arm/mach-zynqmp/include/mach/hardware.h | 6 +++++- > board/xilinx/zynqmp/zynqmp.c | 14 ++++++++++++++ > 2 files changed, 19 insertions(+), 1 deletion(-) > > diff --git a/arch/arm/mach-zynqmp/include/mach/hardware.h b/arch/arm/mach-zynqmp/include/mach/hardware.h > index eebf38551c..c6b1464a9f 100644 > --- a/arch/arm/mach-zynqmp/include/mach/hardware.h > +++ b/arch/arm/mach-zynqmp/include/mach/hardware.h > @@ -141,8 +141,12 @@ struct apu_regs { > #define ZYNQMP_SILICON_VER_MASK 0xF > #define ZYNQMP_SILICON_VER_SHIFT 0 > > +#define ZYNQMP_CSU_STATUS_AUTHENTICATED BIT(0) > +#define ZYNQMP_CSU_STATUS_ENCRYPTED BIT(1) > + > 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 000a7cde8d..3e7ca2e9c6 100644 > --- a/board/xilinx/zynqmp/zynqmp.c > +++ b/board/xilinx/zynqmp/zynqmp.c > @@ -358,6 +358,18 @@ static int multi_boot(void) > return multiboot; > } > > +static void print_secure_boot(void) > +{ > + u32 status = 0; > + > + if (zynqmp_mmio_read((ulong)&csu_base->status, &status)) > + return; > + > + printf("Secure Boot:\t%sauthenticated, %sencrypted\n", > + status & ZYNQMP_CSU_STATUS_AUTHENTICATED ? "" : "not ", > + status & ZYNQMP_CSU_STATUS_ENCRYPTED ? "" : "not "); > +} > + > #define PS_SYSMON_ANALOG_BUS_VAL 0x3210 > #define PS_SYSMON_ANALOG_BUS_REG 0xFFA50914 > > @@ -394,6 +406,8 @@ int board_init(void) > fpga_add(fpga_xilinx, &zynqmppl); > #endif > > + /* display secure boot information */ > + print_secure_boot(); > if (current_el() == 3) > printf("Multiboot:\t%d\n", multi_boot()); > > -- > 2.31.1 >