coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec_sync.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <assert.h>
4 #include <cbfs.h>
5 #include <console/console.h>
6 #include <delay.h>
8 #include <halt.h>
9 #include <security/vboot/misc.h>
10 #include <security/vboot/vbnv.h>
12 #include <timer.h>
13 #include <timestamp.h>
14 #include <vb2_api.h>
15 
16 #define _EC_FILENAME(select, suffix) \
17  (select == VB_SELECT_FIRMWARE_READONLY ? "ecro" suffix : "ecrw" suffix)
18 #define EC_IMAGE_FILENAME(select) _EC_FILENAME(select, "")
19 #define EC_HASH_FILENAME(select) _EC_FILENAME(select, ".hash")
20 
21 /* Wait 10 ms between attempts to check if EC's hash is ready */
22 #define CROS_EC_HASH_CHECK_DELAY_MS 10
23 /* Give the EC 2 seconds to finish calculating its hash */
24 #define CROS_EC_HASH_TIMEOUT_MS 2000
25 
26 /* Wait 3 seconds after software sync for EC to clear the limit power flag. */
27 #define LIMIT_POWER_WAIT_TIMEOUT_MS 3000
28 /* Check the limit power flag every 10 ms while waiting. */
29 #define LIMIT_POWER_POLL_SLEEP_MS 10
30 
31 /* Wait 3 seconds for EC to sysjump to RW */
32 #define CROS_EC_SYSJUMP_TIMEOUT_MS 3000
33 
34 /*
35  * The external API for EC software sync. This function calls into
36  * vboot, which kicks off the process. Vboot runs the verified boot
37  * logic, and requires the client program to provide callbacks which
38  * perform the work.
39  */
40 void vboot_sync_ec(void)
41 {
42  vb2_error_t retval = VB2_SUCCESS;
43  struct vb2_context *ctx;
44 
46 
47  ctx = vboot_get_context();
48  ctx->flags |= VB2_CONTEXT_EC_SYNC_SUPPORTED;
49 
50  retval = vb2api_ec_sync(ctx);
51  vboot_save_data(ctx);
52 
53  switch (retval) {
54  case VB2_SUCCESS:
55  break;
56 
57  case VB2_REQUEST_REBOOT_EC_TO_RO:
58  printk(BIOS_INFO, "EC Reboot requested. Doing cold reboot\n");
60  printk(BIOS_EMERG, "Failed to get EC to cold reboot\n");
61 
62  halt();
63  break;
64 
65  /* Only for EC-EFS */
66  case VB2_REQUEST_REBOOT_EC_SWITCH_RW:
67  printk(BIOS_INFO, "Switch EC slot requested. Doing cold reboot\n");
70  printk(BIOS_EMERG, "Failed to get EC to cold reboot\n");
71 
72  halt();
73  break;
74 
75  case VB2_REQUEST_REBOOT:
76  printk(BIOS_INFO, "Reboot requested. Doing warm reboot\n");
77  vboot_reboot();
78  break;
79 
80  default:
81  printk(BIOS_ERR, "EC software sync failed (%#x),"
82  " rebooting\n", retval);
83  vboot_reboot();
84  break;
85  }
86 
88 }
89 
90 /* Convert firmware image type into a flash offset */
91 static uint32_t get_vboot_hash_offset(enum vb2_firmware_selection select)
92 {
93  switch (select) {
94  case VB_SELECT_FIRMWARE_READONLY:
96  case VB_SELECT_FIRMWARE_EC_UPDATE:
98  default:
100  }
101 }
102 
103 /*
104  * Asks the EC to calculate a hash of the specified firmware image, and
105  * returns the information in **hash and *hash_size.
106  */
107 static vb2_error_t ec_hash_image(enum vb2_firmware_selection select,
108  const uint8_t **hash, int *hash_size)
109 {
110  static struct ec_response_vboot_hash resp;
111  uint32_t hash_offset;
112  int recalc_requested = 0;
113  struct stopwatch sw;
114 
115  hash_offset = get_vboot_hash_offset(select);
116 
118  do {
119  if (google_chromeec_get_vboot_hash(hash_offset, &resp))
120  return VB2_ERROR_UNKNOWN;
121 
122  switch (resp.status) {
124  /*
125  * There is no hash available right now.
126  * Request a recalc if it hasn't been done yet.
127  */
128  if (recalc_requested)
129  break;
130 
132  "%s: No valid hash (status=%d size=%d). "
133  "Computing...\n", __func__, resp.status,
134  resp.size);
135 
137  EC_VBOOT_HASH_TYPE_SHA256, hash_offset, &resp))
138  return VB2_ERROR_UNKNOWN;
139 
140  recalc_requested = 1;
141 
142  /*
143  * Expect status to be busy since we just sent
144  * a recalc request.
145  */
147 
148  /* Hash just started calculating, let it go for a bit */
150  break;
151 
153  /* Hash is still calculating. */
155  break;
156 
157  case EC_VBOOT_HASH_STATUS_DONE: /* intentional fallthrough */
158  default:
159  /* Hash is ready! */
160  break;
161  }
162  } while (resp.status == EC_VBOOT_HASH_STATUS_BUSY &&
163  !stopwatch_expired(&sw));
164 
166 
167  if (resp.status != EC_VBOOT_HASH_STATUS_DONE) {
168  printk(BIOS_ERR, "%s: Hash status not done: %d\n", __func__,
169  resp.status);
170  return VB2_ERROR_UNKNOWN;
171  }
172  if (resp.hash_type != EC_VBOOT_HASH_TYPE_SHA256) {
173  printk(BIOS_ERR, "EC hash was the wrong type.\n");
174  return VB2_ERROR_UNKNOWN;
175  }
176 
177  printk(BIOS_INFO, "EC took %luus to calculate image hash\n",
179 
180  *hash = resp.hash_digest;
181  *hash_size = resp.digest_size;
182 
183  return VB2_SUCCESS;
184 }
185 
186 /*
187  * Asks the EC to protect or unprotect the specified flash region.
188  */
189 static vb2_error_t ec_protect_flash(enum vb2_firmware_selection select, int enable)
190 {
191  struct ec_response_flash_protect resp;
192  uint32_t protected_region = EC_FLASH_PROTECT_ALL_NOW;
194 
195  if (select == VB_SELECT_FIRMWARE_READONLY)
196  protected_region = EC_FLASH_PROTECT_RO_NOW;
197 
198  if (google_chromeec_flash_protect(mask, enable ? mask : 0, &resp) != 0)
199  return VB2_ERROR_UNKNOWN;
200 
201  if (!enable) {
202  /* If protection is still enabled, need reboot */
203  if (resp.flags & protected_region)
204  return VB2_REQUEST_REBOOT_EC_TO_RO;
205 
206  return VB2_SUCCESS;
207  }
208 
209  /*
210  * If write protect and ro-at-boot aren't both asserted, don't expect
211  * protection enabled.
212  */
213  if ((~resp.flags) & (EC_FLASH_PROTECT_GPIO_ASSERTED |
215  return VB2_SUCCESS;
216 
217  /* If flash is protected now, success */
218  if (resp.flags & EC_FLASH_PROTECT_ALL_NOW)
219  return VB2_SUCCESS;
220 
221  /* If RW will be protected at boot but not now, need a reboot */
223  return VB2_REQUEST_REBOOT_EC_TO_RO;
224 
225  /* Otherwise, it's an error */
226  return VB2_ERROR_UNKNOWN;
227 }
228 
229 /* Convert a firmware image type to an EC flash region */
230 static enum ec_flash_region vboot_to_ec_region(enum vb2_firmware_selection select)
231 {
232  switch (select) {
233  case VB_SELECT_FIRMWARE_READONLY:
234  return EC_FLASH_REGION_WP_RO;
235  case VB_SELECT_FIRMWARE_EC_UPDATE:
236  return EC_FLASH_REGION_UPDATE;
237  default:
238  return EC_FLASH_REGION_ACTIVE;
239  }
240 }
241 
242 /*
243  * Send an image to the EC in burst-sized chunks.
244  */
245 static vb2_error_t ec_flash_write(void *image, uint32_t region_offset,
246  int image_size)
247 {
248  struct ec_response_get_protocol_info resp_proto;
249  struct ec_response_flash_info resp_flash;
250  ssize_t pdata_max_size;
251  ssize_t burst;
252  uint8_t *file_buf;
254  uint32_t end, off;
255 
256  /*
257  * Get EC's protocol information, so that we can figure out how much
258  * data can be sent in one message.
259  */
260  if (google_chromeec_get_protocol_info(&resp_proto)) {
261  printk(BIOS_ERR, "Failed to get EC protocol information; "
262  "skipping flash write\n");
263  return VB2_ERROR_UNKNOWN;
264  }
265 
266  /*
267  * Determine burst size. This must be a multiple of the write block
268  * size, and must also fit into the host parameter buffer.
269  */
270  if (google_chromeec_flash_info(&resp_flash)) {
271  printk(BIOS_ERR, "Failed to get EC flash information; "
272  "skipping flash write\n");
273  return VB2_ERROR_UNKNOWN;
274  }
275 
276  /* Limit the potential buffer stack allocation to 1K */
277  pdata_max_size = MIN(1024, resp_proto.max_request_packet_size -
278  sizeof(struct ec_host_request));
279 
280  /* Round burst to a multiple of the flash write block size */
281  burst = pdata_max_size - sizeof(*params);
282  burst = (burst / resp_flash.write_block_size) *
283  resp_flash.write_block_size;
284 
285  /* Buffer too small */
286  if (burst <= 0) {
287  printk(BIOS_ERR, "Flash write buffer too small! skipping "
288  "flash write\n");
289  return VB2_ERROR_UNKNOWN;
290  }
291 
292  /* Allocate buffer on the stack */
293  params = alloca(burst + sizeof(*params));
294 
295  /* Fill up the buffer */
296  end = region_offset + image_size;
297  file_buf = image;
298  for (off = region_offset; off < end; off += burst) {
299  uint32_t todo = MIN(end - off, burst);
300  uint32_t xfer_size = todo + sizeof(*params);
301 
302  params->offset = off;
303  params->size = todo;
304 
305  /* Read todo bytes into the buffer */
306  memcpy(params + 1, file_buf, todo);
307 
308  /* Make sure to add back in the size of the parameters */
310  (const uint8_t *)params, xfer_size)) {
311  printk(BIOS_ERR, "EC failed flash write command, "
312  "relative offset %u!\n", off - region_offset);
313  return VB2_ERROR_UNKNOWN;
314  }
315 
316  file_buf += todo;
317  }
318 
319  return VB2_SUCCESS;
320 }
321 
322 /*
323  * The logic for updating an EC firmware image.
324  */
325 static vb2_error_t ec_update_image(enum vb2_firmware_selection select)
326 {
327  uint32_t region_offset, region_size;
328  enum ec_flash_region region;
329  vb2_error_t rv;
330  void *image;
331  size_t image_size;
332 
333  /* Un-protect the flash region */
334  rv = ec_protect_flash(select, 0);
335  if (rv != VB2_SUCCESS)
336  return rv;
337 
338  /* Convert vboot region into an EC region */
339  region = vboot_to_ec_region(select);
340 
341  /* Get information about the flash region */
343  &region_size))
344  return VB2_ERROR_UNKNOWN;
345 
346  /* Map the CBFS file */
347  image = cbfs_map(EC_IMAGE_FILENAME(select), &image_size);
348  if (!image)
349  return VB2_ERROR_UNKNOWN;
350 
351  rv = VB2_ERROR_UNKNOWN;
352 
353  /* Bail if the image is too large */
354  if (image_size > region_size)
355  goto unmap;
356 
357  /* Erase the region */
358  if (google_chromeec_flash_erase(region_offset, region_size))
359  goto unmap;
360 
361  /* Write the image into the region */
362  if (ec_flash_write(image, region_offset, image_size))
363  goto unmap;
364 
365  /* Verify the image */
367  goto unmap;
368 
369  rv = VB2_SUCCESS;
370 
371 unmap:
372  cbfs_unmap(image);
373  return rv;
374 }
375 
376 static vb2_error_t ec_get_expected_hash(enum vb2_firmware_selection select,
377  const uint8_t **hash,
378  int *hash_size)
379 {
380  size_t size;
381  const char *filename = EC_HASH_FILENAME(select);
382 
383  /* vboot has no API to return this memory, so must permanently leak a mapping here. */
384  const uint8_t *file = cbfs_map(filename, &size);
385 
386  if (file == NULL)
387  return VB2_ERROR_UNKNOWN;
388 
389  *hash = file;
390  *hash_size = (int)size;
391 
392  return VB2_SUCCESS;
393 }
394 
395 /***********************************************************************
396  * Vboot Callbacks
397  ***********************************************************************/
398 
399 /*
400  * Write opaque data into NV storage region.
401  */
402 vb2_error_t vb2ex_commit_data(struct vb2_context *ctx)
403 {
404  save_vbnv(ctx->nvdata);
405  return VB2_SUCCESS;
406 }
407 
408 /*
409  * Report whether the EC is in RW or not.
410  */
411 vb2_error_t vb2ex_ec_running_rw(int *in_rw)
412 {
413  *in_rw = !google_ec_running_ro();
414  return VB2_SUCCESS;
415 }
416 
417 /*
418  * Callback for when Vboot is finished.
419  */
420 vb2_error_t vb2ex_ec_vboot_done(struct vb2_context *ctx)
421 {
422  int limit_power = 0;
423  bool message_printed = false;
424  struct stopwatch sw;
425  int in_recovery = !!(ctx->flags & VB2_CONTEXT_RECOVERY_MODE);
426 
427  /*
428  * Do not wait for the limit power flag to be cleared in
429  * recovery mode since we didn't just sysjump.
430  */
431  if (in_recovery)
432  return VB2_SUCCESS;
433 
435 
437 
438  /* Ensure we have enough power to continue booting. */
439  while (1) {
440  if (google_chromeec_read_limit_power_request(&limit_power)) {
441  printk(BIOS_ERR, "Failed to check EC limit power"
442  "flag.\n");
443  return VB2_ERROR_UNKNOWN;
444  }
445 
446  if (!limit_power || stopwatch_expired(&sw))
447  break;
448 
449  if (!message_printed) {
451  "Waiting for EC to clear limit power flag.\n");
452  message_printed = true;
453  }
454 
456  }
457 
458  if (limit_power) {
460  "EC requests limited power usage. Request shutdown.\n");
461  return VB2_REQUEST_SHUTDOWN;
462  } else {
463  printk(BIOS_INFO, "Waited %luus to clear limit power flag.\n",
465  }
466 
467  return VB2_SUCCESS;
468 }
469 
470 /*
471  * Support battery cutoff if required.
472  */
473 vb2_error_t vb2ex_ec_battery_cutoff(void)
474 {
476  return VB2_ERROR_UNKNOWN;
477 
478  return VB2_SUCCESS;
479 }
480 
481 /*
482  * Vboot callback for calculating an EC image's hash.
483  */
484 vb2_error_t vb2ex_ec_hash_image(enum vb2_firmware_selection select,
485  const uint8_t **hash, int *hash_size)
486 {
487  return ec_hash_image(select, hash, hash_size);
488 }
489 
490 /*
491  * Vboot callback for EC flash protection.
492  */
493 vb2_error_t vb2ex_ec_protect(enum vb2_firmware_selection select)
494 {
495  return ec_protect_flash(select, 1);
496 }
497 
498 /*
499  * Get hash for image.
500  */
501 vb2_error_t vb2ex_ec_get_expected_image_hash(enum vb2_firmware_selection select,
502  const uint8_t **hash,
503  int *hash_size)
504 {
505  return ec_get_expected_hash(select, hash, hash_size);
506 }
507 
508 /*
509  * Disable further sysjumps (i.e., stay in RW until next reboot)
510  */
511 vb2_error_t vb2ex_ec_disable_jump(void)
512 {
514  return VB2_ERROR_UNKNOWN;
515 
516  return VB2_SUCCESS;
517 }
518 
519 /*
520  * Update EC image.
521  */
522 vb2_error_t vb2ex_ec_update_image(enum vb2_firmware_selection select)
523 {
524  return ec_update_image(select);
525 }
526 
527 /*
528  * Vboot callback for commanding EC to sysjump to RW.
529  */
530 vb2_error_t vb2ex_ec_jump_to_rw(void)
531 {
532  struct stopwatch sw;
533 
535  return VB2_ERROR_UNKNOWN;
536 
537  /* Give the EC 3 seconds to sysjump */
539 
540  /* Default delay to wait after EC reboot */
541  mdelay(50);
542  while (google_chromeec_hello()) {
543  if (stopwatch_expired(&sw)) {
544  printk(BIOS_ERR, "EC did not return from reboot after %luus\n",
546  return VB2_ERROR_UNKNOWN;
547  }
548 
549  mdelay(5);
550  }
551 
552  printk(BIOS_INFO, "\nEC returned from reboot after %luus\n",
554 
555  return VB2_SUCCESS;
556 }
void * memcpy(void *dest, const void *src, size_t n)
Definition: memcpy.c:7
static struct sdram_info params
Definition: sdram_configs.c:83
#define MIN(a, b)
Definition: helpers.h:37
void cbfs_unmap(void *mapping)
Definition: cbfs.c:86
static void * cbfs_map(const char *name, size_t *size_out)
Definition: cbfs.h:246
#define printk(level,...)
Definition: stdlib.h:16
void mdelay(unsigned int msecs)
Definition: delay.c:2
int google_chromeec_flash_erase(uint32_t offset, uint32_t size)
Erase a region of EC flash.
Definition: ec.c:587
int google_chromeec_get_vboot_hash(uint32_t offset, struct ec_response_vboot_hash *resp)
Return the EC's vboot image hash.
Definition: ec.c:487
int google_chromeec_get_protocol_info(struct ec_response_get_protocol_info *resp)
Get information about the protocol that the EC speaks.
Definition: ec.c:734
int google_chromeec_flash_info(struct ec_response_flash_info *info)
Return information about the entire flash.
Definition: ec.c:609
int google_chromeec_hello(void)
Performs light verification of the EC<->AP communication channel.
Definition: ec.c:1236
int google_chromeec_flash_region_info(enum ec_flash_region region, uint32_t *offset, uint32_t *size)
Get offset and size of the specified EC flash region.
Definition: ec.c:559
int google_chromeec_reboot(int dev_idx, enum ec_reboot_cmd type, uint8_t flags)
Definition: ec.c:794
int google_chromeec_read_limit_power_request(int *limit_power)
Check if the EC is requesting the system to limit input power.
Definition: ec.c:700
int google_chromeec_flash_protect(uint32_t mask, uint32_t flags, struct ec_response_flash_protect *resp)
Protect/un-protect EC flash regions.
Definition: ec.c:536
int google_chromeec_flash_write_block(const uint8_t *params_data, uint32_t bufsize)
Write a block into EC flash.
Definition: ec.c:632
int google_ec_running_ro(void)
Definition: ec.c:1475
int google_chromeec_start_vboot_hash(enum ec_vboot_hash_type hash_type, uint32_t hash_offset, struct ec_response_vboot_hash *resp)
Calculate image hash for vboot.
Definition: ec.c:510
int google_chromeec_battery_cutoff(uint8_t flags)
Command EC to perform battery cutoff.
Definition: ec.c:679
int google_chromeec_efs_verify(enum ec_flash_region region)
Verify flash using EFS if available.
Definition: ec.c:653
@ EC_VBOOT_HASH_STATUS_DONE
Definition: ec_commands.h:2501
@ EC_VBOOT_HASH_STATUS_NONE
Definition: ec_commands.h:2500
@ EC_VBOOT_HASH_STATUS_BUSY
Definition: ec_commands.h:2502
ec_flash_region
Definition: ec_commands.h:1812
@ EC_FLASH_REGION_WP_RO
Definition: ec_commands.h:1829
@ EC_FLASH_REGION_UPDATE
Definition: ec_commands.h:1831
@ EC_FLASH_REGION_ACTIVE
Definition: ec_commands.h:1824
#define EC_FLASH_PROTECT_GPIO_ASSERTED
Definition: ec_commands.h:1755
#define EC_FLASH_PROTECT_ALL_AT_BOOT
Definition: ec_commands.h:1765
@ EC_REBOOT_DISABLE_JUMP
Definition: ec_commands.h:5373
@ EC_REBOOT_JUMP_RW
Definition: ec_commands.h:5370
@ EC_REBOOT_COLD
Definition: ec_commands.h:5372
#define EC_FLASH_PROTECT_RO_NOW
Definition: ec_commands.h:1751
#define EC_VBOOT_HASH_OFFSET_UPDATE
Definition: ec_commands.h:2512
#define EC_VBOOT_HASH_OFFSET_ACTIVE
Definition: ec_commands.h:2511
#define EC_FLASH_PROTECT_RO_AT_BOOT
Definition: ec_commands.h:1746
#define EC_BATTERY_CUTOFF_FLAG_AT_SHUTDOWN
Definition: ec_commands.h:4385
@ EC_VBOOT_HASH_TYPE_SHA256
Definition: ec_commands.h:2496
#define EC_FLASH_PROTECT_ALL_NOW
Definition: ec_commands.h:1753
#define EC_REBOOT_FLAG_SWITCH_RW_SLOT
Definition: ec_commands.h:5382
#define EC_VBOOT_HASH_OFFSET_RO
Definition: ec_commands.h:2510
#define CROS_EC_HASH_TIMEOUT_MS
Definition: ec_sync.c:24
#define LIMIT_POWER_POLL_SLEEP_MS
Definition: ec_sync.c:29
#define LIMIT_POWER_WAIT_TIMEOUT_MS
Definition: ec_sync.c:27
vb2_error_t vb2ex_commit_data(struct vb2_context *ctx)
Definition: ec_sync.c:402
vb2_error_t vb2ex_ec_jump_to_rw(void)
Definition: ec_sync.c:530
#define EC_HASH_FILENAME(select)
Definition: ec_sync.c:19
static vb2_error_t ec_update_image(enum vb2_firmware_selection select)
Definition: ec_sync.c:325
vb2_error_t vb2ex_ec_running_rw(int *in_rw)
Definition: ec_sync.c:411
static vb2_error_t ec_protect_flash(enum vb2_firmware_selection select, int enable)
Definition: ec_sync.c:189
vb2_error_t vb2ex_ec_hash_image(enum vb2_firmware_selection select, const uint8_t **hash, int *hash_size)
Definition: ec_sync.c:484
vb2_error_t vb2ex_ec_protect(enum vb2_firmware_selection select)
Definition: ec_sync.c:493
vb2_error_t vb2ex_ec_disable_jump(void)
Definition: ec_sync.c:511
vb2_error_t vb2ex_ec_update_image(enum vb2_firmware_selection select)
Definition: ec_sync.c:522
static vb2_error_t ec_hash_image(enum vb2_firmware_selection select, const uint8_t **hash, int *hash_size)
Definition: ec_sync.c:107
static vb2_error_t ec_flash_write(void *image, uint32_t region_offset, int image_size)
Definition: ec_sync.c:245
vb2_error_t vb2ex_ec_get_expected_image_hash(enum vb2_firmware_selection select, const uint8_t **hash, int *hash_size)
Definition: ec_sync.c:501
void vboot_sync_ec(void)
Definition: ec_sync.c:40
vb2_error_t vb2ex_ec_vboot_done(struct vb2_context *ctx)
Definition: ec_sync.c:420
static enum ec_flash_region vboot_to_ec_region(enum vb2_firmware_selection select)
Definition: ec_sync.c:230
#define CROS_EC_HASH_CHECK_DELAY_MS
Definition: ec_sync.c:22
#define CROS_EC_SYSJUMP_TIMEOUT_MS
Definition: ec_sync.c:32
static uint32_t get_vboot_hash_offset(enum vb2_firmware_selection select)
Definition: ec_sync.c:91
#define EC_IMAGE_FILENAME(select)
Definition: ec_sync.c:18
static vb2_error_t ec_get_expected_hash(enum vb2_firmware_selection select, const uint8_t **hash, int *hash_size)
Definition: ec_sync.c:376
vb2_error_t vb2ex_ec_battery_cutoff(void)
Definition: ec_sync.c:473
void __noreturn halt(void)
halt the system reliably
Definition: halt.c:6
#define alloca(x)
Definition: helpers.h:42
static int stopwatch_expired(struct stopwatch *sw)
Definition: timer.h:152
static void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms)
Definition: timer.h:133
static long stopwatch_duration_usecs(struct stopwatch *sw)
Definition: timer.h:170
void timestamp_add_now(enum timestamp_id id)
Definition: timestamp.c:141
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
#define BIOS_EMERG
BIOS_EMERG - Emergency / Fatal.
Definition: loglevel.h:25
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
Definition: loglevel.h:72
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
Definition: loglevel.h:142
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
Definition: loglevel.h:86
static size_t region_offset(const struct region *r)
Definition: region.h:105
struct vb2_context * vboot_get_context(void)
Definition: common.c:28
static const int mask[4]
Definition: gpio.c:308
#define NULL
Definition: stddef.h:19
__SIZE_TYPE__ ssize_t
Definition: stddef.h:13
unsigned int uint32_t
Definition: stdint.h:14
unsigned char uint8_t
Definition: stdint.h:8
struct ec_host_request - Version 3 request from host.
Definition: ec_commands.h:917
struct ec_params_flash_write - Parameters for the flash write command.
Definition: ec_commands.h:1675
struct ec_response_flash_info - Response to the flash info command.
Definition: ec_commands.h:1547
struct ec_response_flash_protect - Response to the flash protect command.
Definition: ec_commands.h:1797
struct ec_response_get_protocol_info - Response to the get protocol info.
Definition: ec_commands.h:1341
Definition: gcov-glue.c:7
Definition: region.h:76
@ TS_EC_SYNC_END
@ TS_EC_POWER_LIMIT_WAIT
@ TS_EC_HASH_READY
@ TS_EC_SYNC_START
void save_vbnv(const uint8_t *vbnv_copy)
Definition: vbnv.c:78
void vboot_save_data(struct vb2_context *ctx)
Definition: vboot_common.c:12
void vboot_reboot(void)
Definition: vboot_common.c:60