diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2011-07-26 22:10:16 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:13 -0700 |
commit | d62fd066dbf5af9d6f44ce1d2f7e75f563b4fa9a (patch) | |
tree | a9f554080cf2d03d9417685de61e4f1b62e7612e /include/chromeos | |
parent | 2ac50b8b2d5e25f839e883be37671433c9f005cc (diff) |
CHROMIUM: factor out gbb loader functions
This patch also eliminates duplications of decoding fmap from the
device tree.
BUG=chromium-os:16542
TEST=make chromeos_seaboard_vboot_config && make
Change-Id: I0af75335be10823b8644c94f6fc9aac0304a2633
Reviewed-on: http://gerrit.chromium.org/gerrit/4745
Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Diffstat (limited to 'include/chromeos')
-rw-r--r-- | include/chromeos/gbb.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/chromeos/gbb.h b/include/chromeos/gbb.h new file mode 100644 index 0000000000..64fecd7f04 --- /dev/null +++ b/include/chromeos/gbb.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2011 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + */ + +#ifndef CHROMEOS_GBB_H_ +#define CHROMEOS_GBB_H_ + +#include <chromeos/firmware_storage.h> + +/** + * This loads the basic parts of GBB from flashrom. These include: + * - GBB header + * - hardware id + * - rootkey for verifying readwrite firmware + * + * @param gbb Buffer for holding GBB + * @param file Flashrom device handle + * @param gbb_offset Offset of GBB in flashrom device + * @return zero if this succeeds, non-zero if this fails + */ +int gbb_init(void *gbb, firmware_storage_t *file, uint32_t gbb_offset); + +/** + * This loads the BMP block of GBB from flashrom. + * + * @param gbb Buffer for holding GBB + * @param file Flashrom device handle + * @param gbb_offset Offset of GBB in flashrom device + * @return zero if this succeeds, non-zero if this fails + */ +int gbb_read_bmp_block(void *gbb, + firmware_storage_t *file, uint32_t gbb_offset); + +/* + * This loads the recovery key of GBB from flashrom. + * + * @param gbb Buffer for holding GBB + * @param file Flashrom device handle + * @param gbb_offset Offset of GBB in flashrom device + * @return zero if this succeeds, non-zero if this fails + */ +int gbb_read_recovery_key(void *gbb, + firmware_storage_t *file, uint32_t gbb_offset); + +#endif /* CHROMEOS_GBB_H_ */ |