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

Data Structures

struct  tt_smc_remoteproc_config
struct  tt_smc_remoteproc_data

Macros

#define SMC_BOOT_TIMEOUT_MS   1000
#define DT_DRV_COMPAT   tenstorrent_smc_remoteproc
#define TT_SMC_REMOTEPROC_DEFINE(inst)

Functions

 LOG_MODULE_REGISTER (tt_smc_remoteproc, CONFIG_KERNEL_LOG_LEVEL)
 BUILD_ASSERT (CONFIG_TT_SMC_REMOTEPROC_INIT_PRIO > CONFIG_I3C_CONTROLLER_INIT_PRIORITY, "TT_SMC_REMOTEPROC_INIT_PRIO must be higher than I3C_CONTROLLER_INIT_PRIORITY")
int tt_smc_remoteproc_load (const struct device *dev, uint64_t addr, const uint8_t *bin_data, size_t bin_size)
 Write binary data into remote SMC memory.
int tt_smc_remoteproc_boot (const struct device *dev, uint64_t addr)
 Boot a previously loaded SMC image.
int tt_smc_remoteproc_init (const struct device *dev)

Macro Definition Documentation

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_smc_remoteproc

◆ SMC_BOOT_TIMEOUT_MS

#define SMC_BOOT_TIMEOUT_MS   1000

◆ TT_SMC_REMOTEPROC_DEFINE

#define TT_SMC_REMOTEPROC_DEFINE ( inst)
Value:
const struct tt_smc_remoteproc_config tt_smc_remoteproc_config_##inst = { \
.boot_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, boot_gpios, {0}), \
}; \
\
struct i3c_device_desc tt_smc_remoteproc_i3c_dev_##inst[] = { \
I3C_DEVICE_DESC_DT_INST(inst)}; \
\
struct tt_smc_remoteproc_data tt_smc_remoteproc_data_##inst = { \
.i3c_dev = tt_smc_remoteproc_i3c_dev_##inst, \
}; \
\
DEVICE_DT_INST_DEFINE(inst, tt_smc_remoteproc_init, NULL, &tt_smc_remoteproc_data_##inst, \
&tt_smc_remoteproc_config_##inst, POST_KERNEL, \
CONFIG_TT_SMC_REMOTEPROC_INIT_PRIO, NULL);
#define NULL
Definition avs.c:45
#define GPIO_DT_SPEC_INST_GET_OR(inst, prop, default_value)
Definition tt_smc_remoteproc.c:23
int tt_smc_remoteproc_init(const struct device *dev)
Definition tt_smc_remoteproc.c:63

Function Documentation

◆ BUILD_ASSERT()

BUILD_ASSERT ( CONFIG_TT_SMC_REMOTEPROC_INIT_PRIO ,
CONFIG_I3C_CONTROLLER_INIT_PRIORITY ,
"TT_SMC_REMOTEPROC_INIT_PRIO must be higher than I3C_CONTROLLER_INIT_PRIORITY"  )

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( tt_smc_remoteproc ,
CONFIG_KERNEL_LOG_LEVEL  )

◆ tt_smc_remoteproc_boot()

int tt_smc_remoteproc_boot ( const struct device * dev,
uint64_t addr )

Boot a previously loaded SMC image.

Start execution of the image already placed at addr on the remote SMC CPU.

Parameters
devPointer to the tt_smc_remoteproc device.
addrAddress of the loaded image entry point in the remote SMC memory map.
Returns
0 on success, or a negative errno code on failure.

◆ tt_smc_remoteproc_init()

int tt_smc_remoteproc_init ( const struct device * dev)

◆ tt_smc_remoteproc_load()

int tt_smc_remoteproc_load ( const struct device * dev,
uint64_t addr,
const uint8_t * bin_data,
size_t bin_size )

Write binary data into remote SMC memory.

Copy an arbitrary block of binary data into the remote SMC address space at addr.

Parameters
devPointer to the tt_smc_remoteproc device.
addrTarget address in the remote SMC memory map.
bin_dataPointer to the binary data to write.
bin_sizeNumber of bytes in bin_data.
Returns
0 on success, or a negative errno code on failure.