Skip to content

Commit 46c0324

Browse files
Alert code for FW
1 parent 34ff2e9 commit 46c0324

45 files changed

Lines changed: 1663 additions & 1192 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

firmware/ec/common/inc/global/Framework.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ typedef struct AlertData {
150150
} AlertData;
151151

152152
void OCMP_GenerateAlert(const AlertData *alert_data, unsigned int alert_id,
153-
const void *data);
153+
const void *data, const void *lValue,
154+
OCMPActionType actionType);
154155

155156
#endif /* _SYS_CFG_FRAMEWORK_H */

firmware/ec/common/inc/ocmp_wrappers/ocmp_eeprom_cat24c04.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_sid_fxnTable;
1818
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_gbc_inv_fxnTable;
1919
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_sdr_inv_fxnTable;
2020
SCHEMA_IMPORT const Driver_fxnTable CAT24C04_fe_inv_fxnTable;
21+
SCHEMA_IMPORT const Driver_fxnTable AT45DB641E_fxnTable;
2122

2223
static const Driver CAT24C04_gbc_sid = {
2324
.name = "EEPROM",

firmware/ec/inc/common/spibus.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ ReturnStatus spi_reg_read(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
3434
uint32_t byte, uint8_t numofBytes);
3535

3636
ReturnStatus spi_reg_write(SPI_Handle spiHandle, OcGpio_Pin *chip_select,
37-
void *regAddress, const uint8_t *data,
38-
uint32_t data_size, uint32_t byte,
39-
uint8_t numofBytes);
37+
void *regAddress, uint8_t *data, uint32_t data_size,
38+
uint32_t byte, uint8_t numofBytes);
4039

4140
#endif /* INC_COMMON_SPIBUS_H_ */

firmware/ec/inc/devices/at45db.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ typedef void (*AT45DB_CallbackFn)(AT45DB_Event evt, uint16_t value,
2929
typedef struct AT45DB_Cfg {
3030
SPI_Dev dev;
3131
OcGpio_Pin *pin_alert;
32+
const char *fileName[5];
33+
uint8_t noOfFiles;
3234
} AT45DB_Cfg;
3335

3436
typedef struct AT45DB_Obj {

firmware/ec/inc/devices/ina226.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* HEADER FILES
1414
*****************************************************************************/
1515
#include "common/inc/global/post_frame.h"
16+
#include "common/inc/global/ocmp_frame.h"
1617
#include "drivers/OcGpio.h"
1718
#include "inc/common/i2cbus.h"
1819

@@ -76,7 +77,8 @@ typedef enum INA226_Event {
7677
INA226_EVT_CUL, /* Current under limit - based on SUL */
7778
} INA226_Event;
7879

79-
typedef void (*INA226_CallbackFn)(INA226_Event evt, uint16_t value,
80+
typedef void (*INA226_CallbackFn)(INA226_Event evt, OCMPActionType alertAction,
81+
uint16_t value, uint16_t lValue,
8082
void *context);
8183

8284
typedef struct INA226_Cfg {

firmware/ec/inc/devices/se98a.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* HEADER FILES
1414
*****************************************************************************/
1515
#include "common/inc/global/post_frame.h"
16+
#include "common/inc/global/ocmp_frame.h"
1617
#include "common/inc/global/Framework.h"
1718
#include "drivers/OcGpio.h"
1819
#include "inc/common/i2cbus.h"
@@ -50,7 +51,8 @@ typedef enum Se98aAlert {
5051
SE98A_ALERT_CRITICAL
5152
} Se98aAlert;
5253

53-
typedef void (*SE98A_CallbackFn)(SE98A_Event evt, int8_t temperature,
54+
typedef void (*SE98A_CallbackFn)(SE98A_Event evt, OCMPActionType alertAction,
55+
int8_t temperature, int8_t lValue,
5456
void *context);
5557

5658
typedef struct SE98A_Cfg {

firmware/ec/platform/oc-sdr/cfg/OC_CONNECT_GBC.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ AT45DB_Dev gbc_spi_flash_memory = {
7575
.chip_select = &(OcGpio_Pin){ &ec_io, OC_EC_FLASH_nCS },
7676
},
7777
.pin_alert = NULL,
78+
.fileName = { "alertLog", "configLog", "bootLog" },
79+
.noOfFiles = 3,
7880
},
7981
.obj = {},
8082
};

0 commit comments

Comments
 (0)