Skip to content

Commit bfda410

Browse files
Kevin Huangmeta-codesync[bot]
authored andcommitted
sb: rb: Update multiple new functions to sb-rb-20254901 (#2657)
Summary: - Fix UBC(delta) address setting when different board version - add shell commands -clock_ctrl -fru_print -jtag_mux -power_good_status -vqps - add VR_OSFP_3V3 firmware update - add blackbox events-smbus alert & fix power fault issue - modified power_steps_on power on one by one - add smbus alert trigger function - update new vr threshold - add LEAK2 trigger funciton(EVB FAB2) - add ASIC die temperature sensor LED control funciton - remove iris_power steps_on shell command debug message - modify ALL_VR_PM_ALERT_R_N trigger funciton execute immediately when trigger - when asic is updating it needs to turn off cpld RESET register all pins and will restore when update is finished - add shell_spi explanatory text - add U200051_IO init and reading data base on dc on/off - update VQPS shell command with unified control & status - add shell commands for delay_asic_rst and delay_module_pg - add CPLD power capping control shell command - add PCIe PERST control shell command - add soc_pwron_reset bit control support - update SENSOR_NUM_ASIC_P0V4_VDDQL_HBM0246_VOLT_V threshold - add fan control setting to cool down ASIC(EVB only) - IRIS boot0 update - add ads7066 & ad4058 sensor reading and test shell command - add iris smbus alert function - update power sequence - modified vqps shell cmd - add allow user to choose which reset IO to trigger on MMC - modified UBC Current UCR to 180000 - modified pldm iris boot0 update by i2c_master_write - fix CLK enable shows “AEGIS” in name, change to "RAINBOW" - add temp status get all , strap_control_manual enable/disable - add new 4V2, 3V3CLK, P1V5_PLL_VDDA_OWL_E, P1V5_PLL_VDDA_OWL_W in power sequence, power good status, steps_on - add disable_steps_on functions that will disable all power to power off status - add showing the power good value when steps_on - edit some names - update VQPS shell command with unified control & status - add shell commands for delay_asic_rst and delay_module_pg - add CPLD power capping control shell command - add PCIe PERST control shell command - add soc_pwron_reset bit control support - update SENSOR_NUM_ASIC_P0V4_VDDQL_HBM0246_VOLT_V threshold - add fan control setting to cool down ASIC(EVB only) - IRIS boot0 update - add ads7066 & ad4058 sensor reading and test shell command - add iris temp sensor black box event and checking thread - modified PERST delay time base on 10ms adam - add iris smbus alert function - update power sequence adam - modified vqps shell cmd billy - add allow user to choose which reset IO to trigger on MMC - modified UBC Current UCR to 180000 - modified pldm iris boot0 update by i2c_master_write - fix CLK enable shows “AEGIS” in name, change to "RAINBOW" - add temp status get all , strap_control_manual enable/disable adam - fix adc index error - modified adc_test read buf and buf_raw - update temperature threshold adam - fix strap pin mapping - fix adc index error - add U200052 ioexp. init and control function - add shell: get_fw_version force_read_asic - add 3v3osfp(EVB only) in power good status, power on and 1-steps on - add "get" for shell cmd "strap_control_manual" adam - move VR_HOT_EVB default init to tca6424a_init billy - add pca6416a_init to set HAMSA_MFIO19 default low billy - fix tca6424a mapping billy - fix delay pcie reset perm setting adam - thermal: move board_id init out of loop - thermal: update VR_HOT handling for temperature alert event - refactor status read and add success/fail flag - add iris temp sensor black box event and checking thread - modified power steps and add 4V2 pwrgd - modify soc_pcie_perst command function adam - add power_capping: enable autocomplete and simplify shell logic billy - add clock_status: autocomplete, all option, and CLK_GEN_100M_U86 billy - modify bootstrap default - add shell command "bmc_sensor get" to get P52V_ASIC_SENSE_PWR - add power_capping_control: VR_HOT IO exp support on EVB - add U200070_IO support and set default IO directions/values billy - update VQPS shell cmd for U200070 and EVT-specific bit mapping billy - add shell vr version get will check p3v3 and p5v pwrgd before get version Pull Request resolved: #2657 Test Plan: - Build code: Pass Reviewed By: jamesatha Differential Revision: D90850843 fbshipit-source-id: bbc41c2bda2d610f3730ead85b43669631f49333
1 parent 2157dfc commit bfda410

File tree

79 files changed

+7702
-814
lines changed

Some content is hidden

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

79 files changed

+7702
-814
lines changed

common/dev/include/tmp431.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ enum TMP431_REIGSTER_MAP {
6363
};
6464

6565
bool tmp432_get_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
66-
uint32_t *millidegree_celsius);
66+
int32_t *millidegree_celsius);
6767
bool tmp432_set_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
6868
uint32_t *millidegree_celsius);
6969
bool tmp432_set_thermal_mode(sensor_cfg *cfg);

common/dev/include/tmp75.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ enum TMP75_REIGSTER_MAP {
2323
};
2424

2525
bool tmp75_get_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
26-
uint32_t *millidegree_celsius);
26+
int32_t *millidegree_celsius);
2727
bool tmp75_set_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
2828
uint32_t *millidegree_celsius);
2929
uint8_t tmp75_init(sensor_cfg *cfg);

common/dev/tmp431.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ temp_mapping_register tmp432_temp_register_map[] = {
6464
};
6565

