OLD | NEW |
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 * | 4 * |
5 * High-level firmware API for loading and verifying kernel. | 5 * High-level firmware API for loading and verifying kernel. |
6 * (Firmware Portion) | 6 * (Firmware Portion) |
7 */ | 7 */ |
8 | 8 |
9 #ifndef VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ | 9 #ifndef VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ |
10 #define VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ | 10 #define VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ |
11 | 11 |
12 #include "sysincludes.h" | 12 #include "sysincludes.h" |
13 | 13 |
14 /* Interface provided by verified boot library to BDS */ | 14 /* Interface provided by verified boot library to BDS */ |
15 | 15 |
16 /* Return codes for LoadKernel() */ | 16 /* Return codes for LoadKernel() */ |
17 #define LOAD_KERNEL_SUCCESS 0 /* Success; good kernel found on device */ | 17 #define LOAD_KERNEL_SUCCESS 0 /* Success; good kernel found on device */ |
18 #define LOAD_KERNEL_NOT_FOUND 1 /* No kernel found on device */ | 18 #define LOAD_KERNEL_NOT_FOUND 1 /* No kernel found on device */ |
19 #define LOAD_KERNEL_INVALID 2 /* Only invalid kernels found on device */ | 19 #define LOAD_KERNEL_INVALID 2 /* Only invalid kernels found on device */ |
20 #define LOAD_KERNEL_RECOVERY 3 /* Internal error; reboot to recovery mode */ | 20 #define LOAD_KERNEL_RECOVERY 3 /* Internal error; reboot to recovery mode */ |
21 #define LOAD_KERNEL_REBOOT 4 /* Internal error; reboot to current mode */ | 21 #define LOAD_KERNEL_REBOOT 4 /* Internal error; reboot to current mode */ |
22 | 22 |
23 | 23 |
24 /* Boot flags for LoadKernel().boot_flags */ | 24 /* Boot flags for LoadKernel().boot_flags */ |
25 #define BOOT_FLAG_DEVELOPER UINT64_C(0x01) /* Developer switch is on */ | 25 /* Developer switch is on */ |
26 #define BOOT_FLAG_RECOVERY UINT64_C(0x02) /* In recovery mode */ | 26 #define BOOT_FLAG_DEVELOPER UINT64_C(0x01) |
27 #define BOOT_FLAG_SKIP_ADDR_CHECK UINT64_C(0x04) /* Skip check of kernel | 27 /* In recovery mode */ |
28 * buffer address */ | 28 #define BOOT_FLAG_RECOVERY UINT64_C(0x02) |
| 29 /* Skip check of kernel buffer address */ |
| 30 #define BOOT_FLAG_SKIP_ADDR_CHECK UINT64_C(0x04) |
| 31 /* Active main firmware is developer-type, not normal-type or recovery-type. */ |
| 32 #define BOOT_FLAG_DEV_FIRMWARE UINT64_C(0x08) |
29 | 33 |
30 typedef struct LoadKernelParams { | 34 typedef struct LoadKernelParams { |
31 /* Inputs to LoadKernel() */ | 35 /* Inputs to LoadKernel() */ |
32 void *header_sign_key_blob; /* Key blob used to sign the kernel header */ | 36 void *header_sign_key_blob; /* Key blob used to sign the kernel header */ |
33 uint64_t bytes_per_lba; /* Bytes per lba sector on current device */ | 37 uint64_t bytes_per_lba; /* Bytes per lba sector on current device */ |
34 uint64_t ending_lba; /* Last addressable lba sector on current | 38 uint64_t ending_lba; /* Last addressable lba sector on current |
35 * device */ | 39 * device */ |
36 void *kernel_buffer; /* Destination buffer for kernel | 40 void *kernel_buffer; /* Destination buffer for kernel |
37 * (normally at 0x100000) */ | 41 * (normally at 0x100000) */ |
38 uint64_t kernel_buffer_size; /* Size of kernel buffer in bytes */ | 42 uint64_t kernel_buffer_size; /* Size of kernel buffer in bytes */ |
(...skipping 22 matching lines...) Expand all Loading... |
61 * LoadKernel() in | 65 * LoadKernel() in |
62 * LoadKernelParams.partition_number */ | 66 * LoadKernelParams.partition_number */ |
63 uint64_t original_address; /* Absolute bootloader start adddress, | 67 uint64_t original_address; /* Absolute bootloader start adddress, |
64 * as returned from LoadKernel() in | 68 * as returned from LoadKernel() in |
65 * LoadKernelParams.bootloader_start */ | 69 * LoadKernelParams.bootloader_start */ |
66 uint8_t partition_guid[16]; /* UniquePartitionGuid for boot partition */ | 70 uint8_t partition_guid[16]; /* UniquePartitionGuid for boot partition */ |
67 } KernelBootloaderOptions; | 71 } KernelBootloaderOptions; |
68 | 72 |
69 | 73 |
70 #endif /* VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ */ | 74 #endif /* VBOOT_REFERENCE_LOAD_KERNEL_FW_H_ */ |
OLD | NEW |