OpenBIC
OpenSource Bridge-IC
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#define CHASSIS_CUSTOM_DATA_MAX 24
24#define BOARD_CUSTOM_DATA_MAX 10
25#define PRODUCT_CUSTOM_DATA_MAX 10
26
27enum FRU_ID {
31};
32
33typedef struct {
34 uint8_t chassis_type;
35 char chassis_part_number[32];
36 char chassis_serial_number[32];
37 char chassis_custom_data[CHASSIS_CUSTOM_DATA_MAX][32];
39
40typedef struct {
41 uint8_t language;
42 char board_mfg_date[32];
43 char board_mfg[32];
44 char board_product[32];
45 char board_serial[32];
46 char board_part_number[32];
47 char board_fru_id[32];
48 char board_custom_data[BOARD_CUSTOM_DATA_MAX][32];
49} BoardInfo;
50
51typedef struct {
52 uint8_t language;
53 char product_manufacturer[32];
54 char product_name[32];
55 char product_part_number[32];
56 char product_version[32];
57 char product_serial[32];
58 char product_asset_tag[32];
59 char product_fru_id[32];
60 char product_custom_data[PRODUCT_CUSTOM_DATA_MAX][32];
62
63typedef struct {
64 ChassisInfo chassis;
65 BoardInfo board;
66 ProductInfo product;
67} FRU_INFO;
68
69bool init_fru_info(void);
70void print_fru_info(void);
71bool plat_cpld_fru_read(uint32_t offset, uint8_t *data, uint16_t data_len);
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:360
bool plat_eeprom_write(uint32_t offset, uint8_t *data, uint16_t data_len)
Definition: plat_fru.c:335
void print_fru_info(uint8_t board_fru_id)
Definition: plat_fru.c:733
FRU_ID
Definition: plat_fru.h:22
@ MAX_FRU_ID
Definition: plat_fru.h:46
uint16_t data_len
Definition: ipmb.h:14
uint8_t data[]
Definition: isl69259.c:2
FRU_INFO * get_fru_info(void)
Definition: plat_fru.c:517
bool init_fru_info(void)
Definition: plat_fru.c:204
@ 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
#define PRODUCT_CUSTOM_DATA_MAX
Definition: plat_fru.h:25
#define BOARD_CUSTOM_DATA_MAX
Definition: plat_fru.h:24
#define CHASSIS_CUSTOM_DATA_MAX
Definition: plat_fru.h:23
bool plat_cpld_fru_read(uint32_t offset, uint8_t *data, uint16_t data_len)
Definition: plat_fru.c:115
Definition: plat_fru.h:107
Definition: plat_fru.h:100
Definition: plat_fru.h:130
Definition: plat_fru.h:118