Skip to content

Commit e868817

Browse files
committed
bh_arc: telemetry: hide input current telemetry entry and SMBus handler
As SMC FW will now only receive input power readings from BMC FW and input current won't be updated, hide the INPUT_CURRENT entry in the telemetry table. Remove SMBus handler that receives input current. Signed-off-by: Petra Alexson <[email protected]>
1 parent fabeb81 commit e868817

File tree

6 files changed

+19
-51
lines changed

6 files changed

+19
-51
lines changed

lib/tenstorrent/bh_arc/cm2bm_msg.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
#include <string.h>
14+
#include <zephyr/sys/byteorder.h>
1415
#include <zephyr/kernel.h>
1516
#include <tenstorrent/msg_type.h>
1617
#include <tenstorrent/msgqueue.h>
@@ -229,7 +230,7 @@ int32_t Bm2CmSendCurrentHandler(const uint8_t *data, uint8_t size)
229230
return -1;
230231
}
231232

232-
current = UNALIGNED_GET((uint32_t *)data);
233+
power = sys_get_le32(data) * 12;
233234

234235
return 0;
235236
}
@@ -240,7 +241,7 @@ int32_t Bm2CmSendPwrHandler(const uint8_t *data, uint8_t size)
240241
return -1;
241242
}
242243

243-
power = UNALIGNED_GET((uint32_t *)data);
244+
power = sys_get_le32(data);
244245

245246
return 0;
246247
}

lib/tenstorrent/bh_arc/cm2dm_msg.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ typedef struct {
2828

2929
static Cm2DmMsgState cm2dm_msg_state;
3030
static bool dmfw_ping_valid;
31-
static int32_t current;
3231
static uint32_t power;
3332
K_MSGQ_DEFINE(cm2dm_msg_q, sizeof(Cm2DmMsg), 4, _Alignof(Cm2DmMsg));
3433

@@ -231,17 +230,6 @@ int32_t Dm2CmPingHandler(const uint8_t *data, uint8_t size)
231230
return 0;
232231
}
233232

