blob: 51e3c0fecad5c7c9bc44a4d501dce027fdfa6f8f [file] [log] [blame]
Aaron Durbin6b0d0d62012-12-14 17:16:21 -06001/*
2 * Firmware Interface Table support.
3 *
4 * Copyright (C) 2012 Google Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
Patrick Georgib890a122015-03-26 15:17:45 +010017 * Foundation, Inc.
Aaron Durbin6b0d0d62012-12-14 17:16:21 -060018 */
19
20#ifndef __CBFSTOOL_FIT_H
21#define __CBFSTOOL_FIT_H
22
Sol Boucher32532ac2015-05-06 14:44:40 -070023#include "cbfs_image.h"
24#include "common.h"
25
26/*
27 * Converts between offsets from the start of the specified image region and
28 * "top-aligned" offsets from the top of the entire flash image. Should work in
29 * both directions: accepts either type of offset and produces the other type.
30 * The implementation must have some notion of the flash image's total size.
31 */
32typedef unsigned (*fit_offset_converter_t)(const struct buffer *region,
33 unsigned offset);
34
35int fit_update_table(struct buffer *bootblock, struct cbfs_image *image,
36 const char *microcode_blob_name, int empty_entries,
37 fit_offset_converter_t offset_fn);
Aaron Durbin6b0d0d62012-12-14 17:16:21 -060038#endif