7#ifndef TENSTORRENT_MSGQUEUE_H_
8#define TENSTORRENT_MSGQUEUE_H_
14#define NUM_MSG_QUEUES 4
15#define MSG_QUEUE_SIZE 4
16#define MSG_QUEUE_POINTER_WRAP (2 * MSG_QUEUE_SIZE)
17#define REQUEST_MSG_LEN 8
18#define RESPONSE_MSG_LEN 8
20#define MSG_TYPE_INDEX 0
21#define MSG_TYPE_MASK 0xFF
22#define MSG_TYPE_SHIFT 0
24#define MESSAGE_QUEUE_STATUS_MESSAGE_RECOGNIZED 0xff
25#define MESSAGE_QUEUE_STATUS_SCRATCH_ONLY 0xfe
154#define REGISTER_MESSAGE(msg, func) \
155 const STRUCT_SECTION_ITERABLE(msgqueue_handler, registration_for_##msg) = { \
void process_message_queues(void)
Definition msgqueue.c:335
uint8_t(* msgqueue_request_handler_t)(const union request *req, struct response *rsp)
Definition msgqueue.h:147
int msgqueue_request_push(uint32_t msgqueue_id, const union request *request)
Definition msgqueue.c:124
int msgqueue_response_push(uint32_t msgqueue_id, const struct response *response)
Definition msgqueue.c:164
int msgqueue_request_pop(uint32_t msgqueue_id, union request *request)
Definition msgqueue.c:144
void init_msgqueue(void)
Definition msgqueue.c:439
void msgqueue_register_handler(uint32_t msg_code, msgqueue_request_handler_t handler)
Definition msgqueue.c:345
#define REQUEST_MSG_LEN
Definition msgqueue.h:17
int msgqueue_response_pop(uint32_t msgqueue_id, struct response *response)
Definition msgqueue.c:184
#define RESPONSE_MSG_LEN
Definition msgqueue.h:18
Host request to adjust the AICLK speed.
Definition msgqueue.h:73
uint8_t pad[3]
Three bytes of padding.
Definition msgqueue.h:80
uint8_t command_code
The command code corresponding to TT_SMC_MSG_AICLK_GO_BUSY or TT_SMC_MSG_AICLK_GO_LONG_IDLE.
Definition msgqueue.h:77
Host request to force the fan speed.
Definition msgqueue.h:59
uint8_t pad[3]
Three bytes of padding.
Definition msgqueue.h:64
uint8_t command_code
The command code corresponding to TT_SMC_MSG_FORCE_FAN_SPEED.
Definition msgqueue.h:61
uint32_t raw_speed
The raw speed of the fan to set, as a percentage from 0 to 100.
Definition msgqueue.h:67
Definition msgqueue.h:149
msgqueue_request_handler_t handler
Definition msgqueue.h:151
uint32_t msg_type
Definition msgqueue.h:150
Host request to adjust the power settings.
Definition msgqueue.h:86
uint16_t reserved
Reserved.
Definition msgqueue.h:112
struct power_setting_rqst::@364260271035044055320364336346370330326342300150 power_settings_array
uint8_t power_flags_valid
The number of bits in the power_flags_bitfield that are valid.
Definition msgqueue.h:91
uint16_t future_use
Future use flags currently not supported.
Definition msgqueue.h:109
uint8_t power_settings_valid
The number of fields that are valid in the power_settings_array.
Definition msgqueue.h:94
uint8_t command_code
The command code corresponding to TT_SMC_MSG_POWER_SETTING.
Definition msgqueue.h:88
struct power_setting_rqst::@140120167246117267343245340300140063053015126121 power_flags_bitfield
The list of On/Off style power flags SMC supports toggling.
uint16_t mrisc_phy_power
1 - Set MRISC power setting to Phy wakeup 0 - Set MRISC power setting to Phy Powerdown
Definition msgqueue.h:106
uint16_t max_ai_clk
1 - Set AICLK to Busy 0 - Set AICLK to Idle
Definition msgqueue.h:101
Definition msgqueue.h:143
uint32_t data[8]
Definition msgqueue.h:144
A tenstorrent host request.
Definition msgqueue.h:122
struct force_fan_speed_rqst force_fan_speed
A force fan speed request.
Definition msgqueue.h:132
uint32_t data[8]
The interpretation of the request as an array of uint32_t entries.
Definition msgqueue.h:124
struct aiclk_set_speed_rqst aiclk_set_speed
An AICLK set speed request.
Definition msgqueue.h:135
uint8_t command_code
The interpretation of the request as just the first byte representing command code.
Definition msgqueue.h:129
struct power_setting_rqst power_setting
A power setting request.
Definition msgqueue.h:138