TT-System-Firmware APIs 19.10.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
bh_fwtable.c File Reference
#include <stddef.h>
#include <pb_decode.h>
#include <tenstorrent/tt_boot_fs.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/misc/bh_fwtable.h>
#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <zephyr/logging/log.h>
Include dependency graph for bh_fwtable.c:

Data Structures

struct  bh_fwtable_config
struct  bh_fwtable_data

Macros

#define DT_DRV_COMPAT   tenstorrent_bh_fwtable
#define RESET_UNIT_STRAP_REGISTERS_L_REG_ADDR   0x80030D20
#define BH_FWTABLE_LOADCFG(_enum, _tag, _field, _msgtype)
#define DEFINE_BH_FWTABLE(_inst)

Enumerations

enum  bh_fwtable_e {
  BH_FWTABLE_FLSHINFO ,
  BH_FWTABLE_BOARDCFG ,
  BH_FWTABLE_CMFWCFG
}

Functions

 LOG_MODULE_REGISTER (bh_fwtable, CONFIG_BH_FWTABLE_LOG_LEVEL)
const FwTable * tt_bh_fwtable_get_fw_table (const struct device *dev)
const FlashInfoTable * tt_bh_fwtable_get_flash_info_table (const struct device *dev)
const ReadOnly * tt_bh_fwtable_get_read_only_table (const struct device *dev)
PcbType tt_bh_fwtable_get_pcb_type (const struct device *dev)
uint8_t tt_bh_fwtable_get_board_type (const struct device *dev)
bool tt_bh_fwtable_is_p300_left_chip (void)
uint32_t tt_bh_fwtable_get_asic_location (const struct device *dev)
static int tt_bh_fwtable_load (const struct device *dev, enum bh_fwtable_e table)
static int tt_bh_fwtable_init (const struct device *dev)

Macro Definition Documentation

◆ BH_FWTABLE_LOADCFG

#define BH_FWTABLE_LOADCFG ( _enum,
_tag,
_field,
_msgtype )
Value:
[BH_FWTABLE_##_enum] = { \
.tag = #_tag, \
.offs = offsetof(struct bh_fwtable_data, _field), \
.size = sizeof(((struct bh_fwtable_data *)0)->_field), \
.msg = &_msgtype##_msg, \
}
Definition bh_fwtable.c:34

◆ DEFINE_BH_FWTABLE

#define DEFINE_BH_FWTABLE ( _inst)
Value:
static struct bh_fwtable_data bh_fwtable_data_##_inst; \
static const struct bh_fwtable_config bh_fwtable_config_##_inst = { \
.flash = DEVICE_DT_GET(DT_INST_PHANDLE(_inst, flash_dev)), \
}; \
\
DEVICE_DT_INST_DEFINE(_inst, tt_bh_fwtable_init, NULL, &bh_fwtable_data_##_inst, \
&bh_fwtable_config_##_inst, POST_KERNEL, \
CONFIG_BH_FWTABLE_INIT_PRIORITY, NULL);
#define NULL
Definition avs.c:45
static int tt_bh_fwtable_init(const struct device *dev)
Definition bh_fwtable.c:212
#define DEVICE_DT_GET(node_id)
#define DT_INST_PHANDLE(inst, prop)
Definition bh_fwtable.c:30

◆ DT_DRV_COMPAT

#define DT_DRV_COMPAT   tenstorrent_bh_fwtable

◆ RESET_UNIT_STRAP_REGISTERS_L_REG_ADDR

#define RESET_UNIT_STRAP_REGISTERS_L_REG_ADDR   0x80030D20

Enumeration Type Documentation

◆ bh_fwtable_e

Enumerator
BH_FWTABLE_FLSHINFO 
BH_FWTABLE_BOARDCFG 
BH_FWTABLE_CMFWCFG 

Function Documentation

◆ LOG_MODULE_REGISTER()

LOG_MODULE_REGISTER ( bh_fwtable ,
CONFIG_BH_FWTABLE_LOG_LEVEL  )

◆ tt_bh_fwtable_get_asic_location()

uint32_t tt_bh_fwtable_get_asic_location ( const struct device * dev)

◆ tt_bh_fwtable_get_board_type()

uint8_t tt_bh_fwtable_get_board_type ( const struct device * dev)

◆ tt_bh_fwtable_get_flash_info_table()

const FlashInfoTable * tt_bh_fwtable_get_flash_info_table ( const struct device * dev)

◆ tt_bh_fwtable_get_fw_table()

const FwTable * tt_bh_fwtable_get_fw_table ( const struct device * dev)

◆ tt_bh_fwtable_get_pcb_type()

PcbType tt_bh_fwtable_get_pcb_type ( const struct device * dev)

◆ tt_bh_fwtable_get_read_only_table()

const ReadOnly * tt_bh_fwtable_get_read_only_table ( const struct device * dev)

◆ tt_bh_fwtable_init()

int tt_bh_fwtable_init ( const struct device * dev)
static

◆ tt_bh_fwtable_is_p300_left_chip()

bool tt_bh_fwtable_is_p300_left_chip ( void )

◆ tt_bh_fwtable_load()

int tt_bh_fwtable_load ( const struct device * dev,
enum bh_fwtable_e table )
static