Skip to content

Commit db6d194

Browse files
committed
[cru] Set the system id for the virtual links
1 parent 231d4b2 commit db6d194

File tree

5 files changed

+18
-5
lines changed

5 files changed

+18
-5
lines changed

src/Cru/Constants.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ static constexpr Register DATALINK_CONTROL(0x00000000);
279279
// [15 - 0] FEE ID
280280
// [23 - 16] SYSTEM ID
281281
static constexpr Register DATALINK_IDS(0x00000004);
282+
static constexpr Register VIRTUAL_LINKS_IDS(0x00100014);
282283
/*static constexpr uint32_t GBT_PACKET(0x1);
283284
static constexpr uint32_t GBT_STREAMING(0x0);*/
284285

src/Cru/CruBar.cxx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,8 @@ void CruBar::configure(bool force)
762762
toggleRunStatsLink(mRunStatsEnabled);
763763
}
764764

765+
setVirtualLinksIds(mSystemId);
766+
765767
/* UL + CL */
766768
if (mUserAndCommonLogicEnabled != reportInfo.userAndCommonLogicEnabled || force) {
767769
log("Toggling User and Common Logic", LogInfoDevel);
@@ -971,6 +973,12 @@ uint16_t CruBar::getCruId()
971973
return (readRegister(Cru::Registers::BSP_USER_CONTROL.index) >> 16) & 0x0fff;
972974
}
973975

976+
void CruBar::setVirtualLinksIds(uint16_t systemId)
977+
{
978+
mPdaBar->modifyRegister(Cru::Registers::VIRTUAL_LINKS_IDS.index, 16, 8, systemId);
979+
mPdaBar->modifyRegister(Cru::Registers::VIRTUAL_LINKS_IDS.index, 0, 16, 0x0);
980+
}
981+
974982
void CruBar::emulateCtp(Cru::CtpInfo ctpInfo)
975983
{
976984
Ttc ttc = Ttc(mPdaBar, mSerial);

src/Cru/CruBar.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,8 @@ class CruBar final : public BarInterfaceBase
128128
void setCruId(uint16_t cruId);
129129
uint16_t getCruId();
130130

131+
void setVirtualLinksIds(uint16_t systemId);
132+
131133
FirmwareFeatures parseFirmwareFeatures();
132134
FirmwareFeatures mFeatures;
133135

src/Cru/cru_constants_populate.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@
107107
'add_bsp_i2c_si5345_2':'SI5345_2',
108108
'add_bsp_i2c_si5344':'SI5344',
109109
'add_pcie_dma_ep_id':'ENDPOINT_ID',
110+
'add_ro_prot_system_id':'VIRTUAL_LINKS_IDS',
110111

111112
### SCA ###
112113
'add_gbt_sc':'SC_BASE_INDEX',

src/Cru/pack_cru_core.vhd

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ constant add_ro_prot_check_mask : unsigned(31 downto 0):=X"0000_0004"+add_ro_p
9898
constant add_ro_prot_alloc_fail : unsigned(31 downto 0):=X"0000_0008"+add_ro_protocol_base;
9999
constant add_ro_prot_ttc_linkerr : unsigned(31 downto 0):=X"0000_000C"+add_ro_protocol_base;
100100
constant add_ro_prot_nack_dly_reg : unsigned(31 downto 0):=X"0000_0010"+add_ro_protocol_base;
101+
constant add_ro_prot_system_id : unsigned(31 downto 0):=add_ro_protocol_base+X"0000_0014";
101102

102103
-------------------------------------------------------------------------------
103104
-- GBT address tables
@@ -313,10 +314,10 @@ constant add_serial_flash_wr_data : unsigned(31 downto 0):=X"00B0_0004";
313314
-------------------------------------------------------------------------------
314315
-- BSP address tables
315316
-------------------------------------------------------------------------------
316-
constant add_bsp_info : unsigned(31 downto 0):=add_bsp+X"0000_0000";
317-
constant add_bsp_hkeeping : unsigned(31 downto 0):=add_bsp+X"0001_0000";
318-
constant add_bsp_rsu : unsigned(31 downto 0):=add_bsp+X"0002_0000";
319-
constant add_bsp_i2c : unsigned(31 downto 0):=add_bsp+X"0003_0000";
317+
constant add_bsp_info : unsigned(31 downto 0):=add_bsp+X"0000_0000";
318+
constant add_bsp_hkeeping : unsigned(31 downto 0):=add_bsp+X"0001_0000";
319+
constant add_bsp_rsu : unsigned(31 downto 0):=add_bsp+X"0002_0000";
320+
constant add_bsp_i2c : unsigned(31 downto 0):=add_bsp+X"0003_0000";
320321

321322
constant add_bsp_info_dirtystatus : unsigned(31 downto 0) :=add_bsp_info+X"0000_0000";
322323
constant add_bsp_info_shorthash : unsigned(31 downto 0) :=add_bsp_info+X"0000_0004";
@@ -431,7 +432,7 @@ component bsp is
431432
DEBUGCTRL : out std_logic_vector(31 downto 0);
432433
---------------------------------------------------------------------------
433434
USERCTRL : out std_logic_vector(31 downto 0);
434-
USERTXSEL : out std_logic_vector(2*g_NUM_GBT_LINKS-1 downto 0);
435+
USERTXSEL : out std_logic_vector(4*g_NUM_GBT_LINKS-1 downto 0);
435436
---------------------------------------------------------------------------
436437
spare_in : in std_logic_vector(31 downto 0); -- general purpose in
437438
---------------------------------------------------------------------------

0 commit comments

Comments
 (0)