TT-System-Firmware APIs 19.15.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
tt_grendel_filter_init.c File Reference
#include <errno.h>
#include <inttypes.h>
#include <tenstorrent/uart_tt_virt.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/misc/tt_bundle_loader.h>
#include <zephyr/drivers/misc/tt_grendel_filter.h>
#include <zephyr/init.h>
#include <zephyr/logging/log.h>
#include <zephyr/sys/sys_io.h>
#include <zephyr/sys/util.h>
#include <firewall.h>
#include <platform.h>
#include <soc.h>
#include <spa_remap.h>
Include dependency graph for tt_grendel_filter_init.c:

Macros

#define SEP_SAFE_OFF_NODE   DT_NODELABEL(sep_safe_off)
#define SEP_SAFE_SIZE_NODE   DT_NODELABEL(sep_safe_size)
#define RAM0_NODE   DT_CHOSEN(zephyr_sram)
#define BUN2_FILTER_ENTRY   0
#define SEP_SAFE_FILTER_ENTRY   1
#define SCRATCH_FILTER_ENTRY   2
#define VUART_FILTER_ENTRY   3
#define SMC_SCRATCH_COUNT   16
#define SMC_SCRATCH_END   (SCRATCH_REG_BASE + SMC_SCRATCH_COUNT * sizeof(uint64_t) - 1)

Functions

 LOG_MODULE_DECLARE (tt_grendel_filter, CONFIG_TT_GRENDEL_FILTER_LOG_LEVEL)
static int chiplet_local_addr (uint64_t addr, uint64_t *local)
static int enable_host_window (uint32_t entry, uint64_t start, uint64_t end, const char *name)
static int tt_grendel_smc_filter_pre_pcie_init (void)
static int tt_grendel_smc_filter_post_pcie_init (void)
 SYS_INIT (tt_grendel_smc_filter_pre_pcie_init, PRE_KERNEL_2, 0)
 SYS_INIT (tt_grendel_smc_filter_post_pcie_init, POST_KERNEL, 0)

Variables

static const struct tt_grendel_filter_flags smc_filter_host_flags

Macro Definition Documentation

◆ BUN2_FILTER_ENTRY

#define BUN2_FILTER_ENTRY   0

◆ RAM0_NODE

#define RAM0_NODE   DT_CHOSEN(zephyr_sram)

◆ SCRATCH_FILTER_ENTRY

#define SCRATCH_FILTER_ENTRY   2

◆ SEP_SAFE_FILTER_ENTRY

#define SEP_SAFE_FILTER_ENTRY   1

◆ SEP_SAFE_OFF_NODE

#define SEP_SAFE_OFF_NODE   DT_NODELABEL(sep_safe_off)

◆ SEP_SAFE_SIZE_NODE

#define SEP_SAFE_SIZE_NODE   DT_NODELABEL(sep_safe_size)

◆ SMC_SCRATCH_COUNT

#define SMC_SCRATCH_COUNT   16

◆ SMC_SCRATCH_END

#define SMC_SCRATCH_END   (SCRATCH_REG_BASE + SMC_SCRATCH_COUNT * sizeof(uint64_t) - 1)

◆ VUART_FILTER_ENTRY

#define VUART_FILTER_ENTRY   3

Function Documentation

◆ chiplet_local_addr()

int chiplet_local_addr ( uint64_t addr,
uint64_t * local )
static

◆ enable_host_window()

int enable_host_window ( uint32_t entry,
uint64_t start,
uint64_t end,
const char * name )
static

◆ LOG_MODULE_DECLARE()

LOG_MODULE_DECLARE ( tt_grendel_filter ,
CONFIG_TT_GRENDEL_FILTER_LOG_LEVEL  )

◆ SYS_INIT() [1/2]

SYS_INIT ( tt_grendel_smc_filter_post_pcie_init ,
POST_KERNEL ,
0  )

◆ SYS_INIT() [2/2]

SYS_INIT ( tt_grendel_smc_filter_pre_pcie_init ,
PRE_KERNEL_2 ,
0  )

◆ tt_grendel_smc_filter_post_pcie_init()

int tt_grendel_smc_filter_post_pcie_init ( void )
static

◆ tt_grendel_smc_filter_pre_pcie_init()

int tt_grendel_smc_filter_pre_pcie_init ( void )
static

Variable Documentation

◆ smc_filter_host_flags

const struct tt_grendel_filter_flags smc_filter_host_flags
static
Initial value:
= {
.read = 1,
.write = 1,
.nonsecure = 1,
.burst = 1,
}