TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
noc_init.c File Reference
#include "harvesting.h"
#include "noc_init.h"
#include "noc.h"
#include "noc2axi.h"
#include "reg.h"
#include "telemetry.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <tenstorrent/msgqueue.h>
#include <tenstorrent/smc_msg.h>
#include <tenstorrent/sys_init_defines.h>
#include <zephyr/drivers/misc/bh_fwtable.h>
#include <zephyr/init.h>
#include <zephyr/kernel.h>
#include <zephyr/sys/util.h>

Data Structures

struct  NocTranslation

Macros

#define NIU_CFG_0   0x0
#define ROUTER_CFG(n)
#define NOC_X_ID_TRANSLATE_TABLE(n)
#define NOC_Y_ID_TRANSLATE_TABLE(n)
#define NOC_ID_LOGICAL   0x12
#define NOC_ID_TRANSLATE_COL_MASK   0x14
#define NOC_ID_TRANSLATE_ROW_MASK   0x15
#define DDR_COORD_TRANSLATE_TABLE(n)
#define NIU_CFG_0_TILE_CLK_OFF   12
#define NIU_CFG_0_TILE_HEADER_STORE_OFF   13 /* NOC2AXI only */
#define NIU_CFG_0_NOC_ID_TRANSLATE_EN   14
#define NIU_CFG_0_AXI_SLAVE_ENABLE   15
#define NOC_TRANSLATE_ID_WIDTH   5
#define NOC_TRANSLATE_TABLE_XY_SIZE   (32 / NOC_TRANSLATE_ID_WIDTH)
#define STREAM_PERF_CONFIG_REG_INDEX   35
#define CLOCK_GATING_EN   0
#define PRE_TRANSLATION_SIZE   32

Functions

static volatile void * SetupNiuTlbPhys (uint8_t tlb_index, uint8_t px, uint8_t py, uint8_t noc_id)
static volatile void * SetupNiuTlb (uint8_t tlb_index, uint8_t nx, uint8_t ny, uint8_t noc_id)
static uint32_t ReadNocCfgReg (volatile void *regs, uint32_t cfg_reg_index)
static void WriteNocCfgReg (volatile void *regs, uint32_t cfg_reg_index, uint32_t value)
static void EnableOverlayCg (uint8_t tlb_index, uint8_t px, uint8_t py)
static void ProgramBroadcastExclusion (uint16_t disabled_tensix_columns)
static bool GetTileClkDisable (uint8_t px, uint8_t py)
int NocInit (void)
 SYS_INIT_APP (NocInit)
static void SetLogicalCoord (struct NocTranslation *nt, uint8_t post_x, uint8_t post_y, uint8_t logical_x, uint8_t logical_y)
static void MakeIdentity (struct NocTranslation *nt)
static void CopyNoc0ToNoc1 (const struct NocTranslation *noc0, struct NocTranslation *noc1)
static void CopyBytesSkipIndices (uint8_t *out, const uint8_t *in, size_t count, uint32_t skip_mask)
static void ApplyLogicalCoords (struct NocTranslation *nt, uint8_t post_x_start, uint8_t post_y_start, uint8_t post_x_end, uint8_t post_y_end, uint8_t pre_x_start, uint8_t pre_y_start, uint8_t pre_x_end, uint8_t pre_y_end)
static void ProgramNocTranslation (const struct NocTranslation *nt, unsigned int noc_id)
static struct NocTranslation ComputeNocTranslation (unsigned int pcie_instance, uint16_t bad_tensix_cols, uint8_t bad_gddr, uint16_t skip_eth)
void InitNocTranslation (unsigned int pcie_instance, uint16_t bad_tensix_cols, uint8_t bad_gddr, uint16_t skip_eth)
int InitNocTranslationFromHarvesting (void)
 SYS_INIT_APP (InitNocTranslationFromHarvesting)
static void DisableArcNocTranslation (void)
void ClearNocTranslation (void)
static uint8_t DebugNocTranslationHandler (const union request *req, struct response *rsp)
 REGISTER_MESSAGE (TT_SMC_MSG_DEBUG_NOC_TRANSLATION, DebugNocTranslationHandler)
void GetEnabledTensix (uint8_t *x, uint8_t *y)

Variables

static const uint8_t kTlbIndex
static const uint32_t kFirstCfgRegIndex = 0x100 / sizeof(uint32_t)
static const struct device *const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static bool noc_translation_enabled
static const uint8_t kTensixEthNoc0X [] = {1, 16, 2, 15, 3, 14, 4, 13, 5, 12, 6, 11, 7, 10}
static const uint8_t kL2CpuNoc0Y [] = {3, 9, 5, 7}
static const uint8_t kGddrY [][3] = {{0, 1, 11}, {2, 10, 3}, {9, 4, 8}, {5, 7, 6}}

Macro Definition Documentation

◆ CLOCK_GATING_EN

#define CLOCK_GATING_EN   0

◆ DDR_COORD_TRANSLATE_TABLE

#define DDR_COORD_TRANSLATE_TABLE ( n)
Value:
((n) + 0x16)

◆ NIU_CFG_0

#define NIU_CFG_0   0x0

◆ NIU_CFG_0_AXI_SLAVE_ENABLE

#define NIU_CFG_0_AXI_SLAVE_ENABLE   15

◆ NIU_CFG_0_NOC_ID_TRANSLATE_EN

#define NIU_CFG_0_NOC_ID_TRANSLATE_EN   14

◆ NIU_CFG_0_TILE_CLK_OFF

#define NIU_CFG_0_TILE_CLK_OFF   12

◆ NIU_CFG_0_TILE_HEADER_STORE_OFF

#define NIU_CFG_0_TILE_HEADER_STORE_OFF   13 /* NOC2AXI only */

