Debian Codegraph @

src/mainboard/prodrive/atlas/vpd.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #ifndef ATLAS_VPD_H
4 #define ATLAS_VPD_H
5
6 /*
7 * The Atlas COMe module stores some non-volatile vital product data in
8 * an EC-attached I2C EEPROM. The EC firmware reads the EEPROM contents
9 * and provides them to the host via EMI (Embedded Memory Interface) 0.
10 */
11
12 #include <types.h>
13
14 #define VPD_MAGIC 0x56504453 /* 'VPDS' */
15
16 /*
17 * Increment this value whenever new fields are added to the structures.
18 * Furthermore, adapt the `get_emi_eeprom_vpd()` function accordingly to
19 * provide fallback values for newly-added fields.
20 */
21 #define VPD_LATEST_REVISION 1
22
23 struct __packed emi_eeprom_vpd_header {
24 uint32_t magic;
25 uint8_t revision;
26 uint8_t _rfu[15]; /* Reserved for Future Use */
27 };
28
29 /* For backwards compatibility reasons, do NOT reuse enum values! */
30 enum atlas_profile {
31 ATLAS_PROF_UNPROGRAMMED = 0, /* EEPROM not initialised */
32 ATLAS_PROF_DEFAULT = 1,
33 ATLAS_PROF_REALTIME_PERFORMANCE = 2,
34 ATLAS_PROF_THEMIS_LED_CONFIG = 3,
35 };
36
37 #define ATLAS_SN_PN_LENGTH 20
38
39 struct __packed emi_eeprom_vpd {
40 struct emi_eeprom_vpd_header header;
41 char serial_number[ATLAS_SN_PN_LENGTH]; /* xx-xx-xxx-xxx */
42 char part_number[ATLAS_SN_PN_LENGTH]; /* xxx-xxxx-xxxx.Rxx */
43 uint16_t profile;
44 };
45
46 /* Always returns a non-NULL pointer to valid data */
47 const struct emi_eeprom_vpd *get_emi_eeprom_vpd(void);
48
49 #endif /* ATLAS_VPD_H */