xref: /aosp_15_r20/external/vboot_reference/futility/flash_helpers.h (revision 8617a60d3594060b7ecbd21bc622a7c14f3cf2bc)
1*8617a60dSAndroid Build Coastguard Worker /* Copyright 2023 The ChromiumOS Authors
2*8617a60dSAndroid Build Coastguard Worker  * Use of this source code is governed by a BSD-style license that can be
3*8617a60dSAndroid Build Coastguard Worker  * found in the LICENSE file.
4*8617a60dSAndroid Build Coastguard Worker  */
5*8617a60dSAndroid Build Coastguard Worker 
6*8617a60dSAndroid Build Coastguard Worker #ifndef VBOOT_REFERENCE_FLASH_HELPERS_H_
7*8617a60dSAndroid Build Coastguard Worker #define VBOOT_REFERENCE_FLASH_HELPERS_H_
8*8617a60dSAndroid Build Coastguard Worker 
9*8617a60dSAndroid Build Coastguard Worker #include "futility.h"
10*8617a60dSAndroid Build Coastguard Worker #include "updater.h"
11*8617a60dSAndroid Build Coastguard Worker 
12*8617a60dSAndroid Build Coastguard Worker /*
13*8617a60dSAndroid Build Coastguard Worker  * Prepare for flashrom interaction. Setup cfg from args and put servo into
14*8617a60dSAndroid Build Coastguard Worker  * flash mode if servo is in use. If this succeeds teardown_flash must be
15*8617a60dSAndroid Build Coastguard Worker  * called.
16*8617a60dSAndroid Build Coastguard Worker  */
17*8617a60dSAndroid Build Coastguard Worker int setup_flash(struct updater_config **cfg,
18*8617a60dSAndroid Build Coastguard Worker 		struct updater_config_arguments *args);
19*8617a60dSAndroid Build Coastguard Worker 
20*8617a60dSAndroid Build Coastguard Worker /* Cleanup objects created in setup_flash and release servo from flash mode. */
21*8617a60dSAndroid Build Coastguard Worker void teardown_flash(struct updater_config *cfg);
22*8617a60dSAndroid Build Coastguard Worker 
23*8617a60dSAndroid Build Coastguard Worker #endif /* VBOOT_REFERENCE_FLASH_HELPERS_H_ */
24