drivers/wifi: Remove unnecessary data structure copy
[coreboot2.git] / src / ec / lenovo / h8 / vboot.c
blobb5641533311727c7b28e84e237633ef0fcc69ae9
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <ec/acpi/ec.h>
4 #include <bootmode.h>
5 #include <timer.h>
6 #include <delay.h>
8 #include "h8.h"
10 /**
11 * HACK: Use Fn-Key as recovery mode switch.
12 * Wait for sense register ready and read Fn-Key state.
14 int get_recovery_mode_switch(void)
16 struct stopwatch sw;
18 if (!CONFIG(H8_FN_KEY_AS_VBOOT_RECOVERY_SW))
19 return 0;
21 /* Tests showed that it takes:
22 * - 700msec on Lenovo T500 from AC power on
23 * - less than 150msec on Lenovo T520 from AC power on
25 stopwatch_init_msecs_expire(&sw, 1000);
26 while (!stopwatch_expired(&sw) && !h8_get_sense_ready())
27 mdelay(1);
29 if (!h8_get_sense_ready())
30 return 0;
32 return h8_get_fn_key();
35 /**
36 * Only used if CONFIG(CHROMEOS) is set.
37 * Always zero as the #WP pin of the flash is tied high.
39 int get_write_protect_state(void)
41 return 0;