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.2 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,URIBL_BLOCKED, 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 DE4BEC4338F for ; Wed, 11 Aug 2021 18:55:59 +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 127926109E for ; Wed, 11 Aug 2021 18:55:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 127926109E 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 E945A82C19; Wed, 11 Aug 2021 20:55:56 +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="VQXsZLqB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 47E9D82C2D; Wed, 11 Aug 2021 20:55:55 +0200 (CEST) Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) (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 432DD82C19 for ; Wed, 11 Aug 2021 20:55:51 +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-wr1-x42c.google.com with SMTP id z9so4375929wrh.10 for ; Wed, 11 Aug 2021 11:55:51 -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=i6S18/kAP0qZt99J4GxMdhK8Nv4m0L1J4skM3VoJoW4=; b=VQXsZLqB+hBoZbJD2AQwrYackcOdduvFYLJGwncdD7Ohk9PnO7atlzBHbsrIjWNeKj anIJp6xL3U8pth6f7chGgJqrdRYdI+XzVoKnOkKoLzAKe6qBg4/91IOCObJYDlUaRSlp X7mvU3a659MGyYMifPbVjFe04D/QTrvYAzhsS6GCW/KUJU1+4JQygr1a52HT0pFIJbXp kLYdCfI+pGP+U+7RmWEuGZaO5HIHG6iZgGm5+IOe9fddrr/FEOroAyBb8ZLOPOrPcYcg g6UrtnIj9OjmwAfN0DTAkfe0Lzhz4R5XZvmaB9Wpf3m8uSZDdnEosQ/2JqUjvro3N3dB hclg== 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=i6S18/kAP0qZt99J4GxMdhK8Nv4m0L1J4skM3VoJoW4=; b=Vqi9NW9/MpxuFiLGrXvyixA+b0Igu46VUwNZB4ngxB0yAUtqVK4AmoYU0EU2Lj97g2 4Zaez0gM6K8DJSPXqJXRdylFaxgQa+VagzxzT2C0l/Kcj9zIm++1t1Plc5HyiFBoa11W Df9LqhhuW3ImWpCUHasA/g8n2pEDXOroYIio4pj/s+ON74Gd9LlQZMbw8wKvEnm6EOQd 6bfHz+Yb+P2EkYiuYPmcJzUPk6Bhxxaw8nxyWa+gD7vstQX0agx/ylFNVXoHRLiv24AL K6ffRYHKQGwGNepYXCcSQGpKWMFCyUBaYwG1FNFvUTNjG2qd9A9WfXl4/0tPip5MrL4R mZgA== X-Gm-Message-State: AOAM530oal4QHshSVo5B+wOla8i4FnB9GjooVPS/NT2S8zxxVv1SbXXZ g1pkwMU/Q5wstakfcsAk5dEK7Q== X-Google-Smtp-Source: ABdhPJwgTHRhnhzLR1E5kMqh53TauSHivwQQs6ADSIzENcEiMUjVSMPMWtqx5UnvVmi1yCkOYOb48Q== X-Received: by 2002:a5d:4a50:: with SMTP id v16mr15615911wrs.77.1628708150861; Wed, 11 Aug 2021 11:55:50 -0700 (PDT) Received: from trex (240.red-79-154-201.dynamicip.rima-tde.net. [79.154.201.240]) by smtp.gmail.com with ESMTPSA id d15sm165195wri.96.2021.08.11.11.55.49 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Aug 2021 11:55:50 -0700 (PDT) From: "Jorge Ramirez-Ortiz, Foundries" X-Google-Original-From: "Jorge Ramirez-Ortiz, Foundries" Date: Wed, 11 Aug 2021 20:55:49 +0200 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: [PATCH] arm64: zynqmp: Print the secure boot status information in EL3 Message-ID: <20210811185549.GA1091@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: <20210722111932.5544-1-jorge@foundries.io> 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 22/07/21, Jorge Ramirez-Ortiz wrote: reminder > 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))) { > + printf("Secure Boot:\t%s%s\n", > + status & BIT(0) ? "authenticated" : "not authenticated", > + status & BIT(1) ? ", encrypted" : ", not encrypted"); > + } > +} > + > #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(); > + } > > return 0; > } > -- > 2.31.1 >