TT Zephyr Platforms 18.11.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
eth.c File Reference
#include "efuse.h"
#include "eth.h"
#include "harvesting.h"
#include "init.h"
#include "noc.h"
#include "noc_dma.h"
#include "noc_init.h"
#include "noc2axi.h"
#include "reg.h"
#include "serdes_eth.h"
#include <tenstorrent/post_code.h>
#include <tenstorrent/spi_flash_buf.h>
#include <tenstorrent/sys_init_defines.h>
#include <tenstorrent/tt_boot_fs.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>
#include <zephyr/init.h>
#include <zephyr/drivers/misc/bh_fwtable.h>

Data Structures

struct  RESET_UNIT_PCIE_MISC_CNTL3_reg_t
union  RESET_UNIT_PCIE_MISC_CNTL3_reg_u

Macros

#define ETH_SETUP_TLB   0
#define ETH_PARAM_ADDR   0x7c000
#define ERISC_L1_SIZE   (512 * 1024)
#define ETH_RESET_PC_0   0xFFB14000
#define ETH_END_PC_0   0xFFB14004
#define ETH_RESET_PC_1   0xFFB14008
#define ETH_END_PC_1   0xFFB1400C
#define ETH_RISC_DEBUG_SOFT_RESET_0   0xFFB121B0
#define ETH_MAC_ADDR_ORG   0x208C47 /* 20:8C:47 */
#define ETH_FW_CFG_TAG   "ethfwcfg"
#define ETH_FW_TAG   "ethfw"
#define ETH_SD_REG_TAG   "ethsdreg"
#define ETH_SD_FW_TAG   "ethsdfw"
#define RESET_UNIT_PCIE_MISC_CNTL3_REG_DEFAULT   0x00000000
#define RESET_UNIT_PCIE1_MISC_CNTL_3_REG_ADDR   0x8003050C
#define RESET_UNIT_PCIE_MISC_CNTL_3_REG_ADDR   0x8003009C

Functions

 LOG_MODULE_REGISTER (eth, CONFIG_TT_APP_LOG_LEVEL)
static void SetupEthTlb (uint32_t eth_inst, uint32_t ring, uint64_t addr)
void SetupEthSerdesMux (uint32_t eth_enabled)
uint32_t GetEthSel (uint32_t eth_enabled)
uint64_t GetMacAddressBase (void)
void ReleaseEthReset (uint32_t eth_inst, uint32_t ring)
int LoadEthFw (uint32_t eth_inst, uint32_t ring, uint8_t *buf, size_t buf_size, size_t spi_address, size_t image_size)
int LoadEthFwCfg (uint32_t eth_inst, uint32_t ring, uint8_t *buf, uint32_t eth_enabled, size_t spi_address, size_t image_size)
 Load the ETH FW configuration data into ETH L1 memory.
static void SerdesEthInit (void)
static void wipe_l1 (void)
static void EthInit (void)
static int eth_init (void)
 SYS_INIT_APP (eth_init)

Variables

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

Macro Definition Documentation

◆ ERISC_L1_SIZE

#define ERISC_L1_SIZE   (512 * 1024)

◆ ETH_END_PC_0

#define ETH_END_PC_0   0xFFB14004

◆ ETH_END_PC_1

#define ETH_END_PC_1   0xFFB1400C

◆ ETH_FW_CFG_TAG

#define ETH_FW_CFG_TAG   "ethfwcfg"

◆ ETH_FW_TAG

#define ETH_FW_TAG   "ethfw"

◆ ETH_MAC_ADDR_ORG

#define ETH_MAC_ADDR_ORG   0x208C47 /* 20:8C:47 */

◆ ETH_PARAM_ADDR

#define ETH_PARAM_ADDR   0x7c000

◆ ETH_RESET_PC_0

#define ETH_RESET_PC_0   0xFFB14000

◆ ETH_RESET_PC_1

#define ETH_RESET_PC_1   0xFFB14008

◆ ETH_RISC_DEBUG_SOFT_RESET_0

#define ETH_RISC_DEBUG_SOFT_RESET_0   0xFFB121B0

◆ ETH_SD_FW_TAG

#define ETH_SD_FW_TAG   "ethsdfw"

◆ ETH_SD_REG_TAG

#define ETH_SD_REG_TAG   "ethsdreg"

◆ ETH_SETUP_TLB

#define ETH_SETUP_TLB   0

◆ RESET_UNIT_PCIE1_MISC_CNTL_3_REG_ADDR

#define RESET_UNIT_PCIE1_MISC_CNTL_3_REG_ADDR   0x8003050C

◆ RESET_UNIT_PCIE_MISC_CNTL3_REG_DEFAULT

#define RESET_UNIT_PCIE_MISC_CNTL3_REG_DEFAULT   0x00000000

◆ RESET_UNIT_PCIE_MISC_CNTL_3_REG_ADDR

#define RESET_UNIT_PCIE_MISC_CNTL_3_REG_ADDR   0x8003009C

Function Documentation

◆ eth_init()

int eth_init ( void )
static

◆ EthInit()

void EthInit ( void )
static

◆ GetEthSel()

uint32_t GetEthSel ( uint32_t eth_enabled)

◆ GetMacAddressBase()

uint64_t GetMacAddressBase ( void )

◆ LoadEthFw()

int LoadEthFw ( uint32_t eth_inst,
uint32_t ring,
uint8_t * buf,
size_t buf_size,
size_t spi_address,
size_t image_size )

◆ LoadEthFwCfg()

int LoadEthFwCfg ( uint32_t eth_inst,
uint32_t ring,
uint8_t * buf,
uint32_t eth_enabled,
size_t spi_address,
size_t image_size )

Load the ETH FW configuration data into ETH L1 memory.

Parameters
eth_instETH instance to load the FW config for
ringLoad over NOC 0 or NOC 1
eth_enabledBitmask of enabled ETH instances
fw_cfg_imagePointer to the FW config data
fw_cfg_sizeSize of the FW config data
Returns
int 0 on success, -1 on failure

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( eth ,
CONFIG_TT_APP_LOG_LEVEL  )

◆ ReleaseEthReset()

void ReleaseEthReset ( uint32_t eth_inst,
uint32_t ring )

◆ SerdesEthInit()

void SerdesEthInit ( void )
static

◆ SetupEthSerdesMux()

void SetupEthSerdesMux ( uint32_t eth_enabled)

◆ SetupEthTlb()

void SetupEthTlb ( uint32_t eth_inst,
uint32_t ring,
uint64_t addr )
inlinestatic

◆ SYS_INIT_APP()

SYS_INIT_APP ( eth_init )

◆ wipe_l1()

void wipe_l1 ( void )
static

Variable Documentation

◆ flash

const struct device* flash = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(spi_flash))
static

◆ fwtable_dev

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