TT-System-Firmware APIs 19.8.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
msgqueue.h File Reference

Go to the source code of this file.

Data Structures

struct  message_queue_header
struct  counter_rqst
 Host request for generic counter operations. More...
struct  force_fan_speed_rqst
 Host request to force the fan speed. More...
struct  aiclk_set_speed_rqst
 Host request to adjust the AICLK speed. More...
struct  aisweep_rqst
 Host request to start or stop AICLK frequency sweep. More...
struct  force_aiclk_rqst
 Host request to force AICLK to a specific frequency. More...
struct  get_aiclk_rqst
 Host request to get the current AICLK frequency and control mode. More...
struct  power_setting_rqst
 Host request to adjust the power settings. More...
struct  set_voltage_rqst
 Host request to set voltage. More...
struct  get_voltage_rqst
 Host request to get voltage. More...
struct  force_vdd_rqst
 Host request to force the VDD core voltage. More...
struct  switch_vout_control_rqst
 Host request to switch VOUT control. More...
struct  switch_clk_scheme_rqst
 Host request to switch clock scheme. More...
struct  get_freq_curve_from_voltage_rqst
 Host request to get frequency curve from voltage. More...
struct  get_voltage_curve_from_freq_rqst
 Host request to get voltage curve from frequency. More...
struct  debug_noc_translation_rqst
 Host request for debug NOC translation. More...
struct  dmc_ping_rqst
 Host request to ping DMC. More...
struct  send_pcie_msi_rqst
 Host request to send PCIE MSI. More...
struct  i2c_message_rqst
 Host request for I2C message transaction. More...
 Host request to blink the LED. More...
struct  test_rqst
 Host request for test message. More...
struct  pcie_dma_transfer_rqst
 Host request to initiate a PCIe DMA transfer. More...
struct  gddr_reset_rqst
 Host request to toggle GDDR reset. More...
struct  trigger_reset_rqst
 Host request to trigger a chip reset. More...
struct  asic_state_rqst
 Host request to change ASIC state. More...
struct  read_ts_rqst
 Host request to read a temperature sensor. More...
struct  eeprom_rqst
 Host request to read or write SPI EEPROM. More...
struct  read_pd_rqst
 Host request to read a process detector. More...
struct  read_vm_rqst
 Host request to read a voltage monitor. More...
struct  set_tdp_limit_rqst
 Host request to set the TDP limit. More...
struct  report_scratch_only_rqst
 Host request to report scratch-only status. More...
struct  set_asic_host_fmax_rqst
 Host request to set the ASIC fmax. More...
struct  reinit_tensix_rqst
 Host request to reinitialize Tensix NOC programming and tile configuration. More...
struct  toggle_tensix_reset_rqst
 Host request to toggle Tensix reset. More...
struct  flash_unlock_rqst
 Host request to unlock flash for writing. More...
struct  set_wdt_timeout_rqst
 Host request to set watchdog timeout. More...
struct  flash_lock_rqst
 Host request to lock flash writes. More...
struct  confirm_flashed_spi_rqst
 Host request to confirm SPI flash operation. More...
union  request
 A tenstorrent host request. More...
struct  response
struct  msgqueue_handler

Macros

#define NUM_MSG_QUEUES   4
#define MSG_QUEUE_SIZE   4
#define MSG_QUEUE_POINTER_WRAP   (2 * MSG_QUEUE_SIZE)
#define REQUEST_MSG_LEN   8
#define RESPONSE_MSG_LEN   8
#define MSG_TYPE_INDEX   0
#define MSG_TYPE_MASK   0xFF
#define MSG_TYPE_SHIFT   0
#define MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED   0xff
#define MESSAGE_QUEUE_STATUS_SCRATCH_ONLY   0xfe
#define REGISTER_MESSAGE(msg, func)

Typedefs

typedef uint8_t(* msgqueue_request_handler_t) (const union request *req, struct response *rsp)

Enumerations

enum  counter_cmd {
  COUNTER_CMD_GET ,
  COUNTER_CMD_CLEAR ,
  COUNTER_CMD_FREEZE
}
 Counter commands. More...
enum  counter_bank { COUNTER_BANK_THROTTLERS }
 Available counter banks. More...
enum  gddr_reset_err {
  GDDR_RESET_ERR_INVALID_INST = 1 ,
  GDDR_RESET_ERR_HARVESTED = 2 ,
  GDDR_RESET_ERR_MASKED = 3 ,
  GDDR_RESET_ERR_TRAINING = 4 ,
  GDDR_RESET_ERR_BIST = 5 ,
  GDDR_RESET_ERR_POWERDOWN = 6
}
 Error codes returned in response data[1] for TT_SMC_MSG_TOGGLE_GDDR_RESET. More...

Functions

void process_message_queues (void)
void msgqueue_register_handler (uint32_t msg_code, msgqueue_request_handler_t handler)
int msgqueue_request_push (uint32_t msgqueue_id, const union request *request)
int msgqueue_request_pop (uint32_t msgqueue_id, union request *request)
int msgqueue_response_push (uint32_t msgqueue_id, const struct response *response)
int msgqueue_response_pop (uint32_t msgqueue_id, struct response *response)
void init_msgqueue (void)

Macro Definition Documentation

◆ MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED

#define MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED   0xff

◆ MESSAGE_QUEUE_STATUS_SCRATCH_ONLY

#define MESSAGE_QUEUE_STATUS_SCRATCH_ONLY   0xfe

◆ MSG_QUEUE_POINTER_WRAP

#define MSG_QUEUE_POINTER_WRAP   (2 * MSG_QUEUE_SIZE)

◆ MSG_QUEUE_SIZE

#define MSG_QUEUE_SIZE   4

◆ MSG_TYPE_INDEX

#define MSG_TYPE_INDEX   0

◆ MSG_TYPE_MASK

#define MSG_TYPE_MASK   0xFF

◆ MSG_TYPE_SHIFT

#define MSG_TYPE_SHIFT   0

◆ NUM_MSG_QUEUES

#define NUM_MSG_QUEUES   4

◆ REGISTER_MESSAGE

#define REGISTER_MESSAGE ( msg,
func )
Value:
const STRUCT_SECTION_ITERABLE(msgqueue_handler, registration_for_##msg) = { \
.msg_type = msg, \
.handler = func, \
}
const STRUCT_SECTION_ITERABLE(msgqueue_handler, registration_for_TT_SMC_MSG_AICLK_GO_BUSY)
Definition msgqueue.h:898

◆ REQUEST_MSG_LEN

#define REQUEST_MSG_LEN   8

◆ RESPONSE_MSG_LEN

#define RESPONSE_MSG_LEN   8

Typedef Documentation

◆ msgqueue_request_handler_t

typedef uint8_t(* msgqueue_request_handler_t) (const union request *req, struct response *rsp)

Function Documentation

◆ init_msgqueue()

void init_msgqueue ( void )

◆ msgqueue_register_handler()

void msgqueue_register_handler ( uint32_t msg_code,
msgqueue_request_handler_t handler )

◆ msgqueue_request_pop()

int msgqueue_request_pop ( uint32_t msgqueue_id,
union request * request )

◆ msgqueue_request_push()

int msgqueue_request_push ( uint32_t msgqueue_id,
const union request * request )

◆ msgqueue_response_pop()

int msgqueue_response_pop ( uint32_t msgqueue_id,
struct response * response )

◆ msgqueue_response_push()

int msgqueue_response_push ( uint32_t msgqueue_id,
const struct response * response )

◆ process_message_queues()

void process_message_queues ( void )