blob: a222d19ee84c4220c9f536a0dc1e17ced5ab3843 [file] [log] [blame]
Jon Murphyc4e90452022-06-28 10:36:23 -06001/* Copyright 2020 The ChromiumOS Authors. All rights reserved.
Edward O'Callaghan774dcff2022-06-06 20:01:04 +10002 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 *
5 * Host utilities to execute flashrom command.
6 */
7
8#include <stdint.h>
9#include "common.h" /* from cbfstool for buffer API. */
10
11/**
12 * Read using flashrom into an allocated buffer.
13 *
14 * @param buffer The parameter that contains the buffer to use
15 * in the read operation.
16 * @param region The name of the fmap region to read, or NULL to
17 * read the entire flash chip.
18 *
19 * @return 0 on success, or < 0 on error.
20 */
21int flashrom_host_read(struct buffer *buffer, const char *region);
22
23/**
24 * Write using flashrom from a buffer.
25 *
26 * @param buffer The parameter that contains the buffer to use
27 * in the write operation.
28 * @param regions The name of the fmap region to write, or NULL to
29 * write the entire flash chip.
30 *
31 * @return 0 on success, or < 0 on error.
32 */
33int flashrom_host_write(struct buffer *buffer, const char *region);