TT-System-Firmware APIs 19.16.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
tt_grendel_i3c_controller.c File Reference
Include dependency graph for tt_grendel_i3c_controller.c:

Data Structures

struct  tt_grendel_i3c_controller_config

Macros

#define DT_DRV_COMPAT   tenstorrent_grendel_i3c_controller
#define TT_GRENDEL_I3C_POLL_INTERVAL   K_MSEC(100)
#define TT_GRENDEL_I3C_DAA_RETRY_INTERVAL   K_MSEC(50)
#define TT_GRENDEL_I3C_PING_TIMEOUT   K_MSEC(100)
#define TT_GRENDEL_I3C_CONTROLLER_DEFINE(inst)

Functions

 LOG_MODULE_REGISTER (tt_grendel_i3c_controller, CONFIG_TT_GRENDEL_I3C_CONTROLLER_LOG_LEVEL)
 BUILD_ASSERT (CONFIG_TT_GRENDEL_I3C_CONTROLLER_INIT_PRIO > CONFIG_I3C_CONTROLLER_INIT_PRIORITY, "TT_GRENDEL_I3C_CONTROLLER_INIT_PRIO must be higher than " "I3C_CONTROLLER_INIT_PRIORITY so the I3C bus is ready")
static struct i3c_device_desc * tt_grendel_i3c_controller_target_get (const struct tt_grendel_i3c_controller_config *config)
static int tt_grendel_i3c_read_response (struct i3c_device_desc *target, uint8_t opcode, struct tt_grendel_i3c_response *resp)
static int tt_grendel_i3c_run_cmd (const struct device *dev, uint8_t opcode, const void *payload, size_t payload_len, k_timeout_t timeout)
int tt_grendel_i3c_wait_ready (const struct device *dev, k_timeout_t timeout)
 Wait until the remote die is on the bus and answering.
int tt_grendel_i3c_d2d_init (const struct device *dev, uint8_t instance, k_timeout_t timeout)
 Reset-release D2D tile instance on the remote die and load its firmware.
int tt_grendel_i3c_d2d_start (const struct device *dev, uint8_t instance, k_timeout_t timeout)
 Release D2D tile instance's Rocket on the remote die so its loaded firmware runs.
static int tt_grendel_i3c_controller_init (const struct device *dev)

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_grendel_i3c_controller

◆ TT_GRENDEL_I3C_CONTROLLER_DEFINE

#define TT_GRENDEL_I3C_CONTROLLER_DEFINE ( inst)
Value:
static struct i3c_device_desc tt_grendel_i3c_controller_i3c_dev_##inst[] = { \
I3C_DEVICE_DESC_DT(DT_INST_PHANDLE(inst, i3c_device))}; \
static const struct tt_grendel_i3c_controller_config \
tt_grendel_i3c_controller_config_##inst = { \
.i3c_dev = tt_grendel_i3c_controller_i3c_dev_##inst, \
}; \
DEVICE_DT_INST_DEFINE(inst, tt_grendel_i3c_controller_init, NULL, NULL, \
&tt_grendel_i3c_controller_config_##inst, POST_KERNEL, \
CONFIG_TT_GRENDEL_I3C_CONTROLLER_INIT_PRIO, NULL);
#define NULL
Definition avs.c:45
#define DT_INST_PHANDLE(inst, prop)
Definition tt_grendel_i3c_controller.c:39
static int tt_grendel_i3c_controller_init(const struct device *dev)
Definition tt_grendel_i3c_controller.c:179

◆ TT_GRENDEL_I3C_DAA_RETRY_INTERVAL

#define TT_GRENDEL_I3C_DAA_RETRY_INTERVAL   K_MSEC(50)

◆ TT_GRENDEL_I3C_PING_TIMEOUT

#define TT_GRENDEL_I3C_PING_TIMEOUT   K_MSEC(100)

◆ TT_GRENDEL_I3C_POLL_INTERVAL

#define TT_GRENDEL_I3C_POLL_INTERVAL   K_MSEC(100)

Function Documentation

◆ BUILD_ASSERT()

BUILD_ASSERT ( CONFIG_TT_GRENDEL_I3C_CONTROLLER_INIT_PRIO ,
CONFIG_I3C_CONTROLLER_INIT_PRIORITY ,
"TT_GRENDEL_I3C_CONTROLLER_INIT_PRIO must be higher than " "I3C_CONTROLLER_INIT_PRIORITY so the I3C bus is ready"  )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( tt_grendel_i3c_controller ,
CONFIG_TT_GRENDEL_I3C_CONTROLLER_LOG_LEVEL  )

◆ tt_grendel_i3c_controller_init()

int tt_grendel_i3c_controller_init ( const struct device * dev)
static

◆ tt_grendel_i3c_controller_target_get()

struct i3c_device_desc * tt_grendel_i3c_controller_target_get ( const struct tt_grendel_i3c_controller_config * config)
static

◆ tt_grendel_i3c_d2d_init()

int tt_grendel_i3c_d2d_init ( const struct device * dev,
uint8_t instance,
k_timeout_t timeout )

Reset-release D2D tile instance on the remote die and load its firmware.

Blocks until the target answers, or timeout elapses. See TT_GRENDEL_I3C_CMD_D2D_INIT for details.

Parameters
devGrendel I3C controller device
instanceD2D tile index on the remote die
timeoutHow long to wait for the response
Return values
0if the target reported TT_GRENDEL_I3C_OK
-EIOif an I3C transfer failed or the target reported TT_GRENDEL_I3C_NOT_OK
-ETIMEDOUTif no matching response arrived in time

◆ tt_grendel_i3c_d2d_start()

int tt_grendel_i3c_d2d_start ( const struct device * dev,
uint8_t instance,
k_timeout_t timeout )

Release D2D tile instance's Rocket on the remote die so its loaded firmware runs.

Blocks until the target answers, or timeout elapses.

Parameters
devGrendel I3C controller device
instanceD2D tile index on the remote die
timeoutHow long to wait for the response
Return values
0if the target reported TT_GRENDEL_I3C_OK
-EIOif an I3C transfer failed or the target reported TT_GRENDEL_I3C_NOT_OK
-ETIMEDOUTif no matching response arrived in time

◆ tt_grendel_i3c_read_response()

int tt_grendel_i3c_read_response ( struct i3c_device_desc * target,
uint8_t opcode,
struct tt_grendel_i3c_response * resp )
static

◆ tt_grendel_i3c_run_cmd()

int tt_grendel_i3c_run_cmd ( const struct device * dev,
uint8_t opcode,
const void * payload,
size_t payload_len,
k_timeout_t timeout )
static

◆ tt_grendel_i3c_wait_ready()

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

Wait until the remote die is on the bus and answering.

The target only registers once the remote die has booted far enough to run its driver, so pings are expected to fail for a while. Retry until one is answered.

Parameters
devGrendel I3C controller device
timeoutHow long to wait for the target to appear
Return values
0once the target answers
-ETIMEDOUTif it never did