TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
event.h File Reference
#include <stdint.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>

Go to the source code of this file.

Macros

#define TT_EVENT_ANY   UINT32_MAX
 Bitmask of all Tenstorrent firmware events.

Enumerations

enum  tt_event {
  TT_EVENT_THERM_TRIP = BIT(0) ,
  TT_EVENT_WATCHDOG_EXPIRED = BIT(1) ,
  TT_EVENT_PERST = BIT(2) ,
  TT_EVENT_PGOOD = BIT(3) ,
  TT_EVENT_BOARD_POWER_TO_SMC = BIT(4) ,
  TT_EVENT_FAN_RPM_TO_SMC = BIT(5) ,
  TT_EVENT_CM2DM_POLL = BIT(6) ,
  TT_EVENT_LOGS_TO_SMC = BIT(7) ,
  TT_EVENT_WAKE = BIT(31)
}
 Event IDs for Tenstorrent firmware. More...

Functions

uint32_t tt_event_post (uint32_t events)
 Post an event to Tenstorrent firmware.
uint32_t tt_event_wait (uint32_t events, k_timeout_t timeout)
 Wait for one or more events to be posted to Tenstorrent firmware.

Macro Definition Documentation

◆ TT_EVENT_ANY

#define TT_EVENT_ANY   UINT32_MAX

Bitmask of all Tenstorrent firmware events.

Enumeration Type Documentation

◆ tt_event

enum tt_event

Event IDs for Tenstorrent firmware.

The application thread of firmware can receive and react to events generated throughout the system. Multiple events may be posted and receieved simultaneously, as they form a bitmask.

Enumerator
TT_EVENT_THERM_TRIP BIT(0) 

ASIC thermal trip detected.

TT_EVENT_WATCHDOG_EXPIRED BIT(1) 

Watchdog timeout expired.

TT_EVENT_PERST BIT(2) 

PERST (pcie reset) signal asserted.

TT_EVENT_PGOOD BIT(3) 

PGOOD (power good) state change.

TT_EVENT_BOARD_POWER_TO_SMC BIT(4) 

20ms: board power sense & send to smc

TT_EVENT_FAN_RPM_TO_SMC BIT(5) 

20ms: fan RPM sense & send to smc

TT_EVENT_CM2DM_POLL BIT(6) 

20ms: CM2DM message polling

TT_EVENT_LOGS_TO_SMC BIT(7) 

20ms: send log chunk to smc

TT_EVENT_WAKE BIT(31) 

Wake firmware for a generic reason.

Function Documentation

◆ tt_event_post()

uint32_t tt_event_post ( uint32_t events)

Post an event to Tenstorrent firmware.

Post one or more events.

Parameters
eventsThe events to post as a bitmask of tt_event values.
Returns
the previous value of posted events.
See also
k_event_post

◆ tt_event_wait()

uint32_t tt_event_wait ( uint32_t events,
k_timeout_t timeout )

Wait for one or more events to be posted to Tenstorrent firmware.

Wait for one or more events to be posted to Tenstorrent firmware. The function will block until at least one of the specified events are received or timeout expires.

To block indefinitely, use K_FOREVER. To return immediately, use K_NO_WAIT.

To block for a specific time, use K_MSEC or K_USEC to specify the timeout.

On success, a bitmask of the received events (of type tt_event) is returned and the corresponding events are automatically cleared. When a timeout occurs, the function returns 0.

Note
This function may be called from ISR context only if timeout equals K_NO_WAIT.
Parameters
eventsThe events to wait for as a bitmask of tt_event values.
timeoutThe maximum time to wait for the event(s) to be posted.
Returns
On success, a bitmask of the received events (of type tt_event). Otherwise, zero.
See also
k_event_wait