TT-System-Firmware APIs 19.16.99
Tenstorrent Firmware
Loading...
Searching...
No Matches
pcie.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Tenstorrent AI ULC
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#ifndef PCIE_H
7#define PCIE_H
8
9#include <stdint.h>
10#include "noc2axi.h"
11
12/* Default PCIe BAR sizes, in MiB. Shared between pcie.c and the recovery
13 * chip-info backend (chip_info_static.c) so the synthesized recovery defaults
14 * stay in sync with the values pcie.c programs.
15 */
16#define PCIE_BAR0_SIZE_DEFAULT_MB 512
17#define PCIE_BAR2_SIZE_DEFAULT_MB 1
18#define PCIE_BAR4_SIZE_DEFAULT_MB 32768
19
20/* EQ settings libpciesd hardcoded before SYS-2216; also the recovery-table defaults */
21#define PCIE_GEN3_EQ_PSET_REQ_VEC_DEFAULT 0x3E0 /* request presets 5-9 */
22#define PCIE_GEN3_EQ_FB_MODE_DEFAULT 1 /* figure of merit, not direction */
23
24#define PCIE_INST0_LOGICAL_X 2
25#define PCIE_INST1_LOGICAL_X 11
26#define PCIE_LOGICAL_Y 0
27#define PCIE_DBI_REG_TLB 14
28
29static inline void WriteDbiReg(const uint32_t addr, const uint32_t data)
30{
31 const uint8_t noc_id = 0;
32
33 NOC2AXIWrite32(noc_id, PCIE_DBI_REG_TLB, addr, data);
34}
35
36static inline uint32_t ReadDbiReg(const uint32_t addr)
37{
38 const uint8_t noc_id = 0;
39
40 return NOC2AXIRead32(noc_id, PCIE_DBI_REG_TLB, addr);
41}
42#endif
static uint32_t NOC2AXIRead32(const uint8_t noc_id, const uint8_t tlb_entry, const uint64_t addr)
Definition noc2axi.h:57
static void NOC2AXIWrite32(const uint8_t noc_id, const uint8_t tlb_entry, const uint64_t addr, const uint32_t data)
Definition noc2axi.h:44
#define PCIE_DBI_REG_TLB
Definition pcie.h:27
static uint32_t ReadDbiReg(const uint32_t addr)
Definition pcie.h:36
static void WriteDbiReg(const uint32_t addr, const uint32_t data)
Definition pcie.h:29
__UINT32_TYPE__ uint32_t
__UINT8_TYPE__ uint8_t