From patchwork Mon Sep 28 04:25:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1372323 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=PEXCxhJN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C08c767ZMz9sSn for ; Mon, 28 Sep 2020 14:26:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D4E3482383; Mon, 28 Sep 2020 06:26:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="PEXCxhJN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 5AFE782384; Mon, 28 Sep 2020 06:26:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-oi1-x242.google.com (mail-oi1-x242.google.com [IPv6:2607:f8b0:4864:20::242]) (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 765C382359 for ; Mon, 28 Sep 2020 06:26:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-oi1-x242.google.com with SMTP id w16so10245125oia.2 for ; Sun, 27 Sep 2020 21:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HQvsCAs3X2HzrhpSsWdNqiRj6spRSPhpbY8ofd1oOHQ=; b=PEXCxhJN6rr93zRzaTmGhqTnsdJ4GG4u0axQqmMpopsozb6rswbgPg87NhK7nTiE0M 1IDKhkGGwcABnpZHa4izXhoqKZaqSLb+OJ1msVohx0mrl3jniI6gs4+ZLLRIsA9GGyxD r0yUmhJBxCGNoQLtI2S8IXGvJY3GNT7YYoXRc= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=HQvsCAs3X2HzrhpSsWdNqiRj6spRSPhpbY8ofd1oOHQ=; b=AcKDyHX10r68YnkSE1AAenCXfopderVhyUTYqyhhRPbWYTkEsz0hhtBKU5PDexTCS7 YiJOYgBrPktrjlNaj+NsTMVrPQyFbqI1kC8ZTWn2gPtNri5e6SOACP4CMGGJ6f6Cx9Pu 61AN7gxkEGGry8ZbVxO3RX1mVvr5dGbuJUT+OJF+W9P9dGgFLJmTayYEPVtu8F/Fek8d vpLPLs7RqLtRpoU39aaxqTrr/MW/3qK3UiKNGsRKdf6aVz4MeL3AiYqQ3+8vEcoSXdjU Z1gUq8QK7iRRTlX6jaIMhM04J/3LKKLprh2ofbPVFF+DLcCbj08O4rqHPLcAQZtM7KA+ gAJQ== X-Gm-Message-State: AOAM530jlwPUZ/aPd6UyGLiWF0lu9RnfalETrL9+sU9CyjeqpBvdFz8I IuilBLdIm/Dhe8qwNBOB07aLsrjyjxXcjyXX X-Google-Smtp-Source: ABdhPJy3irlX5KRiPECZOVWXRkyxVwa8VgWDB1/PN25kNDvhnyPkO7uzgzA8Vibjf7xKbFXyANDN4A== X-Received: by 2002:a05:6808:245:: with SMTP id m5mr5091504oie.155.1601267180222; Sun, 27 Sep 2020 21:26:20 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k51sm2620579otc.46.2020.09.27.21.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Sep 2020 21:26:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH 03/32] x86: Add a layout for Chrome OS verified boot Date: Sun, 27 Sep 2020 22:25:42 -0600 Message-Id: <20200927222538.3.I7705f4557d04102288614f5c447395fdadebc36f@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200928042611.1696178-1-sjg@chromium.org> References: <20200928042611.1696178-1-sjg@chromium.org> MIME-Version: 1.0 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.102.3 at phobos.denx.de X-Virus-Status: Clean Add definitions for part of the vboot context used with verified boot. Signed-off-by: Simon Glass --- arch/x86/include/asm/acpi/vbnv_layout.h | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 arch/x86/include/asm/acpi/vbnv_layout.h diff --git a/arch/x86/include/asm/acpi/vbnv_layout.h b/arch/x86/include/asm/acpi/vbnv_layout.h new file mode 100644 index 00000000000..8bc4e9534ef --- /dev/null +++ b/arch/x86/include/asm/acpi/vbnv_layout.h @@ -0,0 +1,38 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright 2020 Google LLC + */ + +#ifndef __ASM_ACPI_VBNV_LAYOUT_H__ +#define __ASM_ACPI_VBNV_LAYOUT_H__ + +#define VBOOT_VBNV_BLOCK_SIZE 16 /* Size of NV storage block in bytes */ + +/* Constants for NV storage, for use with ACPI */ +#define HEADER_OFFSET 0 +#define HEADER_MASK 0xc0 +#define HEADER_SIGNATURE 0x40 +#define HEADER_FIRMWARE_SETTINGS_RESET 0x20 +#define HEADER_KERNEL_SETTINGS_RESET 0x10 + +#define BOOT_OFFSET 1 +#define BOOT_DEBUG_RESET_MODE 0x80 +#define BOOT_DISABLE_DEV_REQUEST 0x40 +#define BOOT_DISPLAY_REQUEST 0x20 +#define BOOT_TRY_B_COUNT_MASK 0x0f + +#define RECOVERY_OFFSET 2 +#define LOCALIZATION_OFFSET 3 + +#define DEV_FLAGS_OFFSET 4 +#define DEV_BOOT_USB_MASK 0x01 +#define DEV_BOOT_SIGNED_ONLY_MASK 0x02 +#define DEV_ENABLE_UDC 0x40 + +#define MISC_FLAGS_OFFSET 8 +#define MISC_FLAGS_BATTERY_CUTOFF_MASK 0x08 + +#define KERNEL_FIELD_OFFSET 11 +#define CRC_OFFSET 15 + +#endif /* __ASM_ACPI_VBNV_LAYOUT_H__ */