Skip to content

Commit

Permalink
New WOF sensor for final adjusted Ceff Ratio Vdd
Browse files Browse the repository at this point in the history
Change-Id: I6b5447248b9beeb462556a4c943bb7f21b172a15
Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/80298
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Christopher J. Cain <cjcain@us.ibm.com>
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
  • Loading branch information
marthabroyles committed Jul 12, 2019
1 parent e447be8 commit 8bbfabe
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/occ_405/occbuildname.c
Expand Up @@ -34,6 +34,6 @@ volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) =

#else

volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190710a\0" /*</BuildName>*/ ;
volatile const char G_occ_buildname[16] __attribute__((section(".buildname"))) = /*<BuildName>*/ "op_occ_190712a\0" /*</BuildName>*/ ;

#endif
1 change: 1 addition & 0 deletions src/occ_405/sensor/sensor_enum.h
Expand Up @@ -519,6 +519,7 @@ enum e_gsid
CEFFVDNRATIO,
VRATIO,
OCS_ADDR,
CEFFVDDRATIOADJ,

// ------------------------------------------------------
// END of Sensor List (this must be last entry)
Expand Down
3 changes: 2 additions & 1 deletion src/occ_405/sensor/sensor_info.c
Expand Up @@ -322,7 +322,8 @@ const sensor_info_t G_sensor_info[] =
SENSOR_INFO_T_ENTRY( CEFFVDDRATIO, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1,-2) ),
SENSOR_INFO_T_ENTRY( CEFFVDNRATIO, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1,-2) ),
SENSOR_INFO_T_ENTRY( VRATIO, " \0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1, 0) ),
SENSOR_INFO_T_ENTRY( OCS_ADDR, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1, -2) ),
SENSOR_INFO_T_ENTRY( OCS_ADDR, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1, -2) ),
SENSOR_INFO_T_ENTRY( CEFFVDDRATIOADJ, "%\0", AMEC_SENSOR_TYPE_WOF, AMEC_SENSOR_LOC_PROC, AMEC_SENSOR_NONUM, AMEEFP_EVERY_8TH_TICK_HZ, AMEFP( 1,-2) ),
};

// Cause a compile error if we don't have all the sensors in the enum in the initialization list.
Expand Down
10 changes: 6 additions & 4 deletions src/occ_405/sensor/sensor_table.c
Expand Up @@ -356,6 +356,7 @@ const sensor_ptr_t G_amec_sensor_list[] =
SENSOR_PTR( CEFFVDNRATIO, &g_amec_sys.wof_sensors.ceff_ratio_vdn_sensor),
SENSOR_PTR( VRATIO, &g_amec_sys.wof_sensors.v_ratio_sensor),
SENSOR_PTR( OCS_ADDR, &g_amec_sys.wof_sensors.ocs_addr_sensor),
SENSOR_PTR( CEFFVDDRATIOADJ, &g_amec_sys.wof_sensors.ceff_ratio_vdd_adj_sensor),
};
STATIC_ASSERT( (NUMBER_OF_SENSORS_IN_LIST != (sizeof(G_amec_sensor_list)/sizeof(sensor_ptr_t))) );
STATIC_ASSERT( (MAX_AMEC_SENSORS < (sizeof(G_amec_sensor_list)/sizeof(sensor_ptr_t))) );
Expand Down Expand Up @@ -523,10 +524,11 @@ const minisensor_ptr_t G_amec_mini_sensor_list[] INIT_SECTION =
// ------------------------------------------------------
// WOF Sensors
// ------------------------------------------------------
SENSOR_PTR( CEFFVDDRATIO, NULL),
SENSOR_PTR( CEFFVDNRATIO, NULL),
SENSOR_PTR( VRATIO, NULL),
SENSOR_PTR( OCS_ADDR, NULL),
MINI_SENSOR_PTR( CEFFVDDRATIO, NULL),
MINI_SENSOR_PTR( CEFFVDNRATIO, NULL),
MINI_SENSOR_PTR( VRATIO, NULL),
MINI_SENSOR_PTR( OCS_ADDR, NULL),
MINI_SENSOR_PTR( CEFFVDDRATIOADJ, NULL),
};
STATIC_ASSERT( (NUMBER_OF_SENSORS_IN_LIST != (sizeof(G_amec_mini_sensor_list)/sizeof(uint16_t *))) );
STATIC_ASSERT( (MAX_AMEC_SENSORS < (sizeof(G_amec_mini_sensor_list)/sizeof(uint16_t *))) );
2 changes: 2 additions & 0 deletions src/occ_405/wof/wof.c
Expand Up @@ -1515,6 +1515,8 @@ void calculate_ceff_ratio_vdd( void )
// Now check the raw ceff ratio to prevent Over current by clipping to max of 100%
// this is saved to the parameter used by the rest of the wof alg
g_wof->ceff_ratio_vdd = prevent_over_current(l_raw_ceff_ratio);
// save the final adjusted Ceff ratio to a sensor
sensor_update(AMECSENSOR_PTR(CEFFVDDRATIOADJ), (uint16_t)g_wof->ceff_ratio_vdd);
}
} // else v_ratio != 0
}
Expand Down
9 changes: 4 additions & 5 deletions src/occ_405/wof/wof.h
Expand Up @@ -5,7 +5,7 @@
/* */
/* OpenPOWER OnChipController Project */
/* */
/* Contributors Listed Below - COPYRIGHT 2016,2018 */
/* Contributors Listed Below - COPYRIGHT 2016,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
Expand Down Expand Up @@ -400,15 +400,14 @@ typedef struct __attribute__ ((packed))
uint32_t ocs_dirty_type1_count; // count of number of times dirty with type act (1)
} amec_wof_t;

// Structure for sensors used in g_amec for AMESTER
// these will contain raw values any clipping for WOF alg will be represented
// in the parameter above in amec_wof_t
// Structure for sensors used in g_amec for AMESTER for additional debug
typedef struct __attribute__ ((packed))
{
sensor_t ceff_ratio_vdd_sensor;
sensor_t ceff_ratio_vdd_sensor; // raw ceff ratio Vdd
sensor_t ceff_ratio_vdn_sensor;
sensor_t v_ratio_sensor;
sensor_t ocs_addr_sensor;
sensor_t ceff_ratio_vdd_adj_sensor; // final adjusted ratio should reflect ceff_ratio_vdd in amec_wof_t
} amec_wof_sensors_t;

typedef struct __attribute__ ((packed))
Expand Down

0 comments on commit 8bbfabe

Please sign in to comment.