TT-System-Firmware APIs 19.16.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
tt_d2d.h File Reference

Tenstorrent Grendel die-to-die (D2D) firmware loading APIs. More...

#include <stddef.h>
#include <stdint.h>
#include <zephyr/device.h>
#include <zephyr/kernel.h>
Include dependency graph for tt_d2d.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int tt_d2d_reset_release (const struct device *dev)
 Deassert a D2D tile's subsystem resets, in hardware order.
int tt_d2d_load_fw (const struct device *dev, const uint8_t *img, size_t img_size)
 Load firmware into a D2D tile, leaving the Rocket halted.
int tt_d2d_start (const struct device *dev)
 Release a D2D tile's Rocket so loaded firmware begins executing.
int tt_d2d_wait_link (const struct device *dev, k_timeout_t timeout)
 Wait for this end of the link to finish training.
uint32_t tt_d2d_progress_code (const struct device *dev)
 Firmware training progress code (drop d2d_api_fw_progress_codes.h).

Detailed Description

Tenstorrent Grendel die-to-die (D2D) firmware loading APIs.

Sequence: reset_release (before the CCE PLL switch, straps sample the current clock) -> load_fw (Rocket stays halted) -> start (both ends close together; sideband sync is off on emu) -> wait_link.

Cold reset and firewalls are chip-wide and are not done here. Until they are, load_fw() fails the SRAM probe with -ENODEV.

Function Documentation

◆ tt_d2d_load_fw()

int tt_d2d_load_fw ( const struct device * dev,
const uint8_t * img,
size_t img_size )

Load firmware into a D2D tile, leaving the Rocket halted.

Parameters
devD2D tile device
imgFirmware image
img_sizeSize of img in bytes. Multiple of 4; must not overrun the configuration block at the top of SRAM.
Return values
0on success
-EINVALif img is NULL, empty, or not a multiple of 4 bytes
-ENOSPCif img would overrun the configuration block
-ENODEVif the tile does not answer a write to its SRAM
-EIOif the image read back from SRAM does not match img

◆ tt_d2d_progress_code()

uint32_t tt_d2d_progress_code ( const struct device * dev)

Firmware training progress code (drop d2d_api_fw_progress_codes.h).

Parameters
devD2D tile device
Returns
the firmware's current progress code, or 0 if none yet

◆ tt_d2d_reset_release()

int tt_d2d_reset_release ( const struct device * dev)

Deassert a D2D tile's subsystem resets, in hardware order.

Parameters
devD2D tile device
Return values
0on success

◆ tt_d2d_start()

int tt_d2d_start ( const struct device * dev)

Release a D2D tile's Rocket so loaded firmware begins executing.

Parameters
devD2D tile device
Return values
0on success

◆ tt_d2d_wait_link()

int tt_d2d_wait_link ( const struct device * dev,
k_timeout_t timeout )

Wait for this end of the link to finish training.

Polls the firmware progress code in SRAM (link-layer status is not modelled on emu). Both ends must already have been started.

Parameters
devD2D tile device
timeoutHow long to wait, or K_FOREVER
Return values
0if the link trained
-EIOif the firmware reported a training failure
-ETIMEDOUTif it did neither