peci: Check FINISH for completed transaction

Per the IT5570E datasheet, FINISH should be used to check if a
transaction completed, not HOBY.

> For the polling mode, software continues reading the Host Status
> Register to check whether the transaction is completed or not (the
> Finish bit in the Host Status Register will be set when the
> transaction is completed).

Ref: IT5570E V0.3.2 datasheet
Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
Tim Crawford
2023-02-17 13:38:51 -07:00
committed by Jeremy Soller
parent dd97946056
commit 3dde812dba

View File

@ -295,8 +295,8 @@ bool peci_get_temp(int16_t *data) {
// Start transaction
HOCTLR |= 1;
// Wait for completion
while (HOSTAR & 1) {}
// Wait for command completion
while (!(HOSTAR & BIT(1))) {}
uint8_t status = HOSTAR;
if (status & 0xEC) {
@ -346,8 +346,8 @@ int16_t peci_wr_pkg_config(uint8_t index, uint16_t param, uint32_t data) {
// Start transaction
HOCTLR |= 1;
// Wait for completion
while (HOSTAR & 1) {}
// Wait for command completion
while (!(HOSTAR & BIT(1))) {}
uint8_t status = HOSTAR;
if (status & 0xEC) {