Skip to content

GT: Support DVT board with different module#610

Closed
Quanta-YangChen wants to merge 2 commits into
facebook:mainfrom
Quanta-YangChen:gt/support_dvt_board
Closed

GT: Support DVT board with different module#610
Quanta-YangChen wants to merge 2 commits into
facebook:mainfrom
Quanta-YangChen:gt/support_dvt_board

Conversation

@Quanta-YangChen

Copy link
Copy Markdown
Collaborator

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
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 30, 2022
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

// 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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__,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func can be removed, it's implicit in the debug output depending on the setting when the image is built.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failed


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__);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func can be removed


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__);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func can be removed

}

printf("[%s] unsupported VR type\n", __func__);
LOG_ERR("[%s]Unsupported VR type", __func__);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func can be removed

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());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

func can be removed

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@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
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@Quanta-YangChen has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot pushed a commit that referenced this pull request Oct 11, 2022
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
@Quanta-YangChen Quanta-YangChen deleted the gt/support_dvt_board branch October 11, 2022 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

3 participants