TT Zephyr Platforms 19.0.0-rc2
Tenstorrent Firmware
|
#include "aiclk_ppm.h"
#include "dvfs.h"
#include "voltage.h"
#include "vf_curve.h"
#include <stdlib.h>
#include <tenstorrent/smc_msg.h>
#include <tenstorrent/msgqueue.h>
#include <tenstorrent/sys_init_defines.h>
#include <zephyr/init.h>
#include <zephyr/drivers/misc/bh_fwtable.h>
#include <zephyr/sys/util.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 | AiclkPPM |
Macros | |
#define | AICLK_FMAX_MAX 1400.0F |
#define | AICLK_FMAX_MIN 800.0F |
#define | AICLK_FMIN_MAX 800.0F |
#define | AICLK_FMIN_MIN 200.0F |
Enumerations | |
enum | ClockControlMode { CLOCK_MODE_UNCONTROLLED = 1 , CLOCK_MODE_PPM_FORCED = 2 , CLOCK_MODE_PPM_UNFORCED = 3 } |
Functions | |
void | SetAiclkArbMax (AiclkArbMax arb_max, float freq) |
void | SetAiclkArbMin (AiclkArbMin arb_min, float freq) |
void | CalculateTargAiclk (void) |
void | DecreaseAiclk (void) |
void | IncreaseAiclk (void) |
float | GetThrottlerArbMax (AiclkArbMax arb_max) |
uint32_t | GetMaxAiclkForVoltage (uint32_t voltage) |
void | InitArbMaxVoltage (void) |
static int | InitAiclkPPM (void) |
SYS_INIT (InitAiclkPPM, APPLICATION, 12) | |
uint8_t | ForceAiclk (uint32_t freq) |
uint32_t | GetAiclkTarg (void) |
void | aiclk_set_busy (bool is_busy) |
static uint8_t | aiclk_busy_handler (const union request *request, struct response *response) |
Handles the request to set AICLK busy or idle. | |
static uint8_t | ForceAiclkHandler (const union request *request, struct response *response) |
static uint8_t | get_aiclk_handler (const union request *request, struct response *response) |
static uint8_t | SweepAiclkHandler (const union request *request, struct response *response) |
const | STRUCT_SECTION_ITERABLE (msgqueue_handler, registration_for_TT_SMC_MSG_AICLK_GO_BUSY) |
const | STRUCT_SECTION_ITERABLE (msgqueue_handler, registration_for_TT_SMC_MSG_AICLK_GO_LONG_IDLE) |
const | STRUCT_SECTION_ITERABLE (msgqueue_handler, registration_for_TT_SMC_MSG_FORCE_AICLK) |
const | STRUCT_SECTION_ITERABLE (msgqueue_handler, registration_for_TT_SMC_MSG_GET_AICLK) |
const | STRUCT_SECTION_ITERABLE (msgqueue_handler, registration_for_TT_SMC_MSG_AISWEEP_START) |
const | STRUCT_SECTION_ITERABLE (msgqueue_handler, registration_for_TT_SMC_MSG_AISWEEP_STOP) |
Variables | |
static const struct device *const | pll_dev_0 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll0)) |
static AiclkPPM | aiclk_ppm |
static const struct device *const | fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable)) |
#define AICLK_FMAX_MAX 1400.0F |
#define AICLK_FMAX_MIN 800.0F |
#define AICLK_FMIN_MAX 800.0F |
#define AICLK_FMIN_MIN 200.0F |
enum ClockControlMode |
Handles the request to set AICLK busy or idle.
[in] | request | The request, of type aiclk_set_speed_rqst_t, with command code MSG_TYPE_AICLK_GO_BUSY to go busy, or MSG_TYPE_AICLK_GO_LONG_IDLE to go idle. |
[out] | response | The response to the host |
void aiclk_set_busy | ( | bool | is_busy | ) |
void CalculateTargAiclk | ( | void | ) |
void DecreaseAiclk | ( | void | ) |
uint32_t GetAiclkTarg | ( | void | ) |
float GetThrottlerArbMax | ( | AiclkArbMax | arb_max | ) |
void IncreaseAiclk | ( | void | ) |
|
static |
void InitArbMaxVoltage | ( | void | ) |
void SetAiclkArbMax | ( | AiclkArbMax | arb_max, |
float | freq ) |
void SetAiclkArbMin | ( | AiclkArbMin | arb_min, |
float | freq ) |
const STRUCT_SECTION_ITERABLE | ( | msgqueue_handler | , |
registration_for_TT_SMC_MSG_AICLK_GO_BUSY | ) |
const STRUCT_SECTION_ITERABLE | ( | msgqueue_handler | , |
registration_for_TT_SMC_MSG_AICLK_GO_LONG_IDLE | ) |
const STRUCT_SECTION_ITERABLE | ( | msgqueue_handler | , |
registration_for_TT_SMC_MSG_AISWEEP_START | ) |
const STRUCT_SECTION_ITERABLE | ( | msgqueue_handler | , |
registration_for_TT_SMC_MSG_AISWEEP_STOP | ) |
const STRUCT_SECTION_ITERABLE | ( | msgqueue_handler | , |
registration_for_TT_SMC_MSG_FORCE_AICLK | ) |
const STRUCT_SECTION_ITERABLE | ( | msgqueue_handler | , |
registration_for_TT_SMC_MSG_GET_AICLK | ) |
SYS_INIT | ( | InitAiclkPPM | , |
APPLICATION | , | ||
12 | ) |
|
static |
|
static |
|
static |