6666
bool get_tmp432_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
67-
uint32_t *millidegree_celsius)
67+
int32_t *millidegree_celsius)
6868
{
6969
CHECK_NULL_ARG_WITH_RETURN(cfg, false);
7070
CHECK_NULL_ARG_WITH_RETURN(millidegree_celsius, false);
@@ -84,8 +84,8 @@ bool get_tmp432_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
8484
return false;
8585
}
8686

87-
uint32_t limit_high_byte_val = (uint32_t)msg.data[0] * 1000;
88-
uint32_t limit_low_byte_val = ((msg.data[1] >> 4) * 625) / 10;
87+
int32_t limit_high_byte_val = (int8_t)msg.data[0] * 1000;
88+
int32_t limit_low_byte_val = (((int8_t)msg.data[1] >> 4) * 625) / 10;
8989
*millidegree_celsius = limit_high_byte_val + limit_low_byte_val;
9090

9191
return true;
@@ -119,7 +119,7 @@ bool get_tmp432_one_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
119119
}
120120

121121
bool tmp432_get_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
122-
uint32_t *millidegree_celsius)
122+
int32_t *millidegree_celsius)
123123
{
124124
CHECK_NULL_ARG_WITH_RETURN(cfg, false);
125125
CHECK_NULL_ARG_WITH_RETURN(millidegree_celsius, false);
@@ -165,7 +165,7 @@ bool tmp432_get_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
165165
}
166166

167167
bool set_tmp432_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
168-
uint32_t *millidegree_celsius)
168+
int32_t *millidegree_celsius)
169169
{
170170
CHECK_NULL_ARG_WITH_RETURN(cfg, false);
171171
CHECK_NULL_ARG_WITH_RETURN(millidegree_celsius, false);
@@ -177,10 +177,10 @@ bool set_tmp432_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
177177
msg.target_addr = cfg->target_addr;
178178
msg.tx_len = 3;
179179
msg.data[0] = register_high;
180-
msg.data[1] = (uint8_t)(*millidegree_celsius / 1000);
180+
msg.data[1] = (int8_t)(*millidegree_celsius / 1000);
181181

182-
uint32_t remainder = *millidegree_celsius % 1000;
183-
uint8_t low_byte_val = (uint8_t)((remainder * 16) / 1000);
182+
int32_t remainder = *millidegree_celsius % 1000;
183+
int8_t low_byte_val = (int8_t)((remainder * 16) / 1000);
184184
msg.data[2] = (low_byte_val << 4);
185185

186186
if (i2c_master_write(&msg, retry)) {

common/dev/tmp75.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
LOG_MODULE_REGISTER(tmp75);
2525

2626
bool get_tmp75_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
27-
uint32_t *millidegree_celsius)
27+
int32_t *millidegree_celsius)
2828
{
2929
CHECK_NULL_ARG_WITH_RETURN(cfg, false);
3030
CHECK_NULL_ARG_WITH_RETURN(millidegree_celsius, false);
@@ -43,16 +43,16 @@ bool get_tmp75_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
4343
return false;
4444
}
4545

46-
float limit_byte_1_val = (float)msg.data[0] * 1000.0;
47-
float limit_byte_2_val = (float)(msg.data[1] >> 4) * 0.0625;
46+
int32_t limit_byte_1_val = (int8_t)msg.data[0] * 1000.0;
47+
int32_t limit_byte_2_val = ((int8_t)msg.data[1] >> 4) * 62.5;
4848

49-
*millidegree_celsius = (uint32_t)limit_byte_1_val + limit_byte_2_val;
49+
*millidegree_celsius = limit_byte_1_val + limit_byte_2_val;
5050

5151
return true;
5252
}
5353

5454
bool tmp75_get_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
55-
uint32_t *millidegree_celsius)
55+
int32_t *millidegree_celsius)
5656
{
5757
CHECK_NULL_ARG_WITH_RETURN(cfg, false);
5858
CHECK_NULL_ARG_WITH_RETURN(millidegree_celsius, false);
@@ -76,7 +76,7 @@ bool tmp75_get_temp_threshold(sensor_cfg *cfg, uint8_t temp_threshold_index,
7676
}
7777

7878
bool set_tmp75_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
79-
uint32_t *millidegree_celsius)
79+
int32_t *millidegree_celsius)
8080
{
8181
CHECK_NULL_ARG_WITH_RETURN(cfg, false);
8282
CHECK_NULL_ARG_WITH_RETURN(millidegree_celsius, false);
@@ -85,12 +85,12 @@ bool set_tmp75_two_byte_limit(sensor_cfg *cfg, uint8_t temp_threshold_index,
8585
I2C_MSG msg = { 0 };
8686
msg.bus = cfg->port;
8787
msg.target_addr = cfg->target_addr;
88-
msg.tx_len = 2;
88+
msg.tx_len = 3;
8989
msg.data[0] = ((temp_threshold_index == LOCAL_HIGH_LIMIT) ? TMP75_LOCAL_HIGH_LIMIT_REG :
9090
TMP75_LOCAL_LOW_LIMIT_REG);
91-
msg.data[1] = (uint8_t)(*millidegree_celsius / 1000.0);
92-
uint32_t remainder = *millidegree_celsius % 1000;
93-
uint8_t low_byte_val = (uint8_t)((remainder * 16) / 1000);
91+
msg.data[1] = (int8_t)(*millidegree_celsius / 1000.0);
92+
int32_t remainder = *millidegree_celsius % 1000;
93+
int8_t low_byte_val = (int8_t)((remainder * 16) / 1000);
9494
msg.data[2] = (low_byte_val << 4);
9595

9696
if (i2c_master_write(&msg, retry)) {

0 commit comments

Comments
 (0)