blob: a3c2490c0d6e136adb2ef421b1e73662c5d92355 [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
Joel Kitching18b51b72019-05-10 12:33:08 +080034#define BOOT_DISPLAY_REQUEST 0x20
David Hendricks6fd35012015-01-02 15:16:41 -080035#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
Furquan Shaikh37c721d2018-04-25 18:13:03 -070043#define DEV_ENABLE_UDC 0x40
David Hendricks6fd35012015-01-02 15:16:41 -080044
Hung-Te Linfe2fc832016-12-29 20:59:37 +080045#define MISC_FLAGS_OFFSET 8
46#define MISC_FLAGS_BATTERY_CUTOFF_MASK 0x08
47
David Hendricks6fd35012015-01-02 15:16:41 -080048#define KERNEL_FIELD_OFFSET 11
49#define CRC_OFFSET 15
50
Furquan Shaikh2a12e2e2016-07-25 11:48:03 -070051#endif /* __VBOOT_VBNV_LAYOUT_H__ */