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
20enum FRU_ID {
21 MB_FRU_ID = 0x00,
45};
46
47#define FRU_CFG_NUM MAX_FRU_ID
48
49#define MB_FRU_ADDR (0xA6 >> 1)
50#define FIO_FRU_ADDR (0xA4 >> 1)
51#define BB_FRU_ADDR (0xA4 >> 1)
52#define BPB_FRU_ADDR (0xA6 >> 1)
53#define SB_FRU_ADDR (0xA6 >> 1)
54#define PDB_FRU_ADDR (0xAA >> 1)
55#define PB_FRU_ADDR (0xA6 >> 1)
56#define FB_FRU_ADDR (0xA6 >> 1)
57
58#define I2C_1_MUX_ADDR (0xE0 >> 1)
59#define I2C_2_MUX_ADDR (0xE2 >> 1)
60#define I2C_6_MUX_ADDR (0xE4 >> 1)
61#define I2C_7_MUX_ADDR (0xE6 >> 1)
62#define PB_MUX_ADDR (0xE8 >> 1)
63#define SB_MUX_ADDR (0xE8 >> 1)
64
65#define MUX_CHANNEL_0 0
66#define MUX_CHANNEL_1 1
67#define MUX_CHANNEL_2 2
68#define MUX_CHANNEL_3 3
69
70// plat eeprom save in rpu eeprom
71#define MANAGEMENT_BOARD_FRU_EEPROM_OFFSET 0x0000
72#define MANAGEMENT_BOARD_FRU_EEPROM_START_OFFSET 0x0008
73#define MANAGEMENT_BOARD_FRU_EEPROM_BOARD_AREA_SIZE 0x0009
74#define PLAT_EEPROM_OFFSET 0x2000 // 8kb
75#define EEPROM_HMI_VERSION_OFFSET PLAT_EEPROM_OFFSET
76#define EEPROM_HMI_VERSION_SIZE 8 // 8 bytes
77#define EEPROM_RPU_ADDR_OFFSET (EEPROM_HMI_VERSION_OFFSET + EEPROM_HMI_VERSION_SIZE)
78#define EEPROM_RPU_ADDR_VERSION_SIZE 1 // 1 bytes
79
80#define EEPROM_UPTIME_OFFSET (EEPROM_RPU_ADDR_OFFSET + EEPROM_RPU_ADDR_VERSION_SIZE)
81#define EEPROM_UPTIME_SIZE 4 // 4 bytes
82
83#define EEPROM_PUMP1_UPTIME_OFFSET (EEPROM_UPTIME_OFFSET + EEPROM_UPTIME_SIZE)
84#define EEPROM_PUMP1_UPTIME_SIZE 4 // 4 bytes
85
86#define EEPROM_PUMP2_UPTIME_OFFSET (EEPROM_PUMP1_UPTIME_OFFSET + EEPROM_PUMP1_UPTIME_SIZE)
87#define EEPROM_PUMP2_UPTIME_SIZE 4 // 4 bytes
88
89#define EEPROM_PUMP3_UPTIME_OFFSET (EEPROM_PUMP2_UPTIME_OFFSET + EEPROM_PUMP2_UPTIME_SIZE)
90#define EEPROM_PUMP3_UPTIME_SIZE 4 // 4 bytes
91
92bool plat_eeprom_write(uint32_t offset, uint8_t *data, uint16_t data_len);
93bool plat_eeprom_read(uint32_t offset, uint8_t *data, uint16_t data_len);
94
95#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
@ FB_14_FRU_ID
Definition: plat_fru.h:42
@ BB_FRU_ID
Definition: plat_fru.h:22
@ SB_FRU_ID
Definition: plat_fru.h:25
@ MB_FRU_ID
Definition: plat_fru.h:21
@ PB_2_FRU_ID
Definition: plat_fru.h:27
@ FB_4_FRU_ID
Definition: plat_fru.h:32
@ FIO_FRU_ID
Definition: plat_fru.h:43
@ FB_8_FRU_ID
Definition: plat_fru.h:36
@ FB_9_FRU_ID
Definition: plat_fru.h:37
@ FB_7_FRU_ID
Definition: plat_fru.h:35
@ FB_1_FRU_ID
Definition: plat_fru.h:29
@ FB_13_FRU_ID
Definition: plat_fru.h:41
@ FB_6_FRU_ID
Definition: plat_fru.h:34
@ FB_3_FRU_ID
Definition: plat_fru.h:31
@ FB_2_FRU_ID
Definition: plat_fru.h:30
@ FB_10_FRU_ID
Definition: plat_fru.h:38
@ FB_12_FRU_ID
Definition: plat_fru.h:40
@ FB_11_FRU_ID
Definition: plat_fru.h:39
@ MAX_FRU_ID
Definition: plat_fru.h:44
@ FB_5_FRU_ID
Definition: plat_fru.h:33
@ BPB_FRU_ID
Definition: plat_fru.h:23
@ PB_3_FRU_ID
Definition: plat_fru.h:28
@ PDB_FRU_ID
Definition: plat_fru.h:24
@ PB_1_FRU_ID
Definition: plat_fru.h:26
uint16_t data_len
Definition: ipmb.h:14
uint8_t data[]
Definition: isl69259.c:2
uint32_t offset
Definition: pldm_firmware_update.h:0