summaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/gnvs.h
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-03-30 12:01:06 -0700
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-04-02 18:39:31 +0200
commit9aea04aa892903009e487ada7f7b911691e68630 (patch)
treed2b05dcdedc59fe6a912c527f6b5ef98453e4250 /src/vendorcode/google/chromeos/gnvs.h
parentc302d20ed3f67f863e02dce51aeef8aa90ef2742 (diff)
downloadcoreboot-9aea04aa892903009e487ada7f7b911691e68630.tar.xz
Add Google ChromeOS vendor support
Google's ChromeOS can be booted super fast and safely using coreboot. This adds the ChromeOS specific code that is required by all ChromeBooks to do this. Change-Id: Ic03ff090a569a27acbd798ce1e5f89a34897a2f2 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/817 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/vendorcode/google/chromeos/gnvs.h')
-rw-r--r--src/vendorcode/google/chromeos/gnvs.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/gnvs.h b/src/vendorcode/google/chromeos/gnvs.h
new file mode 100644
index 0000000000..36922baac8
--- /dev/null
+++ b/src/vendorcode/google/chromeos/gnvs.h
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __VENDORCODE_GOOGLE_CHROMEOS_GNVS_H
+#define __VENDORCODE_GOOGLE_CHROMEOS_GNVS_H
+
+#define BOOT_REASON_OTHER 0
+#define BOOT_REASON_S3DIAG 9
+
+#define CHSW_RECOVERY_X86 (1 << 1)
+#define CHSW_RECOVERY_EC (1 << 2)
+#define CHSW_DEVELOPER_SWITCH (1 << 5)
+#define CHSW_FIRMWARE_WP_DIS (1 << 9)
+
+#define ACTIVE_MAINFW_RECOVERY 0
+#define ACTIVE_MAINFW_RW_A 1
+#define ACTIVE_MAINFW_RW_B 2
+
+#define ACTIVE_MAINFW_TYPE_RECOVERY 0
+#define ACTIVE_MAINFW_TYPE_NORMAL 1
+#define ACTIVE_MAINFW_TYPE_DEVELOPER 2
+
+#define RECOVERY_REASON_NONE 0
+#define RECOVERY_REASON_ME 1
+// TODO(reinauer) other recovery reasons?
+
+#define ACTIVE_ECFW_RO 0
+#define ACTIVE_ECFW_RW 1
+
+typedef struct {
+ /* ChromeOS specific */
+ u32 vbt0; // 00 boot reason
+ u32 vbt1; // 04 active main firmware
+ u32 vbt2; // 08 active ec firmware
+ u16 vbt3; // 0c CHSW
+ u8 vbt4[256]; // 0e HWID
+ u8 vbt5[64]; // 10e FWID
+ u8 vbt6[64]; // 14e FRID - 275
+ u32 vbt7; // 18e active main firmware type
+ u32 vbt8; // 192 recovery reason
+ u32 vbt9; // 196 fmap base address
+ u8 vdat[3072]; // 19a
+ u32 vbt10; // d9a smbios bios version
+ u32 mehh[8]; // d9e management engine hash
+ // dbe
+} __attribute__((packed)) chromeos_acpi_t;
+
+extern chromeos_acpi_t *vboot_data;
+void chromeos_init_vboot(chromeos_acpi_t *chromeos);
+void chromeos_set_vboot_data_ptr(void *);
+void chromeos_set_me_hash(u32*, int);
+
+#endif