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