![]() |
TT-System-Firmware APIs 19.16.99
Tenstorrent Firmware
|
#include <errno.h>#include <string.h>#include <zephyr/device.h>#include <zephyr/devicetree.h>#include <zephyr/drivers/i3c.h>#include <zephyr/drivers/i3c/devicetree.h>#include <zephyr/drivers/misc/tt_grendel_i3c.h>#include <zephyr/kernel.h>#include <zephyr/logging/log.h>#include <zephyr/sys/byteorder.h>
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) |
| #define DT_DRV_COMPAT tenstorrent_grendel_i3c_controller |
| #define TT_GRENDEL_I3C_CONTROLLER_DEFINE | ( | inst | ) |
| #define TT_GRENDEL_I3C_DAA_RETRY_INTERVAL K_MSEC(50) |
| #define TT_GRENDEL_I3C_PING_TIMEOUT K_MSEC(100) |
| #define TT_GRENDEL_I3C_POLL_INTERVAL K_MSEC(100) |
| 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 | ( | tt_grendel_i3c_controller | , |
| CONFIG_TT_GRENDEL_I3C_CONTROLLER_LOG_LEVEL | ) |
|
static |
|
static |
| 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.
| dev | Grendel I3C controller device |
| instance | D2D tile index on the remote die |
| timeout | How long to wait for the response |
| 0 | if the target reported TT_GRENDEL_I3C_OK |
| -EIO | if an I3C transfer failed or the target reported TT_GRENDEL_I3C_NOT_OK |
| -ETIMEDOUT | if no matching response arrived in time |
| 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.
| dev | Grendel I3C controller device |
| instance | D2D tile index on the remote die |
| timeout | How long to wait for the response |
| 0 | if the target reported TT_GRENDEL_I3C_OK |
| -EIO | if an I3C transfer failed or the target reported TT_GRENDEL_I3C_NOT_OK |
| -ETIMEDOUT | if no matching response arrived in time |
|
static |
|
static |
| 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.
| dev | Grendel I3C controller device |
| timeout | How long to wait for the target to appear |
| 0 | once the target answers |
| -ETIMEDOUT | if it never did |