![]() |
TT-System-Firmware APIs 19.10.99
Tenstorrent Firmware
|
#include <zephyr/device.h>#include <zephyr/drivers/dma.h>#include <zephyr/drivers/dma/dma_tt_bh_noc.h>#include <zephyr/irq.h>#include <zephyr/logging/log.h>#include <zephyr/sys/sys_io.h>#include <zephyr/kernel.h>#include <string.h>#include "noc_init.h"#include "noc2axi.h"#include "util.h"
Data Structures | |
| struct | tt_bh_dma_channel_resettable_data |
| struct | tt_bh_dma_channel_data |
| struct | tt_bh_dma_noc_config |
| struct | tt_bh_dma_noc_data |
Macros | |
| #define | DT_DRV_COMPAT tenstorrent_noc_dma |
| #define | NOC_DMA_TLB 0 |
| #define | NOC_DMA_NOC_ID 0 |
| #define | NOC_DMA_TIMEOUT_MS 50 |
| #define | NOC_MAX_BURST_SIZE 16384 |
| #define | DMA_MAX_TRANSFER_BLOCKS 4 |
| #define | NOC_CMD_CPY (0 << 0) |
| #define | NOC_CMD_RD (0 << 1) |
| #define | NOC_CMD_WR (1 << 1) |
| #define | NOC_CMD_RESP_MARKED (1 << 4) |
| #define | NOC_CMD_BRCST_PACKET (1 << 5) |
| #define | NOC_CMD_PATH_RESERVE (1 << 8) |
| #define | NOC_CMD_BRCST_SRC_INCLUDE (1 << 17) |
| #define | TARGET_ADDR_LO 0xFFB20000 |
| #define | TARGET_ADDR_MID 0xFFB20004 |
| #define | TARGET_ADDR_HI 0xFFB20008 |
| #define | RET_ADDR_LO 0xFFB2000C |
| #define | RET_ADDR_MID 0xFFB20010 |
| #define | RET_ADDR_HI 0xFFB20014 |
| #define | PACKET_TAG 0xFFB20018 |
| #define | CMD_BRCST 0xFFB2001C |
| #define | AT_LEN 0xFFB20020 |
| #define | AT_LEN_1 0xFFB20024 |
| #define | AT_DATA 0xFFB20028 |
| #define | BRCST_EXCLUDE 0xFFB2002C |
| #define | CMD_CTRL 0xFFB20040 |
| #define | NIU_MST_WR_ACK_RECEIVED 0xFFB20204 |
| #define | NIU_MST_RD_RESP_RECEIVED 0xFFB20208 |
| #define | DMA_CHANNEL_INVALID 0xFFFFFFFF |
| #define | TT_BH_DMA_NOC_INIT(inst) |
Functions | |
| LOG_MODULE_REGISTER (dma_noc_tt_bh, CONFIG_DMA_LOG_LEVEL) | |
| static bool | noc_wait_cmd_ready (void) |
| static uint32_t | get_expected_acks (uint32_t noc_cmd, uint64_t size) |
| static bool | is_behind (uint32_t current, uint32_t target) |
| static uint32_t | noc_coord_encode (uint32_t x, uint32_t y) |
| static uint32_t | noc_coord_encode_range (uint32_t start_x, uint32_t start_y, uint32_t end_x, uint32_t end_y) |
| static void | handle_transfer_callbacks (const struct device *dev, struct tt_bh_dma_channel_data *chan_data, uint32_t channel, int transfer_ret, bool is_final_block) |
| static int | noc_dma_transfer (uint32_t cmd, uint32_t ret_coord, uint64_t ret_addr, uint32_t targ_coord, uint64_t targ_addr, uint32_t size, bool multicast, uint8_t transaction_id, bool include_self, uint32_t *noc_cmd_out, uint32_t *expected_acks_out) |
| static int | tt_bh_dma_noc_config (const struct device *dev, uint32_t channel, struct dma_config *config) |
| static int | noc_dma_write_multicast (uint8_t local_x, uint8_t local_y, uint64_t local_addr, uint8_t remote_start_x, uint8_t remote_start_y, uint8_t remote_end_x, uint8_t remote_end_y, uint64_t remote_addr, uint32_t size, bool include_self, uint32_t *noc_cmd_out, uint32_t *expected_acks_out) |
| static int | tt_bh_dma_noc_start_mem_to_per (const struct device *dev, uint32_t channel) |
| static int | tt_bh_dma_noc_start_per_to_mem (const struct device *dev, uint32_t channel) |
| static int | tt_bh_dma_noc_start (const struct device *dev, uint32_t channel) |
| static int | tt_bh_dma_noc_init (const struct device *dev) |
| static int | tt_bh_dma_noc_get_status (const struct device *dev, uint32_t channel, struct dma_status *status) |
| static int | tt_bh_dma_noc_stop (const struct device *dev, uint32_t channel) |
Variables | |
| static const struct dma_driver_api | tt_bh_dma_noc_api |
| #define AT_DATA 0xFFB20028 |
| #define AT_LEN 0xFFB20020 |
| #define AT_LEN_1 0xFFB20024 |
| #define BRCST_EXCLUDE 0xFFB2002C |
| #define CMD_BRCST 0xFFB2001C |
| #define CMD_CTRL 0xFFB20040 |
| #define DMA_CHANNEL_INVALID 0xFFFFFFFF |
| #define DMA_MAX_TRANSFER_BLOCKS 4 |
| #define DT_DRV_COMPAT tenstorrent_noc_dma |
| #define NIU_MST_RD_RESP_RECEIVED 0xFFB20208 |
| #define NIU_MST_WR_ACK_RECEIVED 0xFFB20204 |
| #define NOC_CMD_BRCST_PACKET (1 << 5) |
| #define NOC_CMD_BRCST_SRC_INCLUDE (1 << 17) |
| #define NOC_CMD_CPY (0 << 0) |
| #define NOC_CMD_PATH_RESERVE (1 << 8) |
| #define NOC_CMD_RD (0 << 1) |
| #define NOC_CMD_RESP_MARKED (1 << 4) |
| #define NOC_CMD_WR (1 << 1) |
| #define NOC_DMA_NOC_ID 0 |
| #define NOC_DMA_TIMEOUT_MS 50 |
| #define NOC_DMA_TLB 0 |
| #define NOC_MAX_BURST_SIZE 16384 |
| #define PACKET_TAG 0xFFB20018 |
| #define RET_ADDR_HI 0xFFB20014 |
| #define RET_ADDR_LO 0xFFB2000C |
| #define RET_ADDR_MID 0xFFB20010 |
| #define TARGET_ADDR_HI 0xFFB20008 |
| #define TARGET_ADDR_LO 0xFFB20000 |
| #define TARGET_ADDR_MID 0xFFB20004 |
| #define TT_BH_DMA_NOC_INIT | ( | inst | ) |
|
static |
| LOG_MODULE_REGISTER | ( | dma_noc_tt_bh | , |
| CONFIG_DMA_LOG_LEVEL | ) |
|
inlinestatic |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |