OpenBIC
OpenSource Bridge-IC
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <logging/log.h>
#include "sensor.h"
#include "libutil.h"
#include "hal_i2c.h"
#include "util_pmbus.h"
#include "pmbus.h"
#include "xdpe15284.h"
Classes | |
struct | config_sect |
struct | xdpe15284_config |
Macros | |
#define | XDPE15284_MFR_BLOCK_DATA_LEN 4 |
#define | XDPE15284_MFR_FW_CMD_DATA_LEN 4 |
#define | XDPE15284_REMAINING_WRITE_DATA_LEN 2 |
#define | XDPE15284_WAIT_DATA_DELAY_MS 10 |
#define | XDPE15284C_CONF_SIZE 1344 |
#define | XDPE15284_WRITE_PROTECT_DEFAULT_VAL 0xFF |
#define | ADDRESS_FIELD "PMBus Address :" |
#define | CHECKSUM_FIELD "Checksum : 0x" |
#define | DATA_START_TAG "[Configuration Data]" |
#define | DATA_END_TAG "[End Configuration Data]" |
#define | DATA_COMMENT "//" |
#define | MAX_SECT_DATA_NUM 200 |
#define | MAX_SECT_NUM 16 |
#define | SECT_TRIM 0x02 |
#define | SECT_CRC_OFFSET 2 |
#define | DATA_LEN_IN_LINE 5 |
#define | SCRATCHPAD_ADDRESS 0x2005e000 |
#define | CML_OTHER_MEMORY_FAULT_BIT BIT(0) |
#define | CR_ASCII 0x0D |
#define | NEW_LINE_ASCII 0x0A |
#define | SPACE_ASCII 0x20 |
#define | CRC32_POLY 0xEDB88320 |
Enumerations | |
enum | XDPE15284_REG { XDPE15284_WRITE_PROTECT_CMD_REG = 0x10 , XDPE15284_MFR_DISABLE_SECURITY_ONCE_REG = 0xCB , XDPE15284_IFX_MFR_AHB_ADDR_REG = 0xCE , XDPE15284_IFX_MFR_REG_WRITE_REG = 0xDE , XDPE15284_IFX_MFR_REG_READ_REG = 0xDF , XDPE15284_MFR_FW_CMD_DATA_REG = 0xFD , XDPE15284_MFR_FW_CMD_REG = 0xFE } |
enum | XDPE15284_MFR_CMD { XDPE15284_NOP_CMD = 0x00 , XDPE15284_GET_REMAINING_WR_CMD = 0x10 , XDPE15284_OTP_CONF_STO = 0x11 , XDPE15284_OTP_FILE_INVD = 0x12 , XDPE15284_CALCULATE_CRC_CMD = 0x2D } |
Functions | |
LOG_MODULE_REGISTER (xdpe15284) | |
bool | xdpe15284_set_write_protect (uint8_t bus, uint8_t addr, uint8_t option) |
void | xdpe15284_set_write_protect_default_val (uint8_t val) |
bool | xdpe15284_mfr_fw_operation (uint8_t bus, uint8_t addr, uint8_t cmd, uint8_t tx_len, uint8_t *tx_buf, uint8_t rx_len, uint8_t *rx_buf) |
bool | xdpe15284_get_checksum (uint8_t bus, uint8_t addr, uint8_t *checksum) |
bool | xdpe15284_get_remaining_wr (uint8_t bus, uint8_t addr, uint8_t *data) |
bool | xdpe15284_get_status_byte (uint8_t bus, uint8_t addr, uint8_t *data) |
uint8_t | xdpe15284_read (sensor_cfg *cfg, int *reading) |
bool | xdpe15284_lock_reg (uint8_t bus, uint8_t addr) |
bool | xdpe15284_unlock_reg (uint8_t bus, uint8_t addr) |
uint8_t | xdpe15284_init (sensor_cfg *cfg) |
int | xdpe15284_line_split (char **str, uint8_t *image_buf, uint32_t start_index, uint32_t end_index, int max_size) |
int | xdpe15284_parse_file (struct xdpe15284_config *config, uint8_t *image_buf, uint32_t img_size) |
bool | xdpe15284_fwupdate (uint8_t bus, uint8_t addr, uint8_t *img_buff, uint32_t img_size) |
Variables | |
const uint32_t | REG_LOCK_PASSWORD = 0x7F48680C |
#define ADDRESS_FIELD "PMBus Address :" |
#define CHECKSUM_FIELD "Checksum : 0x" |
#define CML_OTHER_MEMORY_FAULT_BIT BIT(0) |
#define CR_ASCII 0x0D |
#define CRC32_POLY 0xEDB88320 |
#define DATA_COMMENT "//" |
#define DATA_END_TAG "[End Configuration Data]" |
#define DATA_LEN_IN_LINE 5 |
#define DATA_START_TAG "[Configuration Data]" |
#define MAX_SECT_DATA_NUM 200 |
#define MAX_SECT_NUM 16 |
#define NEW_LINE_ASCII 0x0A |
#define SCRATCHPAD_ADDRESS 0x2005e000 |
#define SECT_CRC_OFFSET 2 |
#define SECT_TRIM 0x02 |
#define SPACE_ASCII 0x20 |
#define XDPE15284_MFR_BLOCK_DATA_LEN 4 |
#define XDPE15284_MFR_FW_CMD_DATA_LEN 4 |
#define XDPE15284_REMAINING_WRITE_DATA_LEN 2 |
#define XDPE15284_WAIT_DATA_DELAY_MS 10 |
#define XDPE15284_WRITE_PROTECT_DEFAULT_VAL 0xFF |
#define XDPE15284C_CONF_SIZE 1344 |
enum XDPE15284_MFR_CMD |
enum XDPE15284_REG |
LOG_MODULE_REGISTER | ( | xdpe15284 | ) |
bool xdpe15284_fwupdate | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | img_buff, | ||
uint32_t | img_size | ||
) |
bool xdpe15284_get_checksum | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | checksum | ||
) |
bool xdpe15284_get_remaining_wr | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | data | ||
) |
bool xdpe15284_get_status_byte | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t * | data | ||
) |
uint8_t xdpe15284_init | ( | sensor_cfg * | cfg | ) |
int xdpe15284_line_split | ( | char ** | str, |
uint8_t * | image_buf, | ||
uint32_t | start_index, | ||
uint32_t | end_index, | ||
int | max_size | ||
) |
bool xdpe15284_lock_reg | ( | uint8_t | bus, |
uint8_t | addr | ||
) |
bool xdpe15284_mfr_fw_operation | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t | cmd, | ||
uint8_t | tx_len, | ||
uint8_t * | tx_buf, | ||
uint8_t | rx_len, | ||
uint8_t * | rx_buf | ||
) |
int xdpe15284_parse_file | ( | struct xdpe15284_config * | config, |
uint8_t * | image_buf, | ||
uint32_t | img_size | ||
) |
uint8_t xdpe15284_read | ( | sensor_cfg * | cfg, |
int * | reading | ||
) |
bool xdpe15284_set_write_protect | ( | uint8_t | bus, |
uint8_t | addr, | ||
uint8_t | option | ||
) |
void xdpe15284_set_write_protect_default_val | ( | uint8_t | val | ) |
bool xdpe15284_unlock_reg | ( | uint8_t | bus, |
uint8_t | addr | ||
) |
const uint32_t REG_LOCK_PASSWORD = 0x7F48680C |