535.43.02

This commit is contained in:
Andy Ritger
2023-05-30 10:11:36 -07:00
parent 6dd092ddb7
commit eb5c7665a1
1403 changed files with 295367 additions and 86235 deletions

View File

@@ -121,8 +121,13 @@ nvswitch_init_lpwr_regs_ls10
// IC Enter Threshold
if (device->regkeys.lp_threshold == NV_SWITCH_REGKEY_SET_LP_THRESHOLD_DEFAULT)
{
//
// TODO: get from bios. Refer Bug 3626523 for more info.
lpEntryThreshold = 100;
//
// The threshold is measured in 100us unit. So lpEntryThreshold = 1
// means the threshold is set to 100us in the register.
//
lpEntryThreshold = 1;
}
else
{
@@ -505,7 +510,7 @@ nvswitch_reset_persistent_link_hw_state_ls10
NvU32 clocksMask = NVSWITCH_PER_LINK_CLOCK_SET(RXCLK)|NVSWITCH_PER_LINK_CLOCK_SET(TXCLK)|
NVSWITCH_PER_LINK_CLOCK_SET(NCISOCCLK);
nvlink_link *link = nvswitch_get_link(device, linkNumber);
if (nvswitch_is_link_in_reset(device, link))
if ((link == NULL) || nvswitch_is_link_in_reset(device, link))
{
return;
}
@@ -1225,11 +1230,13 @@ nvswitch_configure_error_rate_threshold_interrupt_ls10
if (bEnable)
{
link->errorThreshold.bInterruptTrigerred = NV_FALSE;
intrRegVal |= DRF_DEF(_NVLDL_TOP, _INTR_NONSTALL_EN, _RX_SHORT_ERROR_RATE, _ENABLE);
intrRegVal = FLD_SET_DRF_NUM(_NVLDL_TOP, _INTR_NONSTALL_EN, _RX_SHORT_ERROR_RATE, 1,
intrRegVal);
}
else
{
intrRegVal |= DRF_DEF(_NVLDL_TOP, _INTR_NONSTALL_EN, _RX_SHORT_ERROR_RATE, _DISABLE);
intrRegVal = FLD_SET_DRF_NUM(_NVLDL_TOP, _INTR_NONSTALL_EN, _RX_SHORT_ERROR_RATE, 0,
intrRegVal);
}
NVSWITCH_LINK_WR32_LS10(device, linkNumber, NVLDL,
@@ -1249,12 +1256,29 @@ nvswitch_init_dlpl_interrupts_ls10
NVSWITCH_LINK_WR32_LS10(device, linkNumber, NVLDL, _NVLDL_TOP, _INTR, 0xffffffff);
NVSWITCH_LINK_WR32_LS10(device, linkNumber, NVLDL, _NVLDL_TOP, _INTR_SW2, 0xffffffff);
// Set the interrupt bits
nvswitch_set_dlpl_interrupts_ls10(link);
// Setup error rate thresholds
nvswitch_set_error_rate_threshold_ls10(link, NV_TRUE);
nvswitch_configure_error_rate_threshold_interrupt_ls10(link, NV_TRUE);
}
void
nvswitch_set_dlpl_interrupts_ls10
(
nvlink_link *link
)
{
nvswitch_device *device = link->dev->pDevInfo;
NvU32 linkNumber = link->linkNumber;
// Stall tree routes to INTR_A which is connected to NVLIPT fatal tree
NVSWITCH_LINK_WR32_LS10(device, linkNumber, NVLDL, _NVLDL_TOP, _INTR_STALL_EN,
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _TX_REPLAY, _DISABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _TX_RECOVERY_SHORT, _DISABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _LTSSM_FAULT_UP, _ENABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _LTSSM_FAULT_DOWN, _ENABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _TX_FAULT_RAM, _ENABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _TX_FAULT_INTERFACE, _ENABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_STALL_EN, _TX_FAULT_SUBLINK_CHANGE, _DISABLE) |
@@ -1281,9 +1305,6 @@ nvswitch_init_dlpl_interrupts_ls10
DRF_DEF(_NVLDL_TOP, _INTR_NONSTALL_EN, _RX_CRC_COUNTER, _ENABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_NONSTALL_EN, _LTSSM_PROTOCOL, _DISABLE) |
DRF_DEF(_NVLDL_TOP, _INTR_NONSTALL_EN, _MINION_REQUEST, _DISABLE));
nvswitch_set_error_rate_threshold_ls10(link, NV_TRUE);
nvswitch_configure_error_rate_threshold_interrupt_ls10(link, NV_TRUE);
}
static NvU32
@@ -1433,7 +1454,7 @@ nvswitch_execute_unilateral_link_shutdown_ls10
NvU32 link_state_request;
NvU32 link_state;
NvU32 stat_data = 0;
NvU32 link_intr_subcode;
NvU32 link_intr_subcode = MINION_OK;
if (!NVSWITCH_IS_LINK_ENG_VALID_LS10(device, NVLDL, link->linkNumber))
{
@@ -1470,7 +1491,6 @@ nvswitch_execute_unilateral_link_shutdown_ls10
NV_NVLSTAT_MN00, 0, &stat_data) == NVL_SUCCESS)
{
link_intr_subcode = DRF_VAL(_NVLSTAT, _MN00, _LINK_INTR_SUBCODE, stat_data);
}
if ((link_state == NV_NVLIPT_LNK_CTRL_LINK_STATE_REQUEST_STATUS_MINION_REQUEST_FAIL) &&
(link_intr_subcode == MINION_ALARM_BUSY))
@@ -1488,6 +1508,13 @@ nvswitch_execute_unilateral_link_shutdown_ls10
{
break;
}
}
else
{
// Querying MINION for link_intr_subcode failed so retry
retry_count--;
}
} while (retry_count);
@@ -1510,7 +1537,7 @@ nvswitch_reset_and_train_link_ls10
NvU32 link_state_request;
NvU32 link_state;
NvU32 stat_data;
NvU32 link_intr_subcode;
NvU32 link_intr_subcode = MINION_OK;
nvswitch_execute_unilateral_link_shutdown_ls10(link);
nvswitch_corelib_clear_link_state_ls10(link);
@@ -1537,7 +1564,6 @@ nvswitch_reset_and_train_link_ls10
NV_NVLSTAT_MN00, 0, &stat_data) == NVL_SUCCESS)
{
link_intr_subcode = DRF_VAL(_NVLSTAT, _MN00, _LINK_INTR_SUBCODE, stat_data);
}
if ((link_state == NV_NVLIPT_LNK_CTRL_LINK_STATE_REQUEST_STATUS_MINION_REQUEST_FAIL) &&
(link_intr_subcode == MINION_ALARM_BUSY))
@@ -1557,6 +1583,12 @@ nvswitch_reset_and_train_link_ls10
break;
}
}
else
{
// failed to query minion for the link_intr_subcode so retry
retry_count--;
}
}
} while(retry_count);
if (status != NVL_SUCCESS)
@@ -1625,3 +1657,24 @@ nvswitch_are_link_clocks_on_ls10
return NV_TRUE;
}
NvBool
nvswitch_does_link_need_termination_enabled_ls10
(
nvswitch_device *device,
nvlink_link *link
)
{
// Not defined for LS10
return NV_FALSE;
}
NvlStatus
nvswitch_link_termination_setup_ls10
(
nvswitch_device *device,
nvlink_link* link
)
{
// Not supported for LS10
return -NVL_ERR_NOT_SUPPORTED;
}