TT-System-Firmware APIs 19.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
dma_tt_bh_noc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Tenstorrent AI ULC
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
8
12
17typedef int (*tt_bh_dma_api_config)(const struct device *dev, uint32_t channel,
18 struct dma_config *config, struct tt_bh_dma_noc_coords *coords);
19__subsystem struct tt_bh_dma_noc_driver_api {
29 struct dma_driver_api dma_api;
30
35};
36
37DEVICE_API_EXTENDS(tt_bh_dma_noc, dma, dma_api);
38
39static inline int tt_dma_config(const struct device *dev, uint32_t channel, struct dma_config *cfg,
40 struct tt_bh_dma_noc_coords *coords)
41{
42 const struct tt_bh_dma_noc_driver_api *api = DEVICE_API_GET(tt_bh_dma_noc, dev);
43
44 if (!api->config) {
45 return -ENOSYS;
46 }
47
48 if (cfg == NULL || coords == NULL) {
49 return -EINVAL;
50 }
51
52 return api->config(dev, channel, cfg, coords);
53}
#define NULL
Definition avs.c:45
#define DEVICE_API_GET(_class, _dev)
tt_bh_dma_noc_channel_direction
Definition dma_tt_bh_noc.h:9
@ TT_BH_DMA_NOC_CHANNEL_DIRECTION_BROADCAST
Definition dma_tt_bh_noc.h:10
DEVICE_API_EXTENDS(tt_bh_dma_noc, dma, dma_api)
static int tt_dma_config(const struct device *dev, uint32_t channel, struct dma_config *cfg, struct tt_bh_dma_noc_coords *coords)
Definition dma_tt_bh_noc.h:39
int(* tt_bh_dma_api_config)(const struct device *dev, uint32_t channel, struct dma_config *config, struct tt_bh_dma_noc_coords *coords)
Definition dma_tt_bh_noc.h:17
DMA_CHANNEL_DIRECTION_PRIV_START
#define EINVAL
#define ENOSYS
__UINT32_TYPE__ uint32_t
__UINT8_TYPE__ uint8_t
Definition dma_tt_bh_noc.h:13
uint8_t dest_x
Definition dma_tt_bh_noc.h:15
uint8_t source_y
Definition dma_tt_bh_noc.h:14
uint8_t dest_y
Definition dma_tt_bh_noc.h:15
uint8_t source_x
Definition dma_tt_bh_noc.h:14
Definition dma_tt_bh_noc.h:19
tt_bh_dma_api_config config
Definition dma_tt_bh_noc.h:34
struct dma_driver_api dma_api
Definition dma_tt_bh_noc.h:29