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 "eeprom.h"
21#include "plat_i2c.h"
22
23enum {
25 // OTHER_FRU_ID,
27};
28
29#define FRU_CFG_NUM MAX_FRU_ID
30
31#define MB_FRU_PORT I2C_BUS10
32#define MB_FRU_ADDR 0x50
33
34#define BIOS_FW_VERSION_START 0x0A00
35#define BIOS_FW_VERSION_MAX_SIZE 34
36#define BIOS_FW_VERSION_BLOCK_NUM 2
37#define BIOS_FW_VERSION_SECOND_BLOCK_OFFSET 17
38#define BIOS_FW_VERSION_BLOCK_MAX_SIZE 17
39
40#define VR_RM_CNT_MAX_SIZE 2
41#define VR_MPS_CPUDVDD_RM_CNT_START 0x0B00
42#define VR_MPS_CPUVDD_RM_CNT_START (VR_MPS_CPUDVDD_RM_CNT_START + VR_RM_CNT_MAX_SIZE)
43#define VR_MPS_SOCVDD_RM_CNT_START (VR_MPS_CPUDVDD_RM_CNT_START + (VR_RM_CNT_MAX_SIZE * 2))
44#define VR_MPS_FBVDDP2_RM_CNT_START (VR_MPS_CPUDVDD_RM_CNT_START + (VR_RM_CNT_MAX_SIZE * 3))
45#define VR_MPS_1V2_RM_CNT_START (VR_MPS_CPUDVDD_RM_CNT_START + (VR_RM_CNT_MAX_SIZE * 4))
46#define VR_MPS_MAX_RM_CNT 1000 //Approximate number from MPS vendor
47
48#define RTC_CLR_REC_MAX_SIZE 1
49#define RTC_CLR_REC_START 0x0C00
50
51#define RTC_CLR_ASSERT 0x00
52#define RTC_CLR_DEASSERT 0xFF
53
55int set_bios_version(EEPROM_ENTRY *entry, uint8_t block_index);
56int get_bios_version(EEPROM_ENTRY *entry, uint8_t block_index);
57bool access_vr_remain_cnt(EEPROM_ENTRY *entry, uint8_t comp_id, bool update_flag);
58bool access_rtc_clr_flag(uint8_t val);
60
61#endif
@ MB_FRU_ID
Definition: plat_fru.h:21
@ MAX_FRU_ID
Definition: plat_fru.h:44
uint32_t val
Definition: plat_util.c:40
Definition: eeprom.h:42
Definition: eeprom.h:56
bool get_bios_version_area_config(EEPROM_CFG *config)
int get_bios_version(EEPROM_ENTRY *entry)
Definition: plat_fru.c:80
int set_bios_version(EEPROM_ENTRY *entry)
Definition: plat_fru.c:63
bool access_rtc_clr_flag(uint8_t val)
Definition: plat_fru.c:222
void handle_rtc_clr_flag()
Definition: plat_fru.c:241
bool access_vr_remain_cnt(EEPROM_ENTRY *entry, uint8_t comp_id, bool update_flag)
Definition: plat_fru.c:153