![]() |
TT-System-Firmware APIs 19.15.99
Tenstorrent Firmware
|
#include <errno.h>#include <zephyr/device.h>#include <zephyr/devicetree.h>#include <zephyr/drivers/memc/memc_tt_mimir.h>#include <zephyr/logging/log.h>#include <zephyr/sys/util.h>#include "gddr.h"#include "gddr_drv.h"
Data Structures | |
| struct | memc_tt_mimir_data |
Macros | |
| #define | DT_DRV_COMPAT tenstorrent_mimir_memc |
| #define | MEMC_TILE_BIT(node_id, prop, idx) |
| #define | MEMC_GDDR_TILE_MASK DT_INST_FOREACH_PROP_ELEM_SEP(0, mem_tiles, MEMC_TILE_BIT, (|)) |
Functions | |
| LOG_MODULE_REGISTER (memc_tt_mimir, CONFIG_MEMC_LOG_LEVEL) | |
| int | memc_tt_mimir_set_config (const struct device *dev, const gddr_backend_t *backend, fw_params_t *params) |
| Install the platform GDDR configuration for the controller. | |
| static int | memc_tt_mimir_init (const struct device *dev) |
| DEVICE_DT_INST_DEFINE (0, memc_tt_mimir_init, NULL, &memc_tt_mimir_data0, NULL, POST_KERNEL, CONFIG_MEMC_TT_MIMIR_INIT_PRIORITY, NULL) | |
Variables | |
| static struct memc_tt_mimir_data | memc_tt_mimir_data0 |
| #define DT_DRV_COMPAT tenstorrent_mimir_memc |
| #define MEMC_GDDR_TILE_MASK DT_INST_FOREACH_PROP_ELEM_SEP(0, mem_tiles, MEMC_TILE_BIT, (|)) |
| #define MEMC_TILE_BIT | ( | node_id, | |
| prop, | |||
| idx ) |
| DEVICE_DT_INST_DEFINE | ( | 0 | , |
| memc_tt_mimir_init | , | ||
| NULL | , | ||
| & | memc_tt_mimir_data0, | ||
| NULL | , | ||
| POST_KERNEL | , | ||
| CONFIG_MEMC_TT_MIMIR_INIT_PRIORITY | , | ||
| NULL | ) |
| LOG_MODULE_REGISTER | ( | memc_tt_mimir | , |
| CONFIG_MEMC_LOG_LEVEL | ) |
|
static |
| int memc_tt_mimir_set_config | ( | const struct device * | dev, |
| const gddr_backend_t * | backend, | ||
| fw_params_t * | params ) |
Install the platform GDDR configuration for the controller.
Stores the backend and fw_params in the device's data; the device passes them to gddr_init() at its own init. Call once, before the memc device initializes.
The backend and fw_params are runtime/platform-supplied (host-written params, environment-selected backend), which is why they arrive through this API rather than devicetree. params is non-const because this call fills in gddr_tile_mask from the controller's own DT topology (the mem-tiles).
| dev | The memc controller device. |
| backend | Caller-owned backend (non-NULL, with a non-NULL get_blob). |
| params | fw_params minus gddr_tile_mask |
dev, backend, backend->get_blob, or params is NULL.
|
static |