OpenBIC
OpenSource Bridge-IC
plat_pmic.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_PMIC_H
18#define PLAT_PMIC_H
19
20#include <stdint.h>
21
22#define MONITOR_PMIC_ERROR_STACK_SIZE 4096
23#define MONITOR_PMIC_ERROR_TIME_MS (3 * 1000) // 3s
24#define CLEAR_MTP_DELAY_MS 200
25
26#define CLEAR_MTP_RETRY_MAX 5
27#define MAX_COUNT_PMIC_ERROR_OFFSET 7
28#define MAX_COUNT_PMIC_ERROR_TYPE 17
29#define MAX_LEN_PMIC_CRITICAL_ERROR_INDEX 11
30
31#define PMIC_ERROR_STATUS_START_OFFSET 0x04
32#define PMIC_CLEAR_STATUS_BITS4_OFFSET 0x14
33#define PMIC_CLEAR_ERROR_INJECTION_CFG_OFFSET 0x35
34#define PMIC_VENDOR_PASSWORD_CONTROL_OFFSET 0x39
35
38int compare_pmic_error(uint8_t dimm_id, uint8_t *pmic_err_data, uint8_t pmic_err_data_len);
41void clear_pmic_error(uint8_t dimm_id);
42void add_pmic_error_sel(uint8_t dimm_id, uint8_t error_type);
43int get_pmic_error_data(uint8_t dimm_id, uint8_t *buffer, uint8_t is_need_check_post_status);
44
46
47#endif
ipmi_msg buffer
Definition: ipmb.h:0
int compare_pmic_error(uint8_t dimm_id, uint8_t *pmic_err_data)
Definition: plat_pmic.c:198
void add_pmic_error_sel(uint8_t dimm_id, uint8_t error_type)
Definition: plat_pmic.c:237
void start_monitor_pmic_error_thread()
Definition: plat_pmic.c:77
void clear_pmic_error()
Definition: plat_pmic.c:531
void read_pmic_error_when_dc_off()
Definition: plat_pmic.c:434
int get_pmic_fault_status()
Definition: plat_pmic.c:391
void monitor_pmic_error_via_i3c_handler()
Definition: plat_pmic.c:84
int get_pmic_error_data(uint8_t dimm_id, uint8_t *buffer, uint8_t is_need_check_post_status)
Definition: plat_pmic.c:308
void init_pmic_event_work()
Definition: plat_pmic.c:142