blob: 0d54f8fdd85d9421a891ac3bb330ae4ca9d16fe4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
/*
* 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);
/**
* This is a sanity check of GBB blob.
*
* @param gbb Buffer for holding GBB
* @return zero if the check passes, non-zero if the check fails
*/
int gbb_check_integrity(uint8_t *gbb);
#endif /* CHROMEOS_GBB_H_ */
|