TT-System-Firmware APIs 19.15.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
gddr_cal.h File Reference
#include <stdint.h>
Include dependency graph for gddr_cal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  gddr_cal_entry_t
 Per-controller CA calibration entry, latched from MRISC training results. More...
struct  gddr_cal_table_t
 GDDR CA calibration table, stored in the gddrcal flash partitions. More...

Macros

#define GDDR_CAL_NUM_ASICS   8
#define GDDR_CAL_NUM_CONTROLLERS   8
#define GDDR_CA_VREFC_OFFSET_MAX   0xF
#define GDDR_CA_TERMINATION_OFFSET_MAX   3
#define GDDR_CA_OCD_PULLDOWN_OFFSET_MAX   7
#define GDDR_CA_OCD_PULLDOWN_UNSET   0xFF

Functions

int gddr_cal_read (gddr_cal_table_t *table)
 Read and validate the CA calibration table from flash.
int gddr_cal_write (const gddr_cal_table_t *table)
 Write the CA calibration table to flash.

Macro Definition Documentation

◆ GDDR_CA_OCD_PULLDOWN_OFFSET_MAX

#define GDDR_CA_OCD_PULLDOWN_OFFSET_MAX   7

Widest CA driver strength code the 3-bit OCD pulldown field can hold.

◆ GDDR_CA_OCD_PULLDOWN_UNSET

#define GDDR_CA_OCD_PULLDOWN_UNSET   0xFF

CA driver strength sentinel: not seeded, MRISC keeps its board-type default.

◆ GDDR_CA_TERMINATION_OFFSET_MAX

#define GDDR_CA_TERMINATION_OFFSET_MAX   3

Widest CA termination offset the MR3 field can hold.

◆ GDDR_CA_VREFC_OFFSET_MAX

#define GDDR_CA_VREFC_OFFSET_MAX   0xF

Widest CA VREFC offset code the 4-bit MR10 field can hold.

◆ GDDR_CAL_NUM_ASICS

#define GDDR_CAL_NUM_ASICS   8

◆ GDDR_CAL_NUM_CONTROLLERS

#define GDDR_CAL_NUM_CONTROLLERS   8

Function Documentation

◆ gddr_cal_read()

int gddr_cal_read ( gddr_cal_table_t * table)

Read and validate the CA calibration table from flash.

Reads both banks, prefers the one with the newer sequence number, and falls back to the other if it fails validation. Erased banks fail the magic check and are treated as absent, as are banks written by an older firmware whose table layout differed.

CONFIG_TT_BH_ARC_GDDR_CA_LATCH requires gddrcal_a and gddrcal_b in the devicetree; a build without those nodes is rejected at compile time.

Parameters
[out]tableDestination table; only written on success.
Return values
0on success.
-ENODEVif the flash device is not ready.
-ENOENTif neither bank holds a valid table.
-ENOSYSif the latch Kconfig is off and the partitions are absent.

◆ gddr_cal_write()

int gddr_cal_write ( const gddr_cal_table_t * table)

Write the CA calibration table to flash.

Writes to whichever bank is not currently active, with a sequence number one greater than the active bank's, then reads the bank back and verifies it. The active bank is never erased, so a power loss at any point leaves the previous table intact and readable.

Parameters
[in]tableTable to store.
Return values
0on success, negative error code on failure.
-ENOSYSif the latch Kconfig is off and the partitions are absent.