TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
|
#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}} |
#define CLOCK_GATING_EN 0 |
#define DDR_COORD_TRANSLATE_TABLE | ( | n | ) |
#define NIU_CFG_0 0x0 |
#define NIU_CFG_0_AXI_SLAVE_ENABLE 15 |
#define NIU_CFG_0_NOC_ID_TRANSLATE_EN 14 |
#define NIU_CFG_0_TILE_CLK_OFF 12 |
#define NIU_CFG_0_TILE_HEADER_STORE_OFF 13 /* NOC2AXI only */ |
#define NOC_ID_LOGICAL 0x12 |
#define NOC_ID_TRANSLATE_COL_MASK 0x14 |
#define NOC_ID_TRANSLATE_ROW_MASK 0x15 |
#define NOC_TRANSLATE_ID_WIDTH 5 |
#define NOC_TRANSLATE_TABLE_XY_SIZE (32 / NOC_TRANSLATE_ID_WIDTH) |
#define NOC_X_ID_TRANSLATE_TABLE | ( | n | ) |
#define NOC_Y_ID_TRANSLATE_TABLE | ( | n | ) |
#define PRE_TRANSLATION_SIZE 32 |
#define ROUTER_CFG | ( | n | ) |
#define STREAM_PERF_CONFIG_REG_INDEX 35 |
|
static |
void ClearNocTranslation | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
void InitNocTranslation | ( | unsigned int | pcie_instance, |
uint16_t | bad_tensix_cols, | ||
uint8_t | bad_gddr, | ||
uint16_t | skip_eth ) |
int InitNocTranslationFromHarvesting | ( | void | ) |
|
static |
int NocInit | ( | void | ) |
|
static |
|
static |
REGISTER_MESSAGE | ( | TT_SMC_MSG_DEBUG_NOC_TRANSLATION | , |
DebugNocTranslationHandler | ) |
|
static |
|
static |
SYS_INIT_APP | ( | InitNocTranslationFromHarvesting | ) |
SYS_INIT_APP | ( | NocInit | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |