TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
telemetry.c File Reference
#include "cat.h"
#include "cm2dm_msg.h"
#include "fan_ctrl.h"
#include "functional_efuse.h"
#include "harvesting.h"
#include "reg.h"
#include "regulator.h"
#include "status_reg.h"
#include "telemetry.h"
#include "telemetry_internal.h"
#include "gddr.h"
#include <float.h>
#include <math.h>
#include <stdint.h>
#include <string.h>
#include <tenstorrent/post_code.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/misc/bh_fwtable.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/clock_control/clock_control_tt_bh.h>
#include <zephyr/drivers/clock_control.h>

Data Structures

struct  telemetry_entry
struct  telemetry_table

Macros

#define RESET_UNIT_STRAP_REGISTERS_L_REG_ADDR   0x80030D20

Functions

 LOG_MODULE_REGISTER (telemetry, CONFIG_TT_APP_LOG_LEVEL)
uint32_t ConvertFloatToTelemetry (float value)
float ConvertTelemetryToFloat (int32_t value)
static void UpdateGddrTelemetry (void)
int GetMaxGDDRTemp (void)
static void write_static_telemetry (uint32_t app_version)
static void update_telemetry (void)
static void telemetry_work_handler (struct k_work *work)
static void telemetry_timer_handler (struct k_timer *timer)
static K_WORK_DEFINE (telem_update_worker, telemetry_work_handler)
static K_TIMER_DEFINE (telem_update_timer, telemetry_timer_handler, NULL)
void init_telemetry (uint32_t app_version)
void StartTelemetryTimer (void)
void UpdateDmFwVersion (uint32_t bl_version, uint32_t app_version)
void UpdateTelemetryNocTranslation (bool translation_enabled)
void UpdateTelemetryBoardPowerLimit (uint32_t power_limit)
void UpdateTelemetryThermTripCount (uint16_t therm_trip_count)
bool GetTelemetryTagValid (uint16_t tag)
uint32_t GetTelemetryTag (uint16_t tag)

Variables

static const struct device *const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static const struct device *const pll_dev_0 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll0))
static const struct device *const pll_dev_1 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll1))
static const struct device *const pll_dev_4 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll4))
static struct telemetry_table telemetry_table
static uint32_ttelemetry = &telemetry_table.telemetry[0]
static struct k_timer telem_update_timer
static struct k_work telem_update_worker
static int telem_update_interval = 100

Macro Definition Documentation

◆ RESET_UNIT_STRAP_REGISTERS_L_REG_ADDR

#define RESET_UNIT_STRAP_REGISTERS_L_REG_ADDR   0x80030D20

Function Documentation

◆ ConvertFloatToTelemetry()

uint32_t ConvertFloatToTelemetry ( float value)

◆ ConvertTelemetryToFloat()

float ConvertTelemetryToFloat ( int32_t value)

◆ GetMaxGDDRTemp()

int GetMaxGDDRTemp ( void )

◆ GetTelemetryTag()

uint32_t GetTelemetryTag ( uint16_t tag)

◆ GetTelemetryTagValid()

bool GetTelemetryTagValid ( uint16_t tag)

◆ init_telemetry()

void init_telemetry ( uint32_t app_version)

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( telem_update_timer ,
telemetry_timer_handler ,
NULL  )
static

◆ K_WORK_DEFINE()

K_WORK_DEFINE ( telem_update_worker ,
telemetry_work_handler  )
static

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( telemetry ,
CONFIG_TT_APP_LOG_LEVEL  )

◆ StartTelemetryTimer()

void StartTelemetryTimer ( void )

◆ telemetry_timer_handler()

void telemetry_timer_handler ( struct k_timer * timer)
static

◆ telemetry_work_handler()

void telemetry_work_handler ( struct k_work * work)
static

◆ update_telemetry()

void update_telemetry ( void )
static

◆ UpdateDmFwVersion()

void UpdateDmFwVersion ( uint32_t bl_version,
uint32_t app_version )

◆ UpdateGddrTelemetry()

void UpdateGddrTelemetry ( void )
static

◆ UpdateTelemetryBoardPowerLimit()

void UpdateTelemetryBoardPowerLimit ( uint32_t power_limit)

◆ UpdateTelemetryNocTranslation()

void UpdateTelemetryNocTranslation ( bool translation_enabled)

◆ UpdateTelemetryThermTripCount()

void UpdateTelemetryThermTripCount ( uint16_t therm_trip_count)

◆ write_static_telemetry()

void write_static_telemetry ( uint32_t app_version)
static

Variable Documentation

◆ fwtable_dev

const struct device* const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static

◆ pll_dev_0

const struct device* const pll_dev_0 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll0))
static

◆ pll_dev_1

const struct device* const pll_dev_1 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll1))
static

◆ pll_dev_4

const struct device* const pll_dev_4 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll4))
static

◆ telem_update_interval

int telem_update_interval = 100
static

◆ telem_update_timer

struct k_timer telem_update_timer
static

◆ telem_update_worker

struct k_work telem_update_worker
static

◆ telemetry

uint32_t* telemetry = &telemetry_table.telemetry[0]
static

◆ telemetry_table

struct telemetry_table telemetry_table
static