Skip to content

Commit

Permalink
Read niu cfg info from PCI bar
Browse files Browse the repository at this point in the history
  • Loading branch information
pjanevskiTT committed Feb 14, 2025
1 parent c3c11d3 commit add80a7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions device/api/umd/device/blackhole_implementation.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ static const uint32_t SCRATCH_RAM_2 = 0x80030408;
static const uint32_t SCRATCH_RAM_12 = 0x80030430;
static const uint32_t SCRATCH_RAM_13 = 0x80030434;

static const uint32_t NIU_CFG_NOC0_BAR_ADDR = 0x1FD04100;
static const uint32_t NIU_CFG_NOC1_BAR_ADDR = 0x1FD14100;

static const size_t eth_translated_coordinate_start_x = 20;
static const size_t eth_translated_coordinate_start_y = 25;

Expand Down
8 changes: 6 additions & 2 deletions device/tt_device/blackhole_tt_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ ChipInfo BlackholeTTDevice::get_chip_info() {
// It is expected that this entry is always available.
chip_info.chip_uid.asic_location = telemetry->read_entry(blackhole::TAG_ASIC_ID);

const uint64_t niu_cfg_addr = 0x80050100;
const uint64_t addr = blackhole::NIU_CFG_NOC0_BAR_ADDR;
uint32_t niu_cfg;
read_from_device(&niu_cfg, tt_xy_pair{8, 0}, niu_cfg_addr, sizeof(uint32_t));
if (addr < get_pci_device()->bar0_uc_offset) {
read_block(addr, sizeof(niu_cfg), reinterpret_cast<uint8_t *>(&niu_cfg));
} else {
read_regs(addr, 1, &niu_cfg);
}

chip_info.noc_translation_enabled = ((niu_cfg >> 14) & 0x1) != 0;

Expand Down

0 comments on commit add80a7

Please sign in to comment.