2012-12-15 00:16:21 +01:00
|
|
|
/*
|
|
|
|
* Firmware Interface Table support.
|
|
|
|
*
|
|
|
|
* Copyright (C) 2012 Google Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CBFSTOOL_FIT_H
|
|
|
|
#define __CBFSTOOL_FIT_H
|
|
|
|
|
2015-05-06 23:44:40 +02:00
|
|
|
#include "cbfs_image.h"
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Converts between offsets from the start of the specified image region and
|
|
|
|
* "top-aligned" offsets from the top of the entire flash image. Should work in
|
|
|
|
* both directions: accepts either type of offset and produces the other type.
|
|
|
|
* The implementation must have some notion of the flash image's total size.
|
|
|
|
*/
|
|
|
|
typedef unsigned (*fit_offset_converter_t)(const struct buffer *region,
|
|
|
|
unsigned offset);
|
|
|
|
|
2018-06-04 19:32:46 +02:00
|
|
|
/*
|
|
|
|
* populate FIT with the MCUs prepsent in the blob provided.
|
|
|
|
*
|
|
|
|
* first_mcu_addr is an address (in ROM) that will point to a
|
|
|
|
* microcode patch. When provided, it will be forced as the first
|
|
|
|
* MCU entry into the FIT located in the topswap bootblock.
|
|
|
|
*/
|
2015-05-06 23:44:40 +02:00
|
|
|
int fit_update_table(struct buffer *bootblock, struct cbfs_image *image,
|
2018-06-04 19:32:46 +02:00
|
|
|
const char *microcode_blob_name, int empty_entries,
|
|
|
|
fit_offset_converter_t offset_fn,
|
|
|
|
uint32_t topswap_size, uint32_t first_mcu_addr);
|
2012-12-15 00:16:21 +01:00
|
|
|
#endif
|