GT: Support DVT board with different module#610
Conversation
Summary: - Due to DVT remove the i2c mux in front of the PCIe switch, add the PEX sensor table of DVT to support. - Use revision id to distinguish the different stages and load the appropriate sensor table. - Use ADC to distinguish different types of HSC, VR, and the power monitor IC. Test Plan: - Build code: Pass
e0788fe to
8514b56
Compare
|
|
||
| // Read ADC raw value | ||
| reg_value = sys_read32(AST1030_ADC_BASE_ADDR + adc_info[channel].offset); | ||
| raw_value = (reg_value >> adc_info[channel].shift) & 0x3FF; // 10-bit(0x3FF) resolution |
There was a problem hiding this comment.
Can we make a #define for 0x3FF at the top.
| __func__, cfg->num); | ||
| if (!cfg->pre_sensor_read_hook(cfg->num, | ||
| cfg->pre_sensor_read_args)) { | ||
| LOG_ERR("[%s]sensor 0x%x pre sensor read failed!", __func__, |
There was a problem hiding this comment.
func can be removed, it's implicit in the debug output depending on the setting when the image is built.
| } | ||
| } | ||
| if (pex89000_init(sensor_num) != SENSOR_INIT_SUCCESS) { | ||
| LOG_ERR("[%s]sensor 0x%x init fail", __func__, cfg->num); |
There was a problem hiding this comment.
func can be removed, it's implicit in the debug output depending on the setting when the image is built.
| sensor_num); | ||
| if (!cfg->post_sensor_read_hook(sensor_num, | ||
| cfg->post_sensor_read_args, NULL)) { | ||
| LOG_ERR("[%s]sensor number 0x%x post_read fail\n", __func__, |
There was a problem hiding this comment.
func can be removed, it's implicit in the debug output depending on the setting when the image is built.
There was a problem hiding this comment.
Also newline shouldn't be needed unless we want to add an additional newline, otherwise one is automatically added.
| uint8_t stage = get_stage_by_rev_id(); | ||
|
|
||
| if (stage == EVT) { | ||
| LOG_INF(" The board is on EVT stage"); |
There was a problem hiding this comment.
The board is in EVT stage
| float voltage_power_ic_type_adc = 0; | ||
|
|
||
| if (!get_adc_voltage(POWER_IC_TYPE_ADC_CHANNEL, &voltage_power_ic_type_adc)) { | ||
| LOG_ERR("Fail to get power monitor IC type by ADC"); |
|
|
||
| if (i2c_master_write(&msg, retry)) { | ||
| printf("[%s]Change i2c mux channel on bus 6 failed\n", __func__); | ||
| LOG_ERR("[%s]Change i2c mux channel on bus 6 failed", __func__); |
|
|
||
| if (i2c_master_read(&msg, retry)) { | ||
| printf("[%s]Failed to read VR IC_DEVICE_ID\n", __func__); | ||
| LOG_ERR("[%s]Failed to read VR IC_DEVICE_ID", __func__); |
| } | ||
|
|
||
| printf("[%s] unsupported VR type\n", __func__); | ||
| LOG_ERR("[%s]Unsupported VR type", __func__); |
| uint8_t index = ((sensor_num & BIT_MASK(4)) / 4); | ||
|
|
||
| return !gpio_get(e1s_prsnt_pin[group][index]) ? true : false; | ||
| return (!gpio_get(e1s_prsnt_pin[group][index]) && is_mb_dc_on()); |
|
@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: - Remove func print in the log - Remove newline use in log print. - Add print function prefix configuration in prj.conf for warning and error log message. Test plan: - Build code: Pass
|
@Quanta-YangChen has updated the pull request. You must reimport the pull request before landing. |
|
@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: - Change MPS5990 sensor reading accuracy formula. - Add LTC4282 sensor reading accuracy formula. - Change LTC4282 r_sense_mohm and ilim_adjust. Pull Request resolved: #611 Test Plan: - Build code: Pass Dependency: #610 Reviewed By: garnermic Differential Revision: D40035935 Pulled By: garnermic fbshipit-source-id: aac70dc34176d641ba96a63957301c5338225ede
Summary:
Test Plan: