OpenBIC
OpenSource Bridge-IC
plat_cpld.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_CPLD_H
18#define PLAT_CPLD_H
19
20#include <stdio.h>
21#include <stdlib.h>
22#include <stdint.h>
23
24#define CPLD_OFFSET_VR_VENDER_TYPE 0x15
25#define CPLD_OFFSET_POWER_CLAMP 0x25
26#define CPLD_OFFSET_USERCODE 0x32
27
28typedef struct _cpld_info_ cpld_info;
29
30typedef struct _cpld_info_ {
31 uint8_t cpld_offset;
33 uint8_t dc_on_defaut;
34 bool is_fault_log; // if true, check the value is defaut or not
35 uint8_t is_fault_bit_map; //flag for fault
36
37 //flag for 1st polling
39
40 //flag for 1st polling after changing DC status
42
43 //temp data for last polling
45
46 bool (*status_changed_cb)(cpld_info *, uint8_t *);
47
48 uint8_t bit_check_mask; //bit check mask
49
50} cpld_info;
51
52bool plat_read_cpld(uint8_t offset, uint8_t *data, uint8_t len);
53bool plat_write_cpld(uint8_t offset, uint8_t *data);
54void init_cpld_polling(void);
56
57#endif
uint8_t data[]
Definition: isl69259.c:2
struct _cpld_info_ cpld_info
Definition: plat_cpld.h:28
void check_cpld_polling_alert_status(void)
Definition: plat_event.c:324
bool plat_write_cpld(uint8_t offset, uint8_t *data)
Definition: plat_cpld.c:41
void init_cpld_polling(void)
Definition: plat_event.c:740
bool plat_read_cpld(uint8_t offset, uint8_t *data, uint8_t len)
Definition: plat_cpld.c:36
uint32_t offset
Definition: pldm_firmware_update.h:0
Definition: plat_cpld.h:30
bool is_first_polling
Definition: plat_cpld.h:38
uint8_t last_polling_value
Definition: plat_cpld.h:44
bool is_first_polling_after_dc_change
Definition: plat_cpld.h:41
uint8_t bit_check_mask
Definition: plat_cpld.h:48
uint8_t dc_on_defaut
Definition: plat_cpld.h:33
uint8_t is_fault_bit_map
Definition: plat_cpld.h:35
uint8_t dc_off_defaut
Definition: plat_cpld.h:32
bool(* status_changed_cb)(cpld_info *, uint8_t *)
Definition: plat_cpld.h:46
bool is_fault_log
Definition: plat_cpld.h:34
uint8_t cpld_offset
Definition: plat_cpld.h:31