TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
fan_ctrl.c File Reference
#include "fan_ctrl.h"
#include "cm2dm_msg.h"
#include "gddr.h"
#include "telemetry_internal.h"
#include "telemetry.h"
#include "timer.h"
#include "harvesting.h"
#include <tenstorrent/msgqueue.h>
#include <tenstorrent/smc_msg.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/misc/bh_fwtable.h>

Macros

#define STATIC   static

Functions

 LOG_MODULE_REGISTER (fan_ctrl, CONFIG_TT_APP_LOG_LEVEL)
static uint32_t fan_curve (float max_asic_temp, float max_gddr_temp)
static void update_fan_speed (void)
uint16_t GetFanRPM (void)
void SetFanRPM (uint16_t rpm)
uint32_t GetFanSpeed (void)
static void fan_ctrl_work_handler (struct k_work *work)
static K_WORK_DEFINE (fan_ctrl_update_worker, fan_ctrl_work_handler)
static void fan_ctrl_timer_handler (struct k_timer *timer)
static K_TIMER_DEFINE (fan_ctrl_update_timer, fan_ctrl_timer_handler, NULL)
void init_fan_ctrl (void)
static uint8_t force_fan_speed (const union request *request, struct response *response)
 REGISTER_MESSAGE (TT_SMC_MSG_FORCE_FAN_SPEED, force_fan_speed)
void DmcFanSpeedFeedback (uint32_t speed_percentage)

Variables

static struct k_timer fan_ctrl_update_timer
static struct k_work fan_ctrl_update_worker
static int fan_ctrl_update_interval = 1000
static uint16_t fan_rpm
static uint32_t fan_speed
static bool fan_speed_forced
static uint32_t fan_speed_feedback
static float max_gddr_temp
static float max_asic_temp
static float alpha = CONFIG_TT_BH_ARC_FAN_CTRL_ALPHA / 100.0f
static const struct device *const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))

Macro Definition Documentation

◆ STATIC

#define STATIC   static

Function Documentation

◆ DmcFanSpeedFeedback()

void DmcFanSpeedFeedback ( uint32_t speed_percentage)

◆ fan_ctrl_timer_handler()

void fan_ctrl_timer_handler ( struct k_timer * timer)
static

◆ fan_ctrl_work_handler()

void fan_ctrl_work_handler ( struct k_work * work)
static

◆ fan_curve()

uint32_t fan_curve ( float max_asic_temp,
float max_gddr_temp )
static

◆ force_fan_speed()

uint8_t force_fan_speed ( const union request * request,
struct response * response )
static

◆ GetFanRPM()

uint16_t GetFanRPM ( void )

◆ GetFanSpeed()

uint32_t GetFanSpeed ( void )

◆ init_fan_ctrl()

void init_fan_ctrl ( void )

◆ K_TIMER_DEFINE()

K_TIMER_DEFINE ( fan_ctrl_update_timer ,
fan_ctrl_timer_handler ,
NULL  )
static

◆ K_WORK_DEFINE()

K_WORK_DEFINE ( fan_ctrl_update_worker ,
fan_ctrl_work_handler  )
static

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( fan_ctrl ,
CONFIG_TT_APP_LOG_LEVEL  )

◆ REGISTER_MESSAGE()

REGISTER_MESSAGE ( TT_SMC_MSG_FORCE_FAN_SPEED ,
force_fan_speed  )

◆ SetFanRPM()

void SetFanRPM ( uint16_t rpm)

◆ update_fan_speed()

void update_fan_speed ( void )
static

Variable Documentation

◆ alpha

float alpha = CONFIG_TT_BH_ARC_FAN_CTRL_ALPHA / 100.0f
static

◆ fan_ctrl_update_interval

int fan_ctrl_update_interval = 1000
static

◆ fan_ctrl_update_timer

struct k_timer fan_ctrl_update_timer
static

◆ fan_ctrl_update_worker

struct k_work fan_ctrl_update_worker
static

◆ fan_rpm

uint16_t fan_rpm
static

◆ fan_speed

uint32_t fan_speed
static

◆ fan_speed_feedback

uint32_t fan_speed_feedback
static

◆ fan_speed_forced

bool fan_speed_forced
static

◆ fwtable_dev

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

◆ max_asic_temp

float max_asic_temp
static

◆ max_gddr_temp

float max_gddr_temp
static