blob: 1dc01c909a3044b7f1198a2087fdef2795d7d55d [file] [log] [blame]
David Hendricks6fd35012015-01-02 15:16:41 -08001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2015 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.
David Hendricks6fd35012015-01-02 15:16:41 -080014 */
15
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070016#ifndef __VBOOT_VBNV_LAYOUT_H__
17#define __VBOOT_VBNV_LAYOUT_H__
David Hendricks6fd35012015-01-02 15:16:41 -080018
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070019#define VBOOT_VBNV_BLOCK_SIZE 16 /* Size of NV storage block in bytes */
David Hendricks6fd35012015-01-02 15:16:41 -080020
21/* Constants for NV storage. We use this rather than structs and
22 * bitfields so the data format is consistent across platforms and
23 * compilers.
24 */
25#define HEADER_OFFSET 0
26#define HEADER_MASK 0xC0
27#define HEADER_SIGNATURE 0x40
28#define HEADER_FIRMWARE_SETTINGS_RESET 0x20
29#define HEADER_KERNEL_SETTINGS_RESET 0x10
30
31#define BOOT_OFFSET 1
32#define BOOT_DEBUG_RESET_MODE 0x80
33#define BOOT_DISABLE_DEV_REQUEST 0x40
34#define BOOT_OPROM_NEEDED 0x20
35#define BOOT_TRY_B_COUNT_MASK 0x0F
36
37#define RECOVERY_OFFSET 2
38#define LOCALIZATION_OFFSET 3
39
40#define DEV_FLAGS_OFFSET 4
41#define DEV_BOOT_USB_MASK 0x01
42#define DEV_BOOT_SIGNED_ONLY_MASK 0x02
43
Hung-Te Linfe2fc832016-12-29 20:59:37 +080044#define MISC_FLAGS_OFFSET 8
45#define MISC_FLAGS_BATTERY_CUTOFF_MASK 0x08
46
David Hendricks6fd35012015-01-02 15:16:41 -080047#define KERNEL_FIELD_OFFSET 11
48#define CRC_OFFSET 15
49
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070050#endif /* __VBOOT_VBNV_LAYOUT_H__ */