Skip to content

sb: rb: Add i2c target power capping write/read polling rate function and fix adc current issue#2666

Open
khoung76642 wants to merge 8 commits intofacebook:mainfrom
khoung76642:upcode_20260501
Open

sb: rb: Add i2c target power capping write/read polling rate function and fix adc current issue#2666
khoung76642 wants to merge 8 commits intofacebook:mainfrom
khoung76642:upcode_20260501

Conversation

@khoung76642
Copy link
Contributor

Summary:

  • add more tpye of power capping sensor polling rate type
    -For source from VR:

    0 - Poll MEDHA0/1_VDD power every 10ms (default)
    1 - Poll MEDHA0/1_VDD power every 5ms
    2 - Poll MEDHA0/1_VDD power every 2ms
    3 - Poll MEDHA0/1_VDD power every 1ms
    4 - Poll MEDHA0/1_VDD power every 2ms, VDDQC0246/VDDQC1357 power every 10ms
    5 - Poll MEDHA0/1_VDD power every 5ms, VDDQC0246/VDDQC1357 power every 10ms
    6 - Poll MEDHA0/1_VDD power every 5ms, VDDQC0246/VDDQC1357 power every 5ms
    7 - Poll MEDHA0/1_VDD power every 2ms, VDDQC0246/VDDQC1357 power every 10ms, OWL_E_VDD/OWL_W_VDD/HAMSA_VDD power every 100ms
    

    -For source from ADC:

    0 - Poll MEDHA0/1_VDD voltage every 10ms (default)
    1 - Poll MEDHA0/1_VDD voltage every 5ms
    2 - Poll MEDHA0/1_VDD voltage every 2ms
    3 - Poll MEDHA0/1_VDD voltage every 1ms
    4 - Poll MEDHA0/1_VDD voltage every 2ms, VDDQC0246/VDDQC1357 power every 10ms
    5 - Poll MEDHA0/1_VDD voltage every 5ms, VDDQC0246/VDDQC1357 power every 10ms
    6 - Poll MEDHA0/1_VDD voltage every 5ms, VDDQC0246/VDDQC1357 power every 5ms
    7 - Poll MEDHA0/1_VDD voltage every 2ms, VDDQC0246/VDDQC1357 power every 10ms,      OWL_E_VDD/OWL_W_VDD/HAMSA_VDD power every 100ms
    
  • modified cli cmd for setting power capping polling rate in type 0~3

  • fix power capping polling rate bug

  • modified get_fw_version cli command composing

  • display VR rail name in addition to checksum in BMC printout(T17CISB-1083)

  • add i2c target power capping write/read polling rate function

  • fix pldm data size overflow issue

  • set pldm data size max value from 1300 -> 1450

  • fix gpio define error

  • fix ADC current leak issue

  • optimize power capping timing

  • add i2c connection for MEDHA0/1 to MMC information in platform info cli command

Test Plan:

  • Build code: Pass

Kevin Huang and others added 8 commits February 2, 2026 10:45
Summary:
- add more tpye of power capping sensor polling rate type
	-For source from VR:

	  0 - Poll MEDHA0/1_VDD power every 10ms (default)
	  1 - Poll MEDHA0/1_VDD power every 5ms
	  2 - Poll MEDHA0/1_VDD power every 2ms
	  3 - Poll MEDHA0/1_VDD power every 1ms
	  4 - Poll MEDHA0/1_VDD power every 2ms, VDDQC0246/VDDQC1357 power every 10ms
	  5 - Poll MEDHA0/1_VDD power every 5ms, VDDQC0246/VDDQC1357 power every 10ms
	  6 - Poll MEDHA0/1_VDD power every 5ms, VDDQC0246/VDDQC1357 power every 5ms
	  7 - Poll MEDHA0/1_VDD power every 2ms, VDDQC0246/VDDQC1357 power every 10ms, OWL_E_VDD/OWL_W_VDD/HAMSA_VDD power every 100ms
	 -For source from ADC:

	  0 - Poll MEDHA0/1_VDD voltage every 10ms (default)
	  1 - Poll MEDHA0/1_VDD voltage every 5ms
	  2 - Poll MEDHA0/1_VDD voltage every 2ms
	  3 - Poll MEDHA0/1_VDD voltage every 1ms
	  4 - Poll MEDHA0/1_VDD voltage every 2ms, VDDQC0246/VDDQC1357 power every 10ms
	  5 - Poll MEDHA0/1_VDD voltage every 5ms, VDDQC0246/VDDQC1357 power every 10ms
	  6 - Poll MEDHA0/1_VDD voltage every 5ms, VDDQC0246/VDDQC1357 power every 5ms
	  7 - Poll MEDHA0/1_VDD voltage every 2ms, VDDQC0246/VDDQC1357 power every 10ms, OWL_E_VDD/OWL_W_VDD/HAMSA_VDD power every 100ms