◆ NOC_ID_LOGICAL

#define NOC_ID_LOGICAL   0x12

◆ NOC_ID_TRANSLATE_COL_MASK

#define NOC_ID_TRANSLATE_COL_MASK   0x14

◆ NOC_ID_TRANSLATE_ROW_MASK

#define NOC_ID_TRANSLATE_ROW_MASK   0x15

◆ NOC_TRANSLATE_ID_WIDTH

#define NOC_TRANSLATE_ID_WIDTH   5

◆ NOC_TRANSLATE_TABLE_XY_SIZE

#define NOC_TRANSLATE_TABLE_XY_SIZE   (32 / NOC_TRANSLATE_ID_WIDTH)

◆ NOC_X_ID_TRANSLATE_TABLE

#define NOC_X_ID_TRANSLATE_TABLE ( n)
Value:
((n) + 0x6)

◆ NOC_Y_ID_TRANSLATE_TABLE

#define NOC_Y_ID_TRANSLATE_TABLE ( n)
Value:
((n) + 0xC)

◆ PRE_TRANSLATION_SIZE

#define PRE_TRANSLATION_SIZE   32

◆ ROUTER_CFG

#define ROUTER_CFG ( n)
Value:
((n) + 1)

◆ STREAM_PERF_CONFIG_REG_INDEX

#define STREAM_PERF_CONFIG_REG_INDEX   35

Function Documentation

◆ ApplyLogicalCoords()

void ApplyLogicalCoords ( struct NocTranslation * nt,
uint8_t post_x_start,
uint8_t post_y_start,
uint8_t post_x_end,
uint8_t post_y_end,
uint8_t pre_x_start,
uint8_t pre_y_start,
uint8_t pre_x_end,
uint8_t pre_y_end )
static

◆ ClearNocTranslation()

void ClearNocTranslation ( void )

◆ ComputeNocTranslation()

struct NocTranslation ComputeNocTranslation ( unsigned int pcie_instance,
uint16_t bad_tensix_cols,
uint8_t bad_gddr,
uint16_t skip_eth )
static

◆ CopyBytesSkipIndices()

void CopyBytesSkipIndices ( uint8_t * out,
const uint8_t * in,
size_t count,
uint32_t skip_mask )
static

◆ CopyNoc0ToNoc1()

void CopyNoc0ToNoc1 ( const struct NocTranslation * noc0,
struct NocTranslation * noc1 )
static

◆ DebugNocTranslationHandler()

uint8_t DebugNocTranslationHandler ( const union request * req,
struct response * rsp )
static

◆ DisableArcNocTranslation()

void DisableArcNocTranslation ( void )
static

◆ EnableOverlayCg()

void EnableOverlayCg ( uint8_t tlb_index,
uint8_t px,
uint8_t py )
static

◆ GetEnabledTensix()

void GetEnabledTensix ( uint8_t * x,
uint8_t * y )

◆ GetTileClkDisable()

bool GetTileClkDisable ( uint8_t px,
uint8_t py )
static

◆ InitNocTranslation()

void InitNocTranslation ( unsigned int pcie_instance,
uint16_t bad_tensix_cols,
uint8_t bad_gddr,
uint16_t skip_eth )

◆ InitNocTranslationFromHarvesting()

int InitNocTranslationFromHarvesting ( void )

◆ MakeIdentity()

void MakeIdentity ( struct NocTranslation * nt)
static

◆ NocInit()

int NocInit ( void )

◆ ProgramBroadcastExclusion()

void ProgramBroadcastExclusion ( uint16_t disabled_tensix_columns)
static

◆ ProgramNocTranslation()

void ProgramNocTranslation ( const struct NocTranslation * nt,
unsigned int noc_id )
static

◆ ReadNocCfgReg()

uint32_t ReadNocCfgReg ( volatile void * regs,
uint32_t cfg_reg_index )
static

◆ REGISTER_MESSAGE()

◆ SetLogicalCoord()

void SetLogicalCoord ( struct NocTranslation * nt,
uint8_t post_x,
uint8_t post_y,
uint8_t logical_x,
uint8_t logical_y )
static

◆ SetupNiuTlb()

volatile void * SetupNiuTlb ( uint8_t tlb_index,
uint8_t nx,
uint8_t ny,
uint8_t noc_id )
static

◆ SetupNiuTlbPhys()

volatile void * SetupNiuTlbPhys ( uint8_t tlb_index,
uint8_t px,
uint8_t py,
uint8_t noc_id )
static

◆ SYS_INIT_APP() [1/2]

◆ SYS_INIT_APP() [2/2]

SYS_INIT_APP ( NocInit )

◆ WriteNocCfgReg()

void WriteNocCfgReg ( volatile void * regs,
uint32_t cfg_reg_index,
uint32_t value )
static

Variable Documentation

◆ fwtable_dev

const struct device* const fwtable_dev = DEVICE_DT_GET(DT_NODELABEL(fwtable))
static

◆ kFirstCfgRegIndex

const uint32_t kFirstCfgRegIndex = 0x100 / sizeof(uint32_t)
static

◆ kGddrY

const uint8_t kGddrY[][3] = {{0, 1, 11}, {2, 10, 3}, {9, 4, 8}, {5, 7, 6}}
static

◆ kL2CpuNoc0Y

const uint8_t kL2CpuNoc0Y[] = {3, 9, 5, 7}
static

◆ kTensixEthNoc0X

const uint8_t kTensixEthNoc0X[] = {1, 16, 2, 15, 3, 14, 4, 13, 5, 12, 6, 11, 7, 10}
static

◆ kTlbIndex

const uint8_t kTlbIndex
static

◆ noc_translation_enabled

bool noc_translation_enabled
static