David Hendricks | 6fd3501 | 2015-01-02 15:16:41 -0800 | [diff] [blame] | 1 | /* |
| 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 Hendricks | 6fd3501 | 2015-01-02 15:16:41 -0800 | [diff] [blame] | 14 | */ |
| 15 | |
Furquan Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 16 | #ifndef __VBOOT_VBNV_LAYOUT_H__ |
| 17 | #define __VBOOT_VBNV_LAYOUT_H__ |
David Hendricks | 6fd3501 | 2015-01-02 15:16:41 -0800 | [diff] [blame] | 18 | |
Furquan Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 19 | #define VBOOT_VBNV_BLOCK_SIZE 16 /* Size of NV storage block in bytes */ |
David Hendricks | 6fd3501 | 2015-01-02 15:16:41 -0800 | [diff] [blame] | 20 | |
| 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 Lin | fe2fc83 | 2016-12-29 20:59:37 +0800 | [diff] [blame] | 44 | #define MISC_FLAGS_OFFSET 8 |
| 45 | #define MISC_FLAGS_BATTERY_CUTOFF_MASK 0x08 |
| 46 | |
David Hendricks | 6fd3501 | 2015-01-02 15:16:41 -0800 | [diff] [blame] | 47 | #define KERNEL_FIELD_OFFSET 11 |
| 48 | #define CRC_OFFSET 15 |
| 49 | |
Furquan Shaikh | 2a12e2e | 2016-07-25 11:48:03 -0700 | [diff] [blame] | 50 | #endif /* __VBOOT_VBNV_LAYOUT_H__ */ |