blob: c3bc304b38e1bb33ea7698c02ecafcec7bf0034c (
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
60
61
62
63
64
65
66
|
/*
* 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(read_buf_type gbb, firmware_storage_t *file, uint32_t gbb_offset);
#ifndef CONFIG_HARDWARE_MAPPED_SPI
/**
* 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(read_buf_type 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(read_buf_type gbb,
firmware_storage_t *file, uint32_t gbb_offset);
#else
#define gbb_read_bmp_block gbb_init
#define gbb_read_recovery_key gbb_init
#endif
/**
* 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_ */
|