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#include "plat_i2c.h"
21#include "i2c-mux-pca954x.h"
22
23enum FRU_ID {
24 FIO_FRU_ID = 0x0D,
25 CB_FRU_ID = 0x10,
62 // OTHER_FRU_ID,
64};
65
69};
70
71/* Skip fru id 0~12, 14~15, 17 */
72#define FRU_CFG_NUM 38
73#define BIC_FRU_DEV_ID CB_FRU_ID
74
75#define CB_FRU_PORT I2C_BUS2
76#define CB_FRU_ADDR (0xAC >> 1)
77#define FIO_FRU_PORT I2C_BUS10
78#define FIO_FRU_ADDR (0xA2 >> 1)
79#define ACCL_1_6_FRU_PORT I2C_BUS8
80#define ACCL_7_12_FRU_PORT I2C_BUS7
81#define ACCL_FRU_ADDR (0xA6 >> 1)
82#define ACCL_1_7_FRU_MUX_CHAN 0
83#define ACCL_2_8_FRU_MUX_CHAN 1
84#define ACCL_3_9_FRU_MUX_CHAN 2
85#define ACCL_4_10_FRU_MUX_CHAN 3
86#define ACCL_5_11_FRU_MUX_CHAN 4
87#define ACCL_6_12_FRU_MUX_CHAN 5
88#define ACCL_FREYA_CH1_FRU_ADDR (0xA4 >> 1)
89#define ACCL_FREYA_CH2_FRU_ADDR (0xA2 >> 1)
90
91#define MP2985_REMAINING_WRITE_START 0x0A00
92#define MP2985_REMAINING_WRITE_MAX_SIZE 1
93#define MP2985_REMAINING_WRITE_MAX_COUNT 100
94
95bool pal_accl_fru_id_map_accl_id_dev_id(uint8_t accl_fru_id, uint8_t *accl_id, uint8_t *dev_id);
96bool set_mp2985_remaining_write(uint8_t count);
97bool get_mp2985_remaining_write(uint8_t *count);
98
99#endif
FRU_ID
Definition: plat_fru.h:20
@ FIO_FRU_ID
Definition: plat_fru.h:43
@ MAX_FRU_ID
Definition: plat_fru.h:44
bool set_mp2985_remaining_write(uint8_t count)
Definition: plat_fru.c:485
bool get_mp2985_remaining_write(uint8_t *count)
Definition: plat_fru.c:502
bool pal_accl_fru_id_map_accl_id_dev_id(uint8_t accl_fru_id, uint8_t *accl_id, uint8_t *dev_id)
Definition: plat_fru.c:427
@ ACCL_12_CH1_FREYA_FRU_ID
Definition: plat_fru.h:60
@ CB_FRU_ID
Definition: plat_fru.h:25
@ ACCL_2_CH1_FREYA_FRU_ID
Definition: plat_fru.h:40
@ ACCL_5_CH2_FREYA_FRU_ID
Definition: plat_fru.h:47
@ ACCL_1_FRU_ID
Definition: plat_fru.h:26
@ ACCL_7_CH2_FREYA_FRU_ID
Definition: plat_fru.h:51
@ ACCL_8_FRU_ID
Definition: plat_fru.h:33
@ ACCL_10_CH2_FREYA_FRU_ID
Definition: plat_fru.h:57
@ ACCL_8_CH2_FREYA_FRU_ID
Definition: plat_fru.h:53
@ ACCL_3_FRU_ID
Definition: plat_fru.h:28
@ ACCL_1_CH1_FREYA_FRU_ID
Definition: plat_fru.h:38
@ ACCL_4_CH2_FREYA_FRU_ID
Definition: plat_fru.h:45
@ ACCL_5_CH1_FREYA_FRU_ID
Definition: plat_fru.h:46
@ ACCL_6_CH2_FREYA_FRU_ID
Definition: plat_fru.h:49
@ ACCL_4_FRU_ID
Definition: plat_fru.h:29
@ ACCL_3_CH2_FREYA_FRU_ID
Definition: plat_fru.h:43
@ ACCL_7_FRU_ID
Definition: plat_fru.h:32
@ ACCL_2_CH2_FREYA_FRU_ID
Definition: plat_fru.h:41
@ ACCL_6_FRU_ID
Definition: plat_fru.h:31
@ ACCL_8_CH1_FREYA_FRU_ID
Definition: plat_fru.h:52
@ ACCL_3_CH1_FREYA_FRU_ID
Definition: plat_fru.h:42
@ ACCL_5_FRU_ID
Definition: plat_fru.h:30
@ ACCL_1_CH2_FREYA_FRU_ID
Definition: plat_fru.h:39
@ ACCL_12_FRU_ID
Definition: plat_fru.h:37
@ ACCL_11_CH2_FREYA_FRU_ID
Definition: plat_fru.h:59
@ ACCL_2_FRU_ID
Definition: plat_fru.h:27
@ ACCL_9_CH1_FREYA_FRU_ID
Definition: plat_fru.h:54
@ ACCL_6_CH1_FREYA_FRU_ID
Definition: plat_fru.h:48
@ ACCL_10_FRU_ID
Definition: plat_fru.h:35
@ ACCL_7_CH1_FREYA_FRU_ID
Definition: plat_fru.h:50
@ ACCL_9_CH2_FREYA_FRU_ID
Definition: plat_fru.h:55
@ ACCL_11_FRU_ID
Definition: plat_fru.h:36
@ ACCL_11_CH1_FREYA_FRU_ID
Definition: plat_fru.h:58
@ ACCL_4_CH1_FREYA_FRU_ID
Definition: plat_fru.h:44
@ ACCL_12_CH2_FREYA_FRU_ID
Definition: plat_fru.h:61
@ ACCL_10_CH1_FREYA_FRU_ID
Definition: plat_fru.h:56
@ ACCL_9_FRU_ID
Definition: plat_fru.h:34
ACCL_FRU_OPTION
Definition: plat_fru.h:66
@ ACCL_FRU_READ
Definition: plat_fru.h:67
@ ACCL_FRU_WRITE
Definition: plat_fru.h:68