OpenBIC
OpenSource Bridge-IC
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
plat_fru.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef PLAT_FRU_H
18#define PLAT_FRU_H
19
20#define FRU_CFG_NUM MAX_FRU_ID
21#define LOG_EEPROM_ADDR (0xA0 >> 1)
22#define CPLD_EEPROM_ADDR (0xA0 >> 1)
23
24#define CHASSIS_CUSTOM_DATA_MAX 24
25#define BOARD_CUSTOM_DATA_MAX 8
26#define PRODUCT_CUSTOM_DATA_MAX 8
27
28typedef struct {
29 uint8_t chassis_type;
30 char chassis_part_number[32];
31 char chassis_serial_number[32];
32 char chassis_custom_data[CHASSIS_CUSTOM_DATA_MAX][32];
34
35typedef struct {
36 uint8_t language;
37 char board_mfg_date[32];
38 char board_mfg[32];
39 char board_product[32];
40 char board_serial[32];
41 char board_part_number[32];
42 char board_fru_id[32];
43 char board_custom_data[BOARD_CUSTOM_DATA_MAX][32];
44} BoardInfo;
45
46typedef struct {
47 uint8_t language;
48 char product_manufacturer[32];
49 char product_name[32];
50 char product_part_number[32];
51 char product_version[32];
52 char product_serial[32];
53 char product_asset_tag[32];
54 char product_fru_id[32];
55 char product_custom_data[PRODUCT_CUSTOM_DATA_MAX][32];
57
58typedef struct {
62} FRU_INFO;
63
64enum FRU_ID {
68};
69
70bool init_fru_info(void);
71void print_fru_info(void);
72bool plat_eeprom_write(uint32_t offset, uint8_t *data, uint16_t data_len);
73bool plat_eeprom_read(uint32_t offset, uint8_t *data, uint16_t data_len);
75
76#endif
bool plat_eeprom_read(uint32_t offset, uint8_t *data, uint16_t data_len)
Definition: plat_fru.c:359
bool plat_eeprom_write(uint32_t offset, uint8_t *data, uint16_t data_len)
Definition: plat_fru.c:334
FRU_ID
Definition: plat_fru.h:20
@ MAX_FRU_ID
Definition: plat_fru.h:44
uint16_t data_len
Definition: ipmb.h:14
uint8_t data[]
Definition: isl69259.c:2
#define PRODUCT_CUSTOM_DATA_MAX
Definition: plat_fru.h:26
void print_fru_info(void)
Definition: plat_fru.c:459
FRU_INFO * get_fru_info(void)
Definition: plat_fru.c:517
bool init_fru_info(void)
Definition: plat_fru.c:204
#define BOARD_CUSTOM_DATA_MAX
Definition: plat_fru.h:25
#define CHASSIS_CUSTOM_DATA_MAX
Definition: plat_fru.h:24
@ LOG_EEPROM_ID
Definition: plat_fru.h:65
@ CPLD_EEPROM_ID
Definition: plat_fru.h:66
uint32_t offset
Definition: pldm_firmware_update.h:0
Definition: plat_fru.h:35
uint8_t language
Definition: plat_fru.h:36
Definition: plat_fru.h:28
uint8_t chassis_type
Definition: plat_fru.h:29
Definition: plat_fru.h:58
ProductInfo product
Definition: plat_fru.h:61
ChassisInfo chassis
Definition: plat_fru.h:59
BoardInfo board
Definition: plat_fru.h:60
Definition: plat_fru.h:46
uint8_t language
Definition: plat_fru.h:47