blob: 10f738636ff7afc52e832a60df49386fb00f1852 [file] [log] [blame]
Stefan Reinauer9aea04a2012-03-30 12:01:06 -07001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2011 The ChromiumOS Authors. All rights reserved.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070014 */
15
16#ifndef __VENDORCODE_GOOGLE_CHROMEOS_GNVS_H
17#define __VENDORCODE_GOOGLE_CHROMEOS_GNVS_H
18
19#define BOOT_REASON_OTHER 0
20#define BOOT_REASON_S3DIAG 9
21
22#define CHSW_RECOVERY_X86 (1 << 1)
23#define CHSW_RECOVERY_EC (1 << 2)
24#define CHSW_DEVELOPER_SWITCH (1 << 5)
25#define CHSW_FIRMWARE_WP_DIS (1 << 9)
26
27#define ACTIVE_MAINFW_RECOVERY 0
28#define ACTIVE_MAINFW_RW_A 1
29#define ACTIVE_MAINFW_RW_B 2
30
31#define ACTIVE_MAINFW_TYPE_RECOVERY 0
32#define ACTIVE_MAINFW_TYPE_NORMAL 1
33#define ACTIVE_MAINFW_TYPE_DEVELOPER 2
34
35#define RECOVERY_REASON_NONE 0
36#define RECOVERY_REASON_ME 1
37// TODO(reinauer) other recovery reasons?
38
39#define ACTIVE_ECFW_RO 0
40#define ACTIVE_ECFW_RW 1
41
42typedef struct {
43 /* ChromeOS specific */
44 u32 vbt0; // 00 boot reason
45 u32 vbt1; // 04 active main firmware
46 u32 vbt2; // 08 active ec firmware
47 u16 vbt3; // 0c CHSW
48 u8 vbt4[256]; // 0e HWID
49 u8 vbt5[64]; // 10e FWID
50 u8 vbt6[64]; // 14e FRID - 275
51 u32 vbt7; // 18e active main firmware type
52 u32 vbt8; // 192 recovery reason
53 u32 vbt9; // 196 fmap base address
54 u8 vdat[3072]; // 19a
55 u32 vbt10; // d9a smbios bios version
56 u32 mehh[8]; // d9e management engine hash
Aaron Durbin06ece7d2014-02-14 00:30:04 -060057 u32 ramoops_base; // dbe ramoops base address
58 u32 ramoops_len; // dc2 ramoops length
59 u8 pad[314]; // dc6-eff
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070060} __attribute__((packed)) chromeos_acpi_t;
61
62extern chromeos_acpi_t *vboot_data;
63void chromeos_init_vboot(chromeos_acpi_t *chromeos);
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070064void chromeos_set_me_hash(u32*, int);
Stefan Reinauer642b1db72013-04-18 18:01:34 -070065void acpi_get_vdat_info(uint64_t *vdat_addr, uint32_t *vdat_size);
Stefan Reinauer9aea04a2012-03-30 12:01:06 -070066
67#endif