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

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_FW_BASE_ADDR   0x70000
#define ETH_PARAM_ADDR   0x7c000
#define ETH_FW_VERSION_ADDR_OFFSET   0x188
#define ETH_HEARTBEAT_ADDR   0x7cc70
#define ETH_SERDES_CFG_ADDR   0x7d600
#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_PCS_STATUS   0xFFB9800C
#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)
uint32_t GetEthFwVersion (uint32_t ring)
uint32_t GetEthHeartbeatStatus (uint32_t ring)
uint32_t GetEthLinkStatus (uint32_t ring)
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 int load_eth_serdes_cfg (uint32_t eth_inst, uint32_t ring, uint8_t *buf, size_t buf_size, size_t spi_address, size_t image_size)
static uint8_t SerdesEthInit (void)
static void wipe_l1 (void)
static uint8_t lookup_eth_fw_parts_fds (tt_boot_fs_fd *eth_fd, tt_boot_fs_fd *eth_cfg_fd, tt_boot_fs_fd *serdes_reg_fd)
static uint8_t load_eth_fw_parts (uint32_t eth_inst, uint32_t ring, uint8_t *buf, size_t buf_size, tt_boot_fs_fd *eth_fd, tt_boot_fs_fd *eth_cfg_fd, tt_boot_fs_fd *serdes_reg_fd)
static uint8_t EthInit (void)
static void assert_eth_risc_soft_reset (uint32_t eth_inst, uint32_t ring)
static uint8_t toggle_eth_reset_handler (const union request *req, struct response *rsp)
 REGISTER_MESSAGE (TT_SMC_MSG_TOGGLE_ETH_RESET, toggle_eth_reset_handler)
static int eth_init (void)
 SYS_INIT_APP (eth_init)

Variables

static const struct device *const eth_reset_dev = DEVICE_DT_GET(DT_NODELABEL(eth_reset))
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))
static const struct device *const arc_dma_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(dma0))
static const struct devicedma_noc = DEVICE_DT_GET(DT_NODELABEL(dma1))
static uint32_t saved_heartbeat [14]

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_BASE_ADDR

#define ETH_FW_BASE_ADDR   0x70000

◆ ETH_FW_CFG_TAG

#define ETH_FW_CFG_TAG   "ethfwcfg"

◆ ETH_FW_TAG

#define ETH_FW_TAG   "ethfw"

◆ ETH_FW_VERSION_ADDR_OFFSET

#define ETH_FW_VERSION_ADDR_OFFSET   0x188

◆ ETH_HEARTBEAT_ADDR

#define ETH_HEARTBEAT_ADDR   0x7cc70

◆ ETH_MAC_ADDR_ORG

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

◆ ETH_PARAM_ADDR

#define ETH_PARAM_ADDR   0x7c000

◆ ETH_PCS_STATUS

#define ETH_PCS_STATUS   0xFFB9800C

◆ 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_SERDES_CFG_ADDR

#define ETH_SERDES_CFG_ADDR   0x7d600

◆ 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

◆ assert_eth_risc_soft_reset()

void assert_eth_risc_soft_reset ( uint32_t eth_inst,
uint32_t ring )
static

◆ eth_init()

int eth_init ( void )
static

◆ EthInit()

uint8_t EthInit ( void )
static

◆ GetEthFwVersion()

uint32_t GetEthFwVersion ( uint32_t ring)

◆ GetEthHeartbeatStatus()

uint32_t GetEthHeartbeatStatus ( uint32_t ring)

◆ GetEthLinkStatus()

uint32_t GetEthLinkStatus ( uint32_t ring)

◆ GetEthSel()

uint32_t GetEthSel ( uint32_t eth_enabled)

◆ GetMacAddressBase()

uint64_t GetMacAddressBase ( void )

◆ load_eth_fw_parts()

uint8_t load_eth_fw_parts ( uint32_t eth_inst,
uint32_t ring,
uint8_t * buf,
size_t buf_size,
tt_boot_fs_fd * eth_fd,
tt_boot_fs_fd * eth_cfg_fd,
tt_boot_fs_fd * serdes_reg_fd )
static

◆ load_eth_serdes_cfg()

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

◆ 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
bufScratch buffer for reading flash data
eth_enabledBitmask of enabled ETH instances
spi_addressSPI flash address of the FW config image
image_sizeSize of the FW config image in bytes
Returns
0 on success, -1 on failure

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( eth ,
CONFIG_TT_APP_LOG_LEVEL  )

◆ lookup_eth_fw_parts_fds()

uint8_t lookup_eth_fw_parts_fds ( tt_boot_fs_fd * eth_fd,
tt_boot_fs_fd * eth_cfg_fd,
tt_boot_fs_fd * serdes_reg_fd )
static

◆ REGISTER_MESSAGE()

◆ ReleaseEthReset()

void ReleaseEthReset ( uint32_t eth_inst,
uint32_t ring )

◆ SerdesEthInit()

uint8_t 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 )

◆ toggle_eth_reset_handler()

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

◆ wipe_l1()

void wipe_l1 ( void )
static

Variable Documentation

◆ arc_dma_dev

const struct device* const arc_dma_dev = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(dma0))
static

◆ dma_noc

const struct device* dma_noc = DEVICE_DT_GET(DT_NODELABEL(dma1))
static

◆ eth_reset_dev

const struct device* const eth_reset_dev = DEVICE_DT_GET(DT_NODELABEL(eth_reset))
static

◆ 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

◆ saved_heartbeat

uint32_t saved_heartbeat[14]
static