1 /* SPDX-License-Identifier: BSD-3-Clause */
3 /* Ported from mosys project (http://code.google.com/p/mosys/). */
5 #ifndef __LIB_VPD_TABLES_H__
6 #define __LIB_VPD_TABLES_H__
10 #define VPD_ENTRY_MAGIC "_SM_"
11 #define VPD_INFO_MAGIC \
12 "\xfe" /* type: VPD header */ \
13 "\x09" /* key length, 9 = 1 + 8 */ \
14 "\x01" /* info version, 1 */ \
15 "gVpdInfo" /* signature, 8 bytes */ \
16 "\x04" /* value length */
18 /* Google specific VPD info */
19 struct google_vpd_info
{
35 uint8_t anchor_string
[4];
42 uint8_t format_area
[5];
43 uint8_t inter_anchor_string
[5];
44 uint8_t inter_anchor_cksum
;
45 uint16_t table_length
;
46 uint32_t table_address
;
47 uint16_t table_entry_count
;
58 /* Type 0 - firmware information */
59 struct vpd_table_firmware
{
62 uint16_t start_address
;
64 uint8_t rom_size_64k_blocks
;
65 uint32_t characteristics
;
66 uint8_t extension
[2]; /* v2.4+ */
67 uint8_t major_ver
; /* v2.4+ */
68 uint8_t minor_ver
; /* v2.4+ */
69 uint8_t ec_major_ver
; /* v2.4+ */
70 uint8_t ec_minor_ver
; /* v2.4+ */
73 /* Type 1 - system information */
74 struct vpd_table_system
{
78 uint8_t serial_number
;
81 uint8_t sku_number
; /* v2.4+ */
82 uint8_t family
; /* v2.4+ */
85 /* Type 127 - end of table */
86 struct vpd_table_eot
{
87 struct vpd_header header
;
90 /* Type 241 - binary blob pointer */
91 struct vpd_table_binary_blob_pointer
{
92 uint8_t struct_major_version
;
93 uint8_t struct_minor_version
;
96 uint8_t major_version
;
97 uint8_t minor_version
;
105 /* The length and number of strings defined here is not a limitation of VPD.
106 * These numbers were deemed good enough during development. */
107 #define VPD_MAX_STRINGS 10
108 #define VPD_MAX_STRING_LENGTH 64
110 #endif /* __LIB_VPD_TABLES_H__ */