main_v2 - fby3.5: cl: Support TMP431 sensor reading#231
Conversation
|
@GoldenBug has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
|
||
| static uint8_t temperature_range = 0xFF; | ||
|
|
||
| uint8_t tmp431_read(uint8_t sensor_num, int *reading) |
There was a problem hiding this comment.
Should we check to see if sensor_num is in a valid range?
0 <= sensor_num < MAX_NUM_SENSORS ?
There was a problem hiding this comment.
We have fixed this and do the forced update.
The sensor_num is unsigned type so only judge if it's less than MAX_NUM_SENSORS.
Please review it. Thanks.
| return SENSOR_READ_SUCCESS; | ||
| } | ||
|
|
||
| uint8_t tmp431_init(uint8_t sensor_num) |
There was a problem hiding this comment.
Same, check if sensor_num is in valid range?
There was a problem hiding this comment.
We have fixed this and do the forced update.
The sensor_num is unsigned type so only judge if it's less than MAX_NUM_SENSORS.
Please review it. Thanks.
| while (sensor_count != 0) { | ||
| add_sensor_config( | ||
| evt3_class1_adi_temperature_sensor_table[--sensor_count]); | ||
| if (sensor_count == 0) { | ||
| break; | ||
| } | ||
| } |
There was a problem hiding this comment.
This seems like it might be better as a for loop?
There was a problem hiding this comment.
We have fixed this and do the forced update.
Please review it. Thanks.
Summary: - Support MP5990 sensor device Test Plan: 1. Build code: pass 2. [MPS] Check GPIOA7 and the MP5990 configure register(38h and 46h) 3. [MPS] Get MP5990 sensor reading: pass 4. [ADI] Get ADM1278 sensor reading: pass Log: 1. Class type: class-1, 1ou present status: false, 2ou present status: true, board revision: EVT3(EFUSE) root@bmc-oob:/root# bic-util slot1 --get_gpio|grep "HSC_SET_EN_R" 7 HSC_SET_EN_R: 1 root@bmc-oob:/root# bic-util slot1 0x18 0x52 0x5 0x16 0x2 0x38 BF 01 root@bmc-oob:/root# bic-util slot1 0x18 0x52 0x5 0x16 0x2 0x46 46 00 root@bmc-oob:/root# sensor-util slot1|grep HSC HSC Temp (0xE) : 25.00 C | (ok) HSC Input Vol (0x29) : 12.31 Volts | (ok) HSC Output Cur (0x30) : 0.25 Amps | (ok) HSC Input Pwr (0x39) : 0.00 Watts | (ok) 2. Class type: class-1, 1ou present status: false, 2ou present status: false, board revision: EVT3(EFUSE) root@bmc-oob:/root# bic-util slot1 --get_gpio|grep "HSC_SET_EN_R" 7 HSC_SET_EN_R: 0 root@bmc-oob:/root# bic-util slot1 0x18 0x52 0x5 0x16 0x2 0x46 28 00 root@bmc-oob:/root# bic-util slot1 0x18 0x52 0x5 0x16 0x2 0x38 04 01 root@bmc-oob:/root# sensor-util slot1|grep HSC HSC Temp (0xE) : 25.00 C | (ok) HSC Input Vol (0x29) : 12.44 Volts | (ok) HSC Output Cur (0x30) : 0.25 Amps | (ok) HSC Input Pwr (0x39) : 0.00 Watts | (ok) 3. Class type: class-1, 1ou present status: false, 2ou present status:false, board revision: POC root@bmc-oob:/root# sensor-util slot3|grep HSC HSC Temp (0xE) : 27.62 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 10.52 Amps | (ok) HSC Input Pwr (0x39) : 129.35 Watts | (ok)
Summary: - K_WORK_DELAYABLE_DEFINE needs a callback function with the function parameter type of "struct k_work *". - util_spi.c had a missing header that needed to be included as well as an improperly formatted print statement. - Mark card_type_1ou that is currently unused in Yv3.5 CL as unused to silence compiler warnings. - Initialized status in fall through case. Test Plan: - Build code: Pass
2a31d22 to
106d184
Compare
|
@DelphineChiu has updated the pull request. You must reimport the pull request before landing. |
Summary: - Support TMP431 sensor device For EVT3 ADI system, the "HSC Temp" and "MB Outlet Temp" should be read from TMP431 chip. For EVT3 MPS system, the "HSC Temp" sensor value is read from MP5990 and "MB Outlet Temp" is read from TMP75. Test Plan: 1. Build code: pass 2. [EVT3 MPS] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass 3. [EVT3 ADI] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass 4. [POC] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass Log: 1. Class type: class-1, 1ou present status: false, 2ou present status: true, board revision: EVT3(ADI) root@bmc-oob:~# sensor-util slot1|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 25.44 C | (ok) HSC Temp (0xE) : 23.81 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 0.28 Amps | (ok) HSC Input Pwr (0x39) : 3.53 Watts | (ok) 2. Class type: class-1, 1ou present status: false, 2ou present status: false, board revision: EVT3(MPS) root@bmc-oob:~# sensor-util slot1|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 24.00 C | (ok) HSC Temp (0xE) : 25.00 C | (ok) HSC Input Vol (0x29) : 12.22 Volts | (ok) HSC Output Cur (0x30) : 0.25 Amps | (ok) HSC Input Pwr (0x39) : 6.00 Watts | (ok) 3. Class type: class-1, 1ou present status: false, 2ou present status:false, board revision: POC root@bmc-oob:~# sensor-util slot3|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 33.00 C | (ok) HSC Temp (0xE) : 29.52 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 8.82 Amps | (ok) HSC Input Pwr (0x39) : 108.70 Watts | (ok)
106d184 to
9517f23
Compare
|
@DelphineChiu 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: fby3.5: cl: Support TMP431 sensor reading - Support TMP431 sensor device For EVT3 ADI system, the "HSC Temp" and "MB Outlet Temp" should be read from TMP431 chip. For EVT3 MPS system, the "HSC Temp" sensor value is read from MP5990 and "MB Outlet Temp" is read from TMP75. Dependency: #230 Pull Request resolved: #231 Test Plan: 1. Build code: pass 2. [EVT3 MPS] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass 3. [EVT3 ADI] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass 4. [POC] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass Log: 1. Class type: class-1, 1ou present status: false, 2ou present status: true, board revision: EVT3(ADI) root@bmc-oob:~# sensor-util slot1|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 25.44 C | (ok) HSC Temp (0xE) : 23.81 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 0.28 Amps | (ok) HSC Input Pwr (0x39) : 3.53 Watts | (ok) 2. Class type: class-1, 1ou present status: false, 2ou present status: false, board revision: EVT3(MPS) root@bmc-oob:~# sensor-util slot1|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 24.00 C | (ok) HSC Temp (0xE) : 25.00 C | (ok) HSC Input Vol (0x29) : 12.22 Volts | (ok) HSC Output Cur (0x30) : 0.25 Amps | (ok) HSC Input Pwr (0x39) : 6.00 Watts | (ok) 3. Class type: class-1, 1ou present status: false, 2ou present status:false, board revision: POC root@bmc-oob:~# sensor-util slot3|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 33.00 C | (ok) HSC Temp (0xE) : 29.52 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 8.82 Amps | (ok) HSC Input Pwr (0x39) : 108.70 Watts | (ok) Reviewed By: zhdaniel12 Differential Revision: D35679335 Pulled By: GoldenBug fbshipit-source-id: b84692aaec201e3b3271b948c6cbba3df951bd5a
Summary: Add Zephyr Kernel patches - Add Zephyr Kernel patches 1. drivers: ipmb: Extend the ipmb buffer 2. drivers: i2c: Correct the timeout time as 35ms 3. peci: aspeed: Avoid race condition of accessing peci device. Dependency: PR #231 Pull Request resolved: #232 Test Plan: 1. Build code: pass Reviewed By: zhdaniel12 Differential Revision: D35679336 Pulled By: GoldenBug fbshipit-source-id: 4167f89796b0151692da1b3fb645db86baf8dcab
|
close the PR since the codes have been merged |
Summary: fby3.5: cl: Support TMP431 sensor reading - Support TMP431 sensor device For EVT3 ADI system, the "HSC Temp" and "MB Outlet Temp" should be read from TMP431 chip. For EVT3 MPS system, the "HSC Temp" sensor value is read from MP5990 and "MB Outlet Temp" is read from TMP75. Dependency: #230 Pull Request resolved: #231 Test Plan: 1. Build code: pass 2. [EVT3 MPS] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass 3. [EVT3 ADI] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass 4. [POC] Check "HSC Temp" and "MB Outlet Temp" sensor reading: pass Log: 1. Class type: class-1, 1ou present status: false, 2ou present status: true, board revision: EVT3(ADI) root@bmc-oob:~# sensor-util slot1|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 25.44 C | (ok) HSC Temp (0xE) : 23.81 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 0.28 Amps | (ok) HSC Input Pwr (0x39) : 3.53 Watts | (ok) 2. Class type: class-1, 1ou present status: false, 2ou present status: false, board revision: EVT3(MPS) root@bmc-oob:~# sensor-util slot1|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 24.00 C | (ok) HSC Temp (0xE) : 25.00 C | (ok) HSC Input Vol (0x29) : 12.22 Volts | (ok) HSC Output Cur (0x30) : 0.25 Amps | (ok) HSC Input Pwr (0x39) : 6.00 Watts | (ok) 3. Class type: class-1, 1ou present status: false, 2ou present status:false, board revision: POC root@bmc-oob:~# sensor-util slot3|grep "HSC\|MB Outlet Temp" MB Outlet Temp (0x2) : 33.00 C | (ok) HSC Temp (0xE) : 29.52 C | (ok) HSC Input Vol (0x29) : 12.00 Volts | (ok) HSC Output Cur (0x30) : 8.82 Amps | (ok) HSC Input Pwr (0x39) : 108.70 Watts | (ok) Reviewed By: garnermic Differential Revision: D35941595 Pulled By: GoldenBug fbshipit-source-id: 0914d4531c7d8c105518ea5c62391e9b8e17b608
Summary: Add Zephyr Kernel patches - Add Zephyr Kernel patches 1. drivers: ipmb: Extend the ipmb buffer 2. drivers: i2c: Correct the timeout time as 35ms 3. peci: aspeed: Avoid race condition of accessing peci device. Dependency: PR #231 Pull Request resolved: #232 Test Plan: 1. Build code: pass Reviewed By: garnermic Differential Revision: D35941592 Pulled By: GoldenBug fbshipit-source-id: b92f44bfa44451e8a9aa6dafd5fdf12fc12292a0
fby3.5: cl: Support TMP431 sensor reading
Summary:
Support TMP431 sensor device
For EVT3 ADI system, the "HSC Temp" and "MB Outlet Temp" should be read from TMP431 chip.
For EVT3 MPS system, the "HSC Temp" sensor value is read from MP5990 and "MB Outlet Temp" is read from TMP75.
Dependency: main_v2 - fby3.5: cl: Fixing warning messages #230
Test Plan:
Log:
Class type: class-1, 1ou present status: false, 2ou present status: true, board revision: EVT3(ADI)
root@bmc-oob:~# sensor-util slot1|grep "HSC|MB Outlet Temp"
MB Outlet Temp (0x2) : 25.44 C | (ok)
HSC Temp (0xE) : 23.81 C | (ok)
HSC Input Vol (0x29) : 12.00 Volts | (ok)
HSC Output Cur (0x30) : 0.28 Amps | (ok)
HSC Input Pwr (0x39) : 3.53 Watts | (ok)
Class type: class-1, 1ou present status: false, 2ou present status: false, board revision: EVT3(MPS)
root@bmc-oob:~# sensor-util slot1|grep "HSC|MB Outlet Temp"
MB Outlet Temp (0x2) : 24.00 C | (ok)
HSC Temp (0xE) : 25.00 C | (ok)
HSC Input Vol (0x29) : 12.22 Volts | (ok)
HSC Output Cur (0x30) : 0.25 Amps | (ok)
HSC Input Pwr (0x39) : 6.00 Watts | (ok)
Class type: class-1, 1ou present status: false, 2ou present status:false, board revision: POC
root@bmc-oob:~# sensor-util slot3|grep "HSC|MB Outlet Temp"
MB Outlet Temp (0x2) : 33.00 C | (ok)
HSC Temp (0xE) : 29.52 C | (ok)
HSC Input Vol (0x29) : 12.00 Volts | (ok)
HSC Output Cur (0x30) : 8.82 Amps | (ok)
HSC Input Pwr (0x39) : 108.70 Watts | (ok)