Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrique Silva committed Jul 31, 2019
2 parents e42c6ea + b393759 commit 08a913d
Show file tree
Hide file tree
Showing 14 changed files with 690 additions and 1,087 deletions.
5 changes: 3 additions & 2 deletions modules/hpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ IPMI_HANDLER(ipmi_picmg_upload_firmware_block, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_
{
uint8_t len = rsp->data_len = 0;
uint8_t block_data[HPM_BLOCK_SIZE];
uint8_t block_sz = req->data_len-2;

if (active_id > 7) {
/* Component ID out of range */
Expand All @@ -303,13 +304,13 @@ IPMI_HANDLER(ipmi_picmg_upload_firmware_block, NETFN_GRPEXT, IPMI_PICMG_CMD_HPM_
return;
}

memcpy(&block_data[0], &req->data[2], req->data_len-2);
memcpy(&block_data[0], &req->data[2], block_sz);

/* TODO: perform checksum of the block */

if (hpm_components[active_id].hpm_upload_block_f) {
/* WARNING: This function can't block! */
rsp->completion_code = hpm_components[active_id].hpm_upload_block_f(&block_data[0], sizeof(block_data));
rsp->completion_code = hpm_components[active_id].hpm_upload_block_f(&block_data[0], block_sz);
} else {
rsp->completion_code = IPMI_CC_UNSPECIFIED_ERROR;
}
Expand Down
2 changes: 1 addition & 1 deletion modules/ipmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ ipmb_error ipmb_send_request ( ipmi_msg * req )
req_cfg->retries = 0;

/* Blocks here until is able put message in tx queue */
if (xQueueSend( ipmb_txqueue, &req_cfg, 1) != pdTRUE ){
if (xQueueSend( ipmb_txqueue, &req_cfg, portMAX_DELAY) != pdTRUE ){
vPortFree( req_cfg );
return ipmb_error_failure;
}
Expand Down
7 changes: 4 additions & 3 deletions modules/ipmb.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@
/**
* @brief Maximum count of messages to be sent
*/
#define IPMB_TXQUEUE_LEN 2
#define IPMB_TXQUEUE_LEN 10

/**
* @brief Maximum count if received messages to be delivered to client task
* @brief Maximum count of received messages to be delivered to client task
*/
#define IPMB_CLIENT_QUEUE_LEN 2
#define IPMB_CLIENT_QUEUE_LEN 10

/**
* @brief Maximum retries made by IPMB TX Task when sending a message
Expand Down
2 changes: 1 addition & 1 deletion modules/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main( void )
#endif

printf("openMMC Starting!\n");
printf("Build date: %s %s\n" __DATE__, __TIME__);
printf("Build date: %s %s\n", __DATE__, __TIME__);
printf("Version: %s\n", g_GIT_TAG);
printf("SHA1: %s\n", g_GIT_SHA1);

Expand Down
581 changes: 198 additions & 383 deletions modules/sdr.c

Large diffs are not rendered by default.

22 changes: 16 additions & 6 deletions modules/sdr.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@
#define IPMI_THRESHOLD_UNR_GL 0x0A // upper non recoverable going low
#define IPMI_THRESHOLD_UNR_GH 0x0B // upper non recoverable going high

/* Constants for comparison function */
#define UNSIGNED 0x00
#define SIGNED 0x01

#define LOWER_EQ 0x00
#define UPPER_EQ 0x01


typedef enum {
TYPE_01 = 0x1,
Expand Down Expand Up @@ -91,8 +98,8 @@ typedef struct {
uint8_t sensorcap;
uint8_t sensortype;
uint8_t event_reading_type;
uint8_t assertion_event_mask[2];
uint8_t deassertion_event_mask[2];
uint16_t assertion_event_mask;
uint16_t deassertion_event_mask;
uint8_t settable_threshold_mask;
uint8_t readable_threshold_mask;
uint8_t sensor_units_1;
Expand Down Expand Up @@ -139,8 +146,8 @@ typedef struct {
uint8_t sensorcap;
uint8_t sensortype;
uint8_t event_reading_type;
uint8_t assertion_event_mask[2];
uint8_t deassertion_event_mask[2];
uint16_t assertion_event_mask;
uint16_t deassertion_event_mask;
uint8_t settable_threshold_mask;
uint8_t readable_threshold_mask;
uint8_t sensor_units_1;
Expand Down Expand Up @@ -182,6 +189,7 @@ typedef struct sensor_t {
uint16_t readout_value;
uint8_t chipid;
uint8_t signed_flag;
uint8_t event_scan;
uint8_t ownerID; /* This field is repeated here because its value is assigned during initialization, so it can't be const */
uint8_t entityinstance; /* This field is repeated here because its value is assigned during initialization, so it can't be const */
TaskHandle_t * task_handle;
Expand All @@ -192,7 +200,7 @@ typedef struct sensor_t {
uint16_t upper_critical_go_low:1;
uint16_t upper_non_critical_go_high:1;
uint16_t upper_non_critical_go_low:1;
uint16_t lower_non_recorverable_go_high:1;
uint16_t lower_non_recoverable_go_high:1;
uint16_t lower_non_recoverable_go_low:1;
uint16_t lower_critical_go_high:1;
uint16_t lower_critical_go_low:1;
Expand All @@ -219,8 +227,10 @@ void amc_sdr_init( void );
void rtm_sdr_init( void );
#endif
void sensor_init( void );
void sensor_enable(sensor_t *sensor);
void sensor_disable(sensor_t *sensor);
void check_sensor_event( sensor_t * sensor );

void sensor_state_check( sensor_t *sensor );
sensor_t * sdr_insert_entry( SDR_TYPE type, void * sdr, TaskHandle_t *monitor_task, uint8_t diag_id, uint8_t slave_addr);
void sdr_remove_entry( sensor_t * entry );
void sdr_pop( void );
Expand Down
3 changes: 2 additions & 1 deletion modules/sensors/ina220.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ void vTaskINA220( void *Parameters )
}

/* Check for threshold events */
sensor_state_check(ina220_sensor);
check_sensor_event(ina220_sensor);

vTaskDelayUntil( &xLastWakeTime, xFrequency );
}
vTaskDelayUntil( &xLastWakeTime, xFrequency );
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/sensors/lm75.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ void vTaskLM75( void* Parameters )
}
/* Check for threshold events */
i2c_give(i2c_interf);
sensor_state_check(temp_sensor);
check_sensor_event(temp_sensor);
}
}
Expand Down
3 changes: 2 additions & 1 deletion modules/sensors/max6642.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ void vTaskMAX6642( void* Parameters )
max6642_read_remote( temp_sensor, (uint8_t *) &(temp_sensor->readout_value) );

/* Check for threshold events */
check_sensor_event( temp_sensor );
sensor_state_check(temp_sensor);
check_sensor_event(temp_sensor);
}
vTaskDelay(xFrequency);
}
Expand Down
Loading

0 comments on commit 08a913d

Please sign in to comment.