Skip to content

Commit 617bf57

Browse files
kikkiakkicfriedt
authored andcommitted
bh_arc: add board power limit to telemetry table
Add BOARD_PWR_LIMIT telemetry field. Whenever board power limit is received from BMC FW, update it in the telemetry table. Signed-off-by: Petra Alexson <[email protected]>
1 parent 34be384 commit 617bf57

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

lib/tenstorrent/bh_arc/telemetry.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,8 @@ static void update_tag_table(void)
322322
tag_table[48] = (struct telemetry_entry){TAG_GDDR_UNCORR_ERRS, GDDR_UNCORR_ERRS};
323323
tag_table[49] = (struct telemetry_entry){TAG_MAX_GDDR_TEMP, MAX_GDDR_TEMP};
324324
tag_table[50] = (struct telemetry_entry){TAG_ASIC_LOCATION, ASIC_LOCATION};
325-
tag_table[51] = (struct telemetry_entry){TAG_TELEM_ENUM_COUNT, TELEM_ENUM_COUNT};
325+
tag_table[51] = (struct telemetry_entry){TAG_BOARD_PWR_LIMIT, BOARD_PWR_LIMIT};
326+
tag_table[52] = (struct telemetry_entry){TAG_TELEM_ENUM_COUNT, TELEM_ENUM_COUNT};
326327
}
327328

328329
/* Handler functions for zephyr timer and worker objects */
@@ -379,3 +380,8 @@ void UpdateTelemetryNocTranslation(bool translation_enabled)
379380
/* Note that this may be called before init_telemetry. */
380381
telemetry[NOC_TRANSLATION] = translation_enabled;
381382
}
383+
384+
void UpdateTelemetryBoardPwrLimit(uint32_t pwr_limit)
385+
{
386+
telemetry[BOARD_PWR_LIMIT] = pwr_limit;
387+
}

lib/tenstorrent/bh_arc/telemetry.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#define TAG_GDDR_UNCORR_ERRS 50
6868
#define TAG_MAX_GDDR_TEMP 51
6969
#define TAG_ASIC_LOCATION 52
70+
#define TAG_BOARD_PWR_LIMIT 53
7071

7172
/* Enums are subject to updates */
7273
typedef enum {
@@ -120,6 +121,7 @@ typedef enum {
120121
FAN_RPM,
121122
TIMER_HEARTBEAT, /* Incremented every time the timer is called */
122123
INPUT_CURRENT,
124+
BOARD_PWR_LIMIT,
123125

124126
/* Tile enablement/harvesting information */
125127
ENABLED_TENSIX_COL,
@@ -155,5 +157,6 @@ int GetMaxGDDRTemp(void);
155157
void StartTelemetryTimer(void);
156158
void UpdateBmFwVersion(uint32_t bl_version, uint32_t app_version);
157159
void UpdateTelemetryNocTranslation(bool translation_enabled);
160+
void UpdateTelemetryBoardPwrLimit(uint32_t pwr_limit);
158161

159162
#endif

lib/tenstorrent/bh_arc/throttler.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ int32_t Bm2CmSetBoardPwrLimit(const uint8_t *data, uint8_t size)
206206
uint16_t pwr_limit = *(uint16_t *)data;
207207

208208
SetThrottlerLimit(kThrottlerBoardPwr, pwr_limit);
209+
UpdateTelemetryBoardPwrLimit(pwr_limit);
209210

210211
return 0;
211212
}

0 commit comments

Comments
 (0)