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=-18.8 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_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 59010C63793 for ; Thu, 22 Jul 2021 11:19:45 +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 55B2B61029 for ; Thu, 22 Jul 2021 11:19:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 55B2B61029 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=foundries.io 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 DD776829EC; Thu, 22 Jul 2021 13:19:41 +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="Dg4gwpNg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2537B829F8; Thu, 22 Jul 2021 13:19:40 +0200 (CEST) Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) (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 C30E5801D9 for ; Thu, 22 Jul 2021 13:19:36 +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-x42d.google.com with SMTP id m2so5546484wrq.2 for ; Thu, 22 Jul 2021 04:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TtI/xz0Kcf6PghSGjPaXh+xF23tmSv3bnGEYidzDkL0=; b=Dg4gwpNgkN59nciPhewTVPmYFW3GziaO+XF7KUk1H8OQfYmt1D+i/P7aF0ZU5uCZp3 mWTXq3II97bMWeLmd7MAvMGxFeJm6o0MLFn1vAbENLVvmJMvnj4uu4QIcPb4BJ5shaCx 2V0IABe6UvISX92Au7HcZ2NYMMbytj+ysAySVioCXEr6ldOfx3dBlUx4/pyf/xl72t1I ZN6U557BhJzvOaDa/OrIrQ7fadLB2yk7RKX1AbJlB2qDhZPISpxwD6QNGPMt6IM4qXR6 FeVTkVkDJ9f4ild7r5J6gp85WbsBUJAwoEXy/+vxbbbDveOyxCZtxoaHG7/MDbPK0qXz yMkg== 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:mime-version :content-transfer-encoding; bh=TtI/xz0Kcf6PghSGjPaXh+xF23tmSv3bnGEYidzDkL0=; b=gpRKTXyYmVuBhk5BR9IfJvpENU3ZDxwKSBzexY945uR+9yVm0uxS6S77jhUYg5J5dA pbhTIq1rKgEU/sCYzisjtMyQpRBOz4bS1jRzxDlQHJ/wkRuyv5nPgHsRsmzftCrSlu7B dm+WEEGt/tF4fcl7qJQH2HN5hljuuUVUH+o6Qzi3L2tklc7DFloAGUvr/Rb6owPPM8t8 41xfphtct4tgg5CICHllIzSypUj+ztjrgZoTiJHb9o4KVb3FZ8JO8PGqFDv45zIABbXT G/IYXTBfiBw1BUKigajaejPy4KIoXyhKWv8dSngtcwUS+P7b0tQHonve5t6UcWQayBYQ o1Gw== X-Gm-Message-State: AOAM53265MJ51dc0sjcs0q7PAXLsGwG9wOj+UzQSEbxNMqvyyzU/4KYy f/sw77ubm1aeo0ALcAee3rjVlA== X-Google-Smtp-Source: ABdhPJzY7QPjWsZIj/vA9nDhdaRKKOROHjxfpx84FapuPcsPHWmyztXZIANm0BE/uYomX6u9smpZ8w== X-Received: by 2002:adf:e101:: with SMTP id t1mr48572848wrz.215.1626952776366; Thu, 22 Jul 2021 04:19:36 -0700 (PDT) Received: from localhost.localdomain (131.red-79-154-201.dynamicip.rima-tde.net. [79.154.201.131]) by smtp.gmail.com with ESMTPSA id r19sm31797045wrg.74.2021.07.22.04.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jul 2021 04:19:35 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, monstr@monstr.eu Cc: 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: [PATCH] arm64: zynqmp: Print the secure boot status information in EL3 Date: Thu, 22 Jul 2021 13:19:32 +0200 Message-Id: <20210722111932.5544-1-jorge@foundries.io> X-Mailer: git-send-email 2.31.1 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 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