Skip to content

Commit c5a864e

Browse files
committed
board input power: reduce SMBus transfer size from 32 to 16 bits
Omit the fractional part from board input power and send it from BMC FW to SMC FW as a SMBus word write rather than a block write. Signed-off-by: Petra Alexson <[email protected]>
1 parent b85a8a7 commit c5a864e

File tree

10 files changed

+18
-356
lines changed

10 files changed

+18
-356
lines changed

app/dmc/src/main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,11 @@ void ina228_power_update(void)
134134
sensor_sample_fetch_chan(ina228, SENSOR_CHAN_POWER);
135135
sensor_channel_get(ina228, SENSOR_CHAN_POWER, &sensor_val);
136136

137-
int32_t power = (sensor_val.val1 << 16) + (sensor_val.val2 * 65536ULL) / 1000000ULL;
137+
/* Only use integer part of sensor value */
138+
int16_t power = sensor_val.val1 & 0xFFFF;
138139

139140
ARRAY_FOR_EACH_PTR(BH_CHIPS, chip) {
140-
bh_chip_set_input_power(chip, &power);
141+
bh_chip_set_input_power(chip, power);
141142
}
142143
}
143144

include/tenstorrent/bh_chip.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ void bh_chip_cancel_bus_transfer_clear(struct bh_chip *chip);
116116

117117
cm2dmMessageRet bh_chip_get_cm2dm_message(struct bh_chip *chip);
118118
int bh_chip_set_static_info(struct bh_chip *chip, dmStaticInfo *info);
119-
int bh_chip_set_input_current(struct bh_chip *chip, int32_t *current);
120-
int bh_chip_set_input_power(struct bh_chip *chip, uint32_t *power);
119+
int bh_chip_set_input_power(struct bh_chip *chip, uint16_t power);
121120
int bh_chip_set_input_power_lim(struct bh_chip *chip, uint16_t max_power);
122121
int bh_chip_set_fan_rpm(struct bh_chip *chip, uint16_t rpm);
123122

lib/tenstorrent/bh_arc/cm2bm_msg.c

Lines changed: 0 additions & 275 deletions
This file was deleted.

lib/tenstorrent/bh_arc/cm2bm_msg.h

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)