234-
int32_t Dm2CmSendCurrentHandler(const uint8_t *data, uint8_t size)
235-
{
236-
if (size != 4) {
237-
return -1;
238-
}
239-
240-
current = *(int32_t *)data;
241-
242-
return 0;
243-
}
244-
245233
int32_t Dm2CmSendPwrHandler(const uint8_t *data, uint8_t size)
246234
{
247235
if (size != 4) {
@@ -254,10 +242,6 @@ int32_t Dm2CmSendPwrHandler(const uint8_t *data, uint8_t size)
254242
}
255243

256244
/* TODO: Put these somewhere else? */
257-
int32_t GetInputCurrent(void)
258-
{
259-
return current;
260-
}
261245

262246
uint32_t GetInputPower(void)
263247
{

lib/tenstorrent/bh_arc/smbus_target.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ static SmbusConfig smbus_config = {
168168
[0x21] = {.valid = 1,
169169
.trans_type = kSmbusTransWriteWord,
170170
.handler = {.rcv_handler = &Dm2CmPingHandler}},
171-
[0x22] = {.valid = 1,
172-
.trans_type = kSmbusTransBlockWrite,
173-
.expected_blocksize = 4,
174-
.handler = {.rcv_handler = &Dm2CmSendCurrentHandler}},
175171
[0x23] = {.valid = 1,
176172
.trans_type = kSmbusTransWriteWord,
177173
.handler = {.rcv_handler = &Dm2CmSendFanRPMHandler}},

lib/tenstorrent/bh_arc/telemetry.c

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,6 @@ static void update_telemetry(void)
263263
telemetry[FAN_RPM] = GetFanRPM(); /* Actual fan RPM */
264264
UpdateGddrTelemetry();
265265
telemetry[MAX_GDDR_TEMP] = GetMaxGDDRTemp();
266-
telemetry[INPUT_CURRENT] =
267-
GetInputCurrent(); /* Input current - reported in A in signed int 16.16 format */
268266
telemetry[INPUT_POWER] =
269267
GetInputPower(); /* Input power - reported in W in unsigned int 16.16 format */
270268
telemetry[TIMER_HEARTBEAT]++; /* Incremented every time the timer is called */
@@ -310,23 +308,22 @@ static void update_tag_table(void)
310308
tag_table[34] = (struct telemetry_entry){TAG_ENABLED_GDDR, ENABLED_GDDR};
311309
tag_table[35] = (struct telemetry_entry){TAG_ENABLED_L2CPU, ENABLED_L2CPU};
312310
tag_table[36] = (struct telemetry_entry){TAG_PCIE_USAGE, PCIE_USAGE};
313-
tag_table[37] = (struct telemetry_entry){TAG_INPUT_CURRENT, INPUT_CURRENT};
314-
tag_table[38] = (struct telemetry_entry){TAG_NOC_TRANSLATION, NOC_TRANSLATION};
315-
tag_table[39] = (struct telemetry_entry){TAG_FAN_RPM, FAN_RPM};
316-
tag_table[40] = (struct telemetry_entry){TAG_GDDR_0_1_TEMP, GDDR_0_1_TEMP};
317-
tag_table[41] = (struct telemetry_entry){TAG_GDDR_2_3_TEMP, GDDR_2_3_TEMP};
318-
tag_table[42] = (struct telemetry_entry){TAG_GDDR_4_5_TEMP, GDDR_4_5_TEMP};
319-
tag_table[43] = (struct telemetry_entry){TAG_GDDR_6_7_TEMP, GDDR_6_7_TEMP};
320-
tag_table[44] = (struct telemetry_entry){TAG_GDDR_0_1_CORR_ERRS, GDDR_0_1_CORR_ERRS};
321-
tag_table[45] = (struct telemetry_entry){TAG_GDDR_2_3_CORR_ERRS, GDDR_2_3_CORR_ERRS};
322-
tag_table[46] = (struct telemetry_entry){TAG_GDDR_4_5_CORR_ERRS, GDDR_4_5_CORR_ERRS};
323-
tag_table[47] = (struct telemetry_entry){TAG_GDDR_6_7_CORR_ERRS, GDDR_6_7_CORR_ERRS};
324-
tag_table[48] = (struct telemetry_entry){TAG_GDDR_UNCORR_ERRS, GDDR_UNCORR_ERRS};
325-
tag_table[49] = (struct telemetry_entry){TAG_MAX_GDDR_TEMP, MAX_GDDR_TEMP};
326-
tag_table[50] = (struct telemetry_entry){TAG_ASIC_LOCATION, ASIC_LOCATION};
327-
tag_table[51] = (struct telemetry_entry){TAG_BOARD_PWR_LIMIT, BOARD_PWR_LIMIT};
328-
tag_table[52] = (struct telemetry_entry){TAG_INPUT_POWER, INPUT_POWER};
329-
tag_table[53] = (struct telemetry_entry){TAG_TELEM_ENUM_COUNT, TELEM_ENUM_COUNT};
311+
tag_table[37] = (struct telemetry_entry){TAG_NOC_TRANSLATION, NOC_TRANSLATION};
312+
tag_table[38] = (struct telemetry_entry){TAG_FAN_RPM, FAN_RPM};
313+
tag_table[39] = (struct telemetry_entry){TAG_GDDR_0_1_TEMP, GDDR_0_1_TEMP};
314+
tag_table[40] = (struct telemetry_entry){TAG_GDDR_2_3_TEMP, GDDR_2_3_TEMP};
315+
tag_table[41] = (struct telemetry_entry){TAG_GDDR_4_5_TEMP, GDDR_4_5_TEMP};
316+
tag_table[42] = (struct telemetry_entry){TAG_GDDR_6_7_TEMP, GDDR_6_7_TEMP};
317+
tag_table[43] = (struct telemetry_entry){TAG_GDDR_0_1_CORR_ERRS, GDDR_0_1_CORR_ERRS};
318+
tag_table[44] = (struct telemetry_entry){TAG_GDDR_2_3_CORR_ERRS, GDDR_2_3_CORR_ERRS};
319+
tag_table[45] = (struct telemetry_entry){TAG_GDDR_4_5_CORR_ERRS, GDDR_4_5_CORR_ERRS};
320+
tag_table[46] = (struct telemetry_entry){TAG_GDDR_6_7_CORR_ERRS, GDDR_6_7_CORR_ERRS};
321+
tag_table[47] = (struct telemetry_entry){TAG_GDDR_UNCORR_ERRS, GDDR_UNCORR_ERRS};
322+
tag_table[48] = (struct telemetry_entry){TAG_MAX_GDDR_TEMP, MAX_GDDR_TEMP};
323+
tag_table[49] = (struct telemetry_entry){TAG_ASIC_LOCATION, ASIC_LOCATION};
324+
tag_table[50] = (struct telemetry_entry){TAG_BOARD_PWR_LIMIT, BOARD_PWR_LIMIT};
325+
tag_table[51] = (struct telemetry_entry){TAG_INPUT_POWER, INPUT_POWER};
326+
tag_table[52] = (struct telemetry_entry){TAG_TELEM_ENUM_COUNT, TELEM_ENUM_COUNT};
330327
}
331328

332329
/* Handler functions for zephyr timer and worker objects */

lib/tenstorrent/bh_arc/telemetry.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ typedef enum {
123123
/* Board telemetry */
124124
FAN_SPEED,
125125
FAN_RPM,
126-
INPUT_CURRENT,
127126
BOARD_PWR_LIMIT,
128127
INPUT_POWER,
129128

lib/tenstorrent/bh_chip/bh_chip.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ int bh_chip_set_static_info(struct bh_chip *chip, dmStaticInfo *info)
5858
return ret;
5959
}
6060

61-
int bh_chip_set_input_current(struct bh_chip *chip, int32_t *current)
62-
{
63-
int ret;
64-
65-
ret = bharc_smbus_block_write(&chip->config.arc, 0x22, 4, (uint8_t *)current);
66-
67-
return ret;
68-
}
69-
7061
int bh_chip_set_input_pwr(struct bh_chip *chip, uint32_t *power)
7162
{
7263
int ret;

0 commit comments

Comments
 (0)