![]() |
TT-System-Firmware APIs 19.10.99
Tenstorrent Firmware
|
#include "tenstorrent/smc_msg.h"#include "tenstorrent/msgqueue.h"#include "tenstorrent/post_code.h"#include "functional_efuse.h"#include <float.h>#include <math.h>#include <zephyr/init.h>#include <zephyr/kernel.h>#include <zephyr/logging/log.h>#include <zephyr/device.h>#include <zephyr/devicetree.h>#include <zephyr/drivers/clock_control.h>#include <zephyr/drivers/clock_control/clock_control_tt_bh.h>#include <zephyr/drivers/sensor.h>#include <zephyr/drivers/sensor/tenstorrent/pvt_tt_bh.h>
Data Structures | |
| struct | pd_ip_cfg0_t |
| union | pd_ip_cfg0_u |
| struct | ts_ip_cfg0_t |
| union | ts_ip_cfg0_u |
| struct | pvt_cntl_irq_en_reg_t |
| union | pvt_cntl_irq_en_reg_u |
| struct | pvt_cntl_ts_pd_irq_enable_reg_t |
| union | pvt_cntl_ts_pd_irq_enable_reg_u |
| struct | pvt_cntl_vm_irq_enable_reg_t |
| union | pvt_cntl_vm_irq_enable_reg_u |
| struct | pvt_cntl_vm_alarma_cfg_reg_t |
| union | pvt_cntl_vm_alarma_cfg_reg_u |
| struct | pvt_cntl_vm_alarmb_cfg_reg_t |
| union | pvt_cntl_vm_alarmb_cfg_reg_u |
| struct | pvt_cntl_clk_synth_reg_t |
| union | pvt_cntl_clk_synth_reg_u |
| struct | pvt_cntl_sdif_status_reg_t |
| union | pvt_cntl_sdif_status_reg_u |
| struct | pvt_cntl_sdif_reg_t |
| union | pvt_cntl_sdif_reg_u |
Functions | |
| LOG_MODULE_REGISTER (pvt_tt_bh, LOG_LEVEL_DBG) | |
| static uint16_t | temp_to_dout (float temp) |
| static void | pvt_tt_bh_interrupt_config (void) |
| static void | pvt_tt_bh_clock_config (void) |
| static void | wait_sdif_ready (uint32_t status_reg_addr) |
| static void | sdif_write (uint32_t status_reg_addr, uint32_t wr_data_reg_addr, uint32_t sdif_addr, uint32_t data) |
| static void | enable_aging_meas (void) |
| int | pvt_tt_bh_attr_get (const struct device *dev, enum sensor_channel chan, enum sensor_attribute attr, struct sensor_value *val) |
| static int | pvt_tt_bh_is_alive (void) |
| Verifies if the PVT device is alive according to section 18.1 of the datasheet. | |
| static int | pvt_tt_bh_init (const struct device *dev) |
Variables | |
| static const struct device *const | pll_dev_1 = DEVICE_DT_GET_OR_NULL(DT_NODELABEL(pll1)) |
| static const struct sensor_driver_api | pvt_tt_bh_driver_api |
| #define ALARM_A_THERM_TRIP_TEMP 83 |
| #define ALARM_B_THERM_TRIP_TEMP 109 |
| #define ALL_AGING_OSC 0x7 /* enable delay chain 19, 20, 21 for aging measurement */ |
| #define DEFINE_PVT_TT_BH | ( | id | ) |
| #define DT_DRV_COMPAT tenstorrent_bh_pvt |
| #define GET_PD_REG_ADDR | ( | ID, | |
| REG_NAME ) |
| #define GET_TS_REG_ADDR | ( | ID, | |
| REG_NAME ) |
| #define GET_VM_REG_ADDR | ( | ID, | |
| REG_NAME ) |
| #define IP_CFG0_ADDR 0x1 |
| #define IP_CFG1_ADDR 0x6 |
| #define IP_CFGA_ADDR 0x2 |
| #define IP_CNTL_ADDR 0x0 |
| #define IP_DATA_ADDR 0x3 |
| #define IP_POLLING_ADDR 0x4 |
| #define IP_TMR_ADDR 0x5 |
| #define NUM_PD 16 |
| #define NUM_TS 8 |
| #define NUM_VM 8 |
| #define PVT_CNTL_CLK_SYNTH_REG_DEFAULT (0x00010000) |
| #define PVT_CNTL_IRQ_EN_REG_ADDR 0x80080040 |
| #define PVT_CNTL_IRQ_EN_REG_DEFAULT (0x00000000) |
| #define PVT_CNTL_PD_00_IRQ_ENABLE_REG_ADDR 0x80080340 |
| #define PVT_CNTL_PD_00_SDIF_DATA_REG_ADDR 0x80080358 |
| #define PVT_CNTL_PD_00_SDIF_DONE_REG_ADDR 0x80080354 |
| #define PVT_CNTL_PD_CMN_CLK_SYNTH_REG_ADDR 0x80080300 |
| #define PVT_CNTL_PD_CMN_SDIF_REG_ADDR 0x8008030C |
| #define PVT_CNTL_PD_CMN_SDIF_REG_ADDR 0x8008030C |
| #define PVT_CNTL_PD_CMN_SDIF_STATUS_REG_ADDR 0x80080308 |
| #define PVT_CNTL_PD_CMN_SDIF_STATUS_REG_ADDR 0x80080308 |
| #define PVT_CNTL_SDIF_REG_DEFAULT (0x00000000) |
| #define PVT_CNTL_SDIF_STATUS_REG_DEFAULT (0x00000000) |
| #define PVT_CNTL_TS_00_ALARMA_CFG_REG_ADDR 0x800800E0 |
| #define PVT_CNTL_TS_00_ALARMB_CFG_REG_ADDR 0x800800E4 |
| #define PVT_CNTL_TS_00_IRQ_ENABLE_REG_ADDR 0x800800C0 |
| #define PVT_CNTL_TS_00_SDIF_DATA_REG_ADDR 0x800800D8 |
| #define PVT_CNTL_TS_00_SDIF_DONE_REG_ADDR 0x800800D4 |
| #define PVT_CNTL_TS_CMN_CLK_SYNTH_REG_ADDR 0x80080080 |
| #define PVT_CNTL_TS_CMN_SDIF_REG_ADDR 0x8008008C |
| #define PVT_CNTL_TS_CMN_SDIF_STATUS_REG_ADDR 0x80080088 |
| #define PVT_CNTL_TS_PD_IRQ_ENABLE_REG_DEFAULT (0x00000000) |
| #define PVT_CNTL_VM_00_IRQ_ENABLE_REG_ADDR 0x80080A00 |
| #define PVT_CNTL_VM_00_SDIF_RDATA_REG_ADDR 0x80080A30 |
| #define PVT_CNTL_VM_ALARMA_CFG_REG_DEFAULT (0x00000000) |
| #define PVT_CNTL_VM_ALARMB_CFG_REG_DEFAULT (0x00000000) |
| #define PVT_CNTL_VM_CMN_CLK_SYNTH_REG_ADDR 0x80080800 |
| #define PVT_CNTL_VM_CMN_SDIF_REG_ADDR 0x8008080C |
| #define PVT_CNTL_VM_CMN_SDIF_STATUS_REG_ADDR 0x80080808 |
| #define PVT_CNTL_VM_IRQ_ENABLE_REG_DEFAULT (0x00000000) |
| #define PVT_ID_NUM 0x80080008 |
| #define PVT_TM_SCRATCH 0x8008000C |
| #define TS_HYSTERESIS_DELTA 5 |
| #define TS_PD_OFFSET 0x40 |
| #define VM_OFFSET 0x200 |
|
static |
| LOG_MODULE_REGISTER | ( | pvt_tt_bh | , |
| LOG_LEVEL_DBG | ) |
| int pvt_tt_bh_attr_get | ( | const struct device * | dev, |
| enum sensor_channel | chan, | ||
| enum sensor_attribute | attr, | ||
| struct sensor_value * | val ) |
|
inlinestatic |
|
static |
|
inlinestatic |
|
static |
Verifies if the PVT device is alive according to section 18.1 of the datasheet.
Performs the following steps in order, 1) Verifies ID is 0 2) Verifies scratch register is 0x0 3) Verifies writing scratch register by walking 1s
If these checks fail, the PVT sensor should not be considered reliable.
| 0 | On success. |
| -EIO | On hardware failure with error logs. |
|
static |
|
static |
|
static |
|
static |
|
static |