- modified cli cmd for setting power capping polling rate in type 0~3

Test Plan:
- Build code: Pass
…in BMC printout

Summary:
- fix power capping polling rate bug
- modified get_fw_version cli command composing
- Display VR rail name in addition to checksum in BMC printout(T17CISB-1083)

Test Plan:
- Build code: Pass
Summary:
- add i2c target power capping write/read polling rate function
- fix pldm data size overflow issue
- set pldm data size max value from 1300 -> 1450
- fix gpio define error

Test Plan:
- Build code: Pass
Summary:
- Fix ADC current leak issue
- Optimize power capping timing

Test Plan:
- Build code: Pass
Summary:
- Fix ADC current leak issue

Test Plan:
- Build code: Pass
Summary:
- Version commit for sb-rb-20260501

Test Plan:
Build code: Pass
Check BIC version: Pass
@meta-cla meta-cla 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 Feb 5, 2026
@khoung76642
Copy link
Contributor Author

*Regarding the following errors, we have checked and confirmed that they are from common code, which will be redefined by users in the platform code:
common/service/sensor/pldm_sensor.c:145:50:Condition 'sensor_pdr_index>=pldm_sensor_count' is always true
common/service/sensor/pldm_sensor.c:448:24:Condition 'pldm_sensor_count<=0' is always true
common/service/sensor/pldm_sensor.c:455:34:Condition 'pldm_sensor_list[thread_id]==NULL' is always true
common/service/sensor/pldm_sensor.c:529:13:Condition 'stack==NULL' is always true
common/service/sensor/pldm_sensor.c:534:9:Redundant initialization for 'stack'. The initialized value is overwritten before it is read.
common/service/sensor/pldm_sensor.c:535:14:Redundant initialization for 'stack_size'. The initialized value is overwritten before it is read.
common/service/pldm/pldm_firmware_update.c:1778:4:The buffer 'data' may not be null-terminated after the call to strncpy().
common/service/pldm/pldm_firmware_update.c:688:19:Variable 'extra_data' can be declared as pointer to const
common/service/pldm/pldm_firmware_update.c:1279:37:Variable 'req_p' can be declared as pointer to const
common/service/pldm/pldm_firmware_update.c:1443:11:Variable 'resp_end' can be declared as pointer to const
common/service/pldm/pldm_firmware_update.c:1102:19:Condition 'check_result!=PLDM_SUCCESS' is always false

*Since the SPI device behavior varies based on different definitions, this is expected.
meta-facebook/sb-rb/src/platform/plat_pldm_fw_update.c:1280:24:Local variable 'i2c_dev' shadows outer variable

*We already check whether the data is NULL at the beginning of the function, so this error should not occur.
meta-facebook/sb-rb/src/platform/plat_pldm_fw_update.c:716:9:Possible null pointer dereference: data

@meta-codesync
Copy link

meta-codesync bot commented Feb 5, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D92371428. (Because this pull request was imported automatically, there will not be any future comments.)

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants