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=-12.7 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,URIBL_BLOCKED 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 B457CC63793 for ; Thu, 22 Jul 2021 16:00:25 +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 EAE0F6121E for ; Thu, 22 Jul 2021 16:00:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EAE0F6121E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CD9C1829F8; Thu, 22 Jul 2021 18:00:22 +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="kCzmB7V3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DB26082A01; Thu, 22 Jul 2021 18:00:19 +0200 (CEST) Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0: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 0A5FB829C7 for ; Thu, 22 Jul 2021 18:00:16 +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=igor.opaniuk@gmail.com Received: by mail-ot1-x32a.google.com with SMTP id o17-20020a9d76510000b02903eabfc221a9so5783847otl.0 for ; Thu, 22 Jul 2021 09:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=V9azBEUAOBxGxmVTr4X/dhpGI5Wc4gFwGlNuVwSm+Do=; b=kCzmB7V3i4QkW2wYkTk9thQmCUxGZS3nesNsRRc+5r56UM1j/ajK16yp6RiSbXCCqH PGFIhXdH6Xx7ZdhBJOeFlxJ3RCrrMzNZzuLXRvF/xPNTbyx9ht5K79XhTNzB/rzDE2qY rzOh6ALoNIhQIIJgDPDlPKJMPOl4U4/6H2KHqRtvozysJa4SQEUEUw2KYhTK71pjj6L6 wmy5BCQJ736wzLxT1QIkb7sw6hBzs8OLVpR8iMFlk+ddG8xspbDzheoIIVz1AaXTYN9d Jn40fSd1r6lhsuKsSIuP/xYKBoxasBy+bpmLZmvKNI4oqAWZhhKLC4qqdttks39pdSjq 5Ntw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=V9azBEUAOBxGxmVTr4X/dhpGI5Wc4gFwGlNuVwSm+Do=; b=jf0Bh5HrYtYYsNYWsxeGIu9bM/lYjQTaY9B9zV2RUIOPedNYZQQYjQzGtjZyZJ3Iwm 3EZhubAZRqisv6Ugl0ejB8O0DOzEhKNswuLwndFKYFX0xmAaZjWG9Cn8TBDUJSaA3734 w1rYy5wX4br0SoO+tAhi3cDS4s7Ww/C/2DI4wsUerqMc/xjgV7upWxiaH9qpLte82Sue 9NU4STEdP20s2b8kfPB1mLYQWuZVds30xEFrSq860dC1smQSd20QJWsjrmAyNw5Ev+QH SHJ4xNMTHb43lBEi1F3wsorKcjabUp+fyVOakDkPfXvZqxcGYkjJGRZ0XERC0lv+hgcM O8hQ== X-Gm-Message-State: AOAM531EEe8NgnC6vG0kw3XVMBEZaJgP8LomSd8EqWcxTvxpsR2sxfdP jx1oLza+fQ6TjHC1weEmOmLB2+yaaEAiuzmGczc= X-Google-Smtp-Source: ABdhPJw3EzSoNYa2o6q0pvy4cbgia/eZ+VGt0/l/O9eJ9y0Kn1p6l4YofJy4u20aI19Gwnbso0p6Pe33twt3QuMBEtI= X-Received: by 2002:a9d:86d:: with SMTP id 100mr289938oty.45.1626969614406; Thu, 22 Jul 2021 09:00:14 -0700 (PDT) MIME-Version: 1.0 References: <20210722111932.5544-1-jorge@foundries.io> In-Reply-To: <20210722111932.5544-1-jorge@foundries.io> From: Igor Opaniuk Date: Thu, 22 Jul 2021 19:00:03 +0300 Message-ID: Subject: Re: [PATCH] arm64: zynqmp: Print the secure boot status information in EL3 To: Jorge Ramirez-Ortiz Cc: monstr@monstr.eu, adrian.fiergolski@fastree3d.com, Simon Glass , ibai.erkiaga-elorza@xilinx.com, t.karthik.reddy@xilinx.com, U-Boot Mailing List , Ricardo Salveti Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Hi Jorge, On Thu, Jul 22, 2021 at 2:19 PM Jorge Ramirez-Ortiz wr= ote: > > 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 =3D readl(&csu_base->status); > + if (status & (BIT(0) | BIT(1))) { > + printf("Secure Boot:\t%s%s\n", > + status & BIT(0) ? "authenticated" : "not authentic= ated", > + 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() =3D=3D 3) > + if (current_el() =3D=3D 3) { > multi_boot(); > + secure_boot(); > + } > > return 0; > } > -- > 2.31.1 > Reviewed-by: Igor Opaniuk --=20 Best regards - Freundliche Gr=C3=BCsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk@gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk