mirror of
https://github.com/NVIDIA/open-gpu-kernel-modules.git
synced 2026-02-07 08:39:58 +00:00
545.23.06
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#define VERBOSE_MMIO_DISCOVERY 1
|
||||
#define VERBOSE_MMIO_DISCOVERY 0
|
||||
|
||||
#define MAKE_DISCOVERY_LS10(_engine) \
|
||||
{ \
|
||||
|
||||
@@ -863,3 +863,174 @@ nvswitch_bbx_get_sxid_ls10_free_and_exit:
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
NvlStatus
|
||||
nvswitch_bbx_get_data_ls10
|
||||
(
|
||||
nvswitch_device *device,
|
||||
NvU8 dataType,
|
||||
void *params
|
||||
)
|
||||
{
|
||||
NvlStatus status;
|
||||
void *pDmaBuf;
|
||||
NvU64 dmaHandle;
|
||||
FLCN *pFlcn;
|
||||
RM_FLCN_CMD_SOE bbxCmd;
|
||||
NvU32 cmdSeqDesc;
|
||||
NVSWITCH_TIMEOUT timeout;
|
||||
NvU32 transferSize;
|
||||
|
||||
if (!nvswitch_is_inforom_supported_ls10(device))
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: InfoROM is not supported\n", __FUNCTION__);
|
||||
return -NVL_ERR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (params == NULL)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: params is NULL\n", __FUNCTION__);
|
||||
return -NVL_BAD_ARGS;
|
||||
}
|
||||
|
||||
switch (dataType)
|
||||
{
|
||||
case RM_SOE_IFR_BBX_GET_SYS_INFO:
|
||||
transferSize = sizeof(NVSWITCH_GET_SYS_INFO_PARAMS);
|
||||
break;
|
||||
|
||||
case RM_SOE_IFR_BBX_GET_TIME_INFO:
|
||||
transferSize = sizeof(NVSWITCH_GET_TIME_INFO_PARAMS);
|
||||
break;
|
||||
|
||||
case RM_SOE_IFR_BBX_GET_TEMP_DATA:
|
||||
transferSize = sizeof(NVSWITCH_GET_TEMP_DATA_PARAMS);
|
||||
break;
|
||||
|
||||
case RM_SOE_IFR_BBX_GET_TEMP_SAMPLES:
|
||||
transferSize = sizeof(NVSWITCH_GET_TEMP_SAMPLES_PARAMS);
|
||||
break;
|
||||
default:
|
||||
NVSWITCH_PRINT(device, ERROR, "Unknown dataType %d", dataType);
|
||||
return -NVL_BAD_ARGS;
|
||||
break;
|
||||
}
|
||||
|
||||
status = nvswitch_os_alloc_contig_memory(device->os_handle, &pDmaBuf, transferSize,
|
||||
(device->dma_addr_width == 32));
|
||||
if (status != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to allocate contig memory. rc:%d\n", __FUNCTION__, status);
|
||||
return status;
|
||||
}
|
||||
|
||||
status = nvswitch_os_map_dma_region(device->os_handle, pDmaBuf, &dmaHandle,
|
||||
transferSize, NVSWITCH_DMA_DIR_TO_SYSMEM);
|
||||
if (status != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to map DMA region. rc:%d\n", __FUNCTION__, status);
|
||||
goto nvswitch_bbx_get_data_ls10_free_and_exit;
|
||||
}
|
||||
|
||||
nvswitch_os_memset(pDmaBuf, 0, transferSize);
|
||||
|
||||
pFlcn = device->pSoe->pFlcn;
|
||||
nvswitch_timeout_create(NVSWITCH_INTERVAL_5MSEC_IN_NS, &timeout);
|
||||
|
||||
nvswitch_os_memset(&bbxCmd, 0, sizeof(bbxCmd));
|
||||
bbxCmd.hdr.unitId = RM_SOE_UNIT_IFR;
|
||||
bbxCmd.hdr.size = sizeof(bbxCmd);
|
||||
bbxCmd.cmd.ifr.cmdType = RM_SOE_IFR_BBX_DATA_GET;
|
||||
bbxCmd.cmd.ifr.bbxDataGet.sizeInBytes = transferSize;
|
||||
bbxCmd.cmd.ifr.bbxDataGet.dataType = dataType;
|
||||
RM_FLCN_U64_PACK(&bbxCmd.cmd.ifr.bbxDataGet.dmaHandle, &dmaHandle);
|
||||
|
||||
status = flcnQueueCmdPostBlocking(device, pFlcn,
|
||||
(PRM_FLCN_CMD)&bbxCmd,
|
||||
NULL, // pMsg
|
||||
NULL, // pPayload
|
||||
SOE_RM_CMDQ_LOG_ID,
|
||||
&cmdSeqDesc,
|
||||
&timeout);
|
||||
if (status != NV_OK)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: BX_GET_DATA type=%d failed. rc:%d\n",
|
||||
__FUNCTION__, dataType, status);
|
||||
goto nvswitch_bbx_get_data_ls10_unmap_and_exit;
|
||||
}
|
||||
|
||||
status = nvswitch_os_sync_dma_region_for_cpu(device->os_handle, dmaHandle,
|
||||
transferSize,
|
||||
NVSWITCH_DMA_DIR_TO_SYSMEM);
|
||||
if (status != NV_OK)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to sync DMA region. rc:%d\n", __FUNCTION__, status);
|
||||
goto nvswitch_bbx_get_data_ls10_unmap_and_exit;
|
||||
}
|
||||
|
||||
if (dataType == RM_SOE_IFR_BBX_GET_SYS_INFO)
|
||||
{
|
||||
NVSWITCH_GET_SYS_INFO_PARAMS bbxSysInfoData = {0};
|
||||
|
||||
nvswitch_os_memcpy((NvU8 *)&bbxSysInfoData, (NvU8 *)pDmaBuf, sizeof(NVSWITCH_GET_SYS_INFO_PARAMS));
|
||||
nvswitch_os_memcpy((NvU8 *)params, (NvU8 *)&bbxSysInfoData, sizeof(NVSWITCH_GET_SYS_INFO_PARAMS));
|
||||
}
|
||||
else if (dataType == RM_SOE_IFR_BBX_GET_TIME_INFO)
|
||||
{
|
||||
NVSWITCH_GET_TIME_INFO_PARAMS bbxTimeInfoData = {0};
|
||||
|
||||
nvswitch_os_memcpy((NvU8 *)&bbxTimeInfoData, (NvU8 *)pDmaBuf, sizeof(NVSWITCH_GET_TIME_INFO_PARAMS));
|
||||
nvswitch_os_memcpy((NvU8 *)params, (NvU8 *)&bbxTimeInfoData, sizeof(NVSWITCH_GET_TIME_INFO_PARAMS));
|
||||
}
|
||||
else if (dataType == RM_SOE_IFR_BBX_GET_TEMP_DATA)
|
||||
{
|
||||
NVSWITCH_GET_TEMP_DATA_PARAMS *pBbxTempData = NULL;
|
||||
|
||||
pBbxTempData = nvswitch_os_malloc(sizeof(NVSWITCH_GET_TEMP_DATA_PARAMS));
|
||||
if (pBbxTempData == NULL)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "Out of memory: dataType %d", dataType);
|
||||
status = -NVL_NO_MEM;
|
||||
goto nvswitch_bbx_get_data_ls10_unmap_and_exit;
|
||||
}
|
||||
|
||||
nvswitch_os_memset(pBbxTempData, 0, sizeof(NVSWITCH_GET_TEMP_DATA_PARAMS));
|
||||
|
||||
nvswitch_os_memcpy((NvU8 *)pBbxTempData, (NvU8 *)pDmaBuf, sizeof(NVSWITCH_GET_TEMP_DATA_PARAMS));
|
||||
nvswitch_os_memcpy((NvU8 *)params, (NvU8 *)pBbxTempData, sizeof(NVSWITCH_GET_TEMP_DATA_PARAMS));
|
||||
|
||||
nvswitch_os_free(pBbxTempData);
|
||||
}
|
||||
else if (dataType == RM_SOE_IFR_BBX_GET_TEMP_SAMPLES)
|
||||
{
|
||||
NVSWITCH_GET_TEMP_SAMPLES_PARAMS *pBbxTempSamples = NULL;
|
||||
|
||||
pBbxTempSamples = nvswitch_os_malloc(sizeof(NVSWITCH_GET_TEMP_SAMPLES_PARAMS));
|
||||
if (pBbxTempSamples == NULL)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "Out of memory: dataType %d", dataType);
|
||||
status = -NVL_NO_MEM;
|
||||
goto nvswitch_bbx_get_data_ls10_unmap_and_exit;
|
||||
}
|
||||
|
||||
nvswitch_os_memset(pBbxTempSamples, 0, sizeof(NVSWITCH_GET_TEMP_SAMPLES_PARAMS));
|
||||
|
||||
nvswitch_os_memcpy((NvU8 *)pBbxTempSamples, (NvU8 *)pDmaBuf, sizeof(NVSWITCH_GET_TEMP_SAMPLES_PARAMS));
|
||||
nvswitch_os_memcpy((NvU8 *)params, (NvU8 *)pBbxTempSamples, sizeof(NVSWITCH_GET_TEMP_SAMPLES_PARAMS));
|
||||
|
||||
nvswitch_os_free(pBbxTempSamples);
|
||||
}
|
||||
else
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "Unknown dataType %d", dataType);
|
||||
goto nvswitch_bbx_get_data_ls10_unmap_and_exit;
|
||||
}
|
||||
|
||||
nvswitch_bbx_get_data_ls10_unmap_and_exit:
|
||||
nvswitch_os_unmap_dma_region(device->os_handle, pDmaBuf, dmaHandle,
|
||||
transferSize, NVSWITCH_DMA_DIR_FROM_SYSMEM);
|
||||
nvswitch_bbx_get_data_ls10_free_and_exit:
|
||||
nvswitch_os_free_contig_memory(device->os_handle, pDmaBuf, transferSize);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -5545,8 +5545,6 @@ _nvswitch_emit_link_errors_nvldl_fatal_link_ls10
|
||||
if (nvswitch_test_flags(pending, bit))
|
||||
{
|
||||
NVSWITCH_REPORT_FATAL(_HW_DLPL_LTSSM_FAULT_DOWN, "LTSSM Fault Down", NV_FALSE);
|
||||
error_event.error = INFOROM_NVLINK_DL_LTSSM_FAULT_DOWN_FATAL;
|
||||
nvswitch_inforom_nvlink_log_error_event(device, &error_event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5827,17 +5825,18 @@ _nvswitch_deferred_link_state_check_ls10
|
||||
NvU64 lastLinkUpTime;
|
||||
NvU64 lastRetrainTime;
|
||||
NvU64 current_time = nvswitch_os_get_platform_time();
|
||||
NvBool bRedeferLinkStateCheck;
|
||||
|
||||
chip_device = NVSWITCH_GET_CHIP_DEVICE_LS10(device);
|
||||
lastLinkUpTime = chip_device->deferredLinkErrors[link].state.lastLinkUpTime;
|
||||
lastRetrainTime = chip_device->deferredLinkErrors[link].state.lastRetrainTime;
|
||||
|
||||
// Sanity Check
|
||||
NVSWITCH_ASSERT(nvswitch_is_link_valid(device, link));
|
||||
|
||||
nvswitch_os_free(pErrorReportParams);
|
||||
pErrorReportParams = NULL;
|
||||
chip_device->deferredLinkErrors[link].state.bLinkStateCallBackEnabled = NV_FALSE;
|
||||
bRedeferLinkStateCheck = NV_FALSE;
|
||||
|
||||
// Link came up after last retrain
|
||||
if (lastLinkUpTime >= lastRetrainTime)
|
||||
@@ -5854,16 +5853,21 @@ _nvswitch_deferred_link_state_check_ls10
|
||||
{
|
||||
if ((current_time - lastRetrainTime) < NVSWITCH_DEFERRED_LINK_STATE_CHECK_INTERVAL_NS)
|
||||
{
|
||||
nvswitch_create_deferred_link_state_check_task_ls10(device, nvlipt_instance, link);
|
||||
return;
|
||||
bRedeferLinkStateCheck = NV_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (bRedeferLinkStateCheck)
|
||||
{
|
||||
nvswitch_create_deferred_link_state_check_task_ls10(device, nvlipt_instance, link);
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Otherwise, the link hasn't retrained within the timeout so emit the
|
||||
// deferred errors.
|
||||
//
|
||||
_nvswitch_emit_deferred_link_errors_ls10(device, nvlipt_instance, link);
|
||||
_nvswitch_emit_deferred_link_errors_ls10(device, nvlipt_instance, link);
|
||||
_nvswitch_clear_deferred_link_errors_ls10(device, link);
|
||||
}
|
||||
|
||||
@@ -5948,9 +5952,9 @@ _nvswitch_deferred_link_errors_check_ls10
|
||||
// It is assumed that this callback runs long before a link could have been
|
||||
// retrained and hit errors again.
|
||||
//
|
||||
_nvswitch_emit_deferred_link_errors_ls10(device, nvlipt_instance, link);
|
||||
_nvswitch_clear_deferred_link_errors_ls10(device, link);
|
||||
}
|
||||
_nvswitch_emit_deferred_link_errors_ls10(device, nvlipt_instance, link);
|
||||
_nvswitch_clear_deferred_link_errors_ls10(device, link);
|
||||
}
|
||||
|
||||
static void
|
||||
_nvswitch_create_deferred_link_errors_task_ls10
|
||||
@@ -6645,6 +6649,12 @@ _nvswitch_service_nvlipt_lnk_status_ls10
|
||||
|
||||
link = nvswitch_get_link(device, link_id);
|
||||
chip_device = NVSWITCH_GET_CHIP_DEVICE_LS10(device);
|
||||
|
||||
if (link == NULL)
|
||||
{
|
||||
return -NVL_BAD_ARGS;
|
||||
}
|
||||
|
||||
pending = NVSWITCH_LINK_RD32(device, link_id, NVLIPT_LNK, _NVLIPT_LNK, _INTR_STATUS);
|
||||
enabled = NVSWITCH_LINK_RD32(device, link_id, NVLIPT_LNK, _NVLIPT_LNK, _INTR_INT1_EN);
|
||||
pending &= enabled;
|
||||
@@ -6670,12 +6680,6 @@ _nvswitch_service_nvlipt_lnk_status_ls10
|
||||
{
|
||||
NVSWITCH_PRINT(device, INFO, "%s: nvlipt_lnk_status: Link is up!. LinkId %d\n",
|
||||
__FUNCTION__, link_id);
|
||||
if (nvswitch_lib_notify_client_events(device,
|
||||
NVSWITCH_DEVICE_EVENT_PORT_UP) != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify PORT_UP event. LinkId %d\n",
|
||||
__FUNCTION__, link_id);
|
||||
}
|
||||
|
||||
//
|
||||
// When a link comes up ensure that we finish off the post-training tasks:
|
||||
@@ -6684,7 +6688,7 @@ _nvswitch_service_nvlipt_lnk_status_ls10
|
||||
//
|
||||
nvswitch_corelib_training_complete_ls10(link);
|
||||
nvswitch_init_buffer_ready(device, link, NV_TRUE);
|
||||
link->bRxDetected = NV_TRUE;
|
||||
link->bRxDetected = NV_TRUE;
|
||||
|
||||
//
|
||||
// Clear out any cached interrupts for the link and update the last link up timestamp
|
||||
@@ -7754,38 +7758,51 @@ nvswitch_service_nvldl_fatal_link_ls10
|
||||
// pending DL interrupts. In order to log all error before wiping that state,
|
||||
// service all other interrupts before this one
|
||||
//
|
||||
|
||||
bit = DRF_NUM(_NVLDL_TOP, _INTR, _LTSSM_FAULT_DOWN, 1);
|
||||
if (nvswitch_test_flags(pending, bit))
|
||||
{
|
||||
nvswitch_record_port_event(device, &(device->log_PORT_EVENTS), link, NVSWITCH_PORT_EVENT_TYPE_DOWN);
|
||||
if (nvswitch_lib_notify_client_events(device,
|
||||
NVSWITCH_DEVICE_EVENT_PORT_DOWN) != NVL_SUCCESS)
|
||||
{
|
||||
dlDeferredIntrLinkMask |= bit;
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify PORT_DOWN event\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
dlDeferredIntrLinkMask |= bit;
|
||||
|
||||
//
|
||||
// Since reset and drain will reset the link, including clearing
|
||||
// pending interrupts, skip the clear write below. There are cases
|
||||
// where link clocks will not be on after reset and drain so there
|
||||
// maybe PRI errors on writing to the register
|
||||
//
|
||||
bRequireResetAndDrain = NV_TRUE;
|
||||
}
|
||||
//
|
||||
// Since reset and drain will reset the link, including clearing
|
||||
// pending interrupts, skip the clear write below. There are cases
|
||||
// where link clocks will not be on after reset and drain so there
|
||||
// maybe PRI errors on writing to the register
|
||||
//
|
||||
{
|
||||
bRequireResetAndDrain = NV_TRUE;
|
||||
}
|
||||
nvswitch_clear_flags(&unhandled, bit);
|
||||
}
|
||||
|
||||
bit = DRF_NUM(_NVLDL_TOP, _INTR, _LTSSM_FAULT_UP, 1);
|
||||
if (nvswitch_test_flags(pending, bit))
|
||||
{
|
||||
nvswitch_record_port_event(device, &(device->log_PORT_EVENTS), link, NVSWITCH_PORT_EVENT_TYPE_DOWN);
|
||||
if (nvswitch_lib_notify_client_events(device,
|
||||
NVSWITCH_DEVICE_EVENT_PORT_DOWN) != NVL_SUCCESS)
|
||||
{
|
||||
dlDeferredIntrLinkMask |= bit;
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify PORT_DOWN event\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
dlDeferredIntrLinkMask |= bit;
|
||||
|
||||
//
|
||||
// Since reset and drain will reset the link, including clearing
|
||||
// pending interrupts, skip the clear write below. There are cases
|
||||
// where link clocks will not be on after reset and drain so there
|
||||
// maybe PRI errors on writing to the register
|
||||
//
|
||||
bRequireResetAndDrain = NV_TRUE;
|
||||
}
|
||||
//
|
||||
// Since reset and drain will reset the link, including clearing
|
||||
// pending interrupts, skip the clear write below. There are cases
|
||||
// where link clocks will not be on after reset and drain so there
|
||||
// maybe PRI errors on writing to the register
|
||||
//
|
||||
{
|
||||
bRequireResetAndDrain = NV_TRUE;
|
||||
}
|
||||
nvswitch_clear_flags(&unhandled, bit);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,30 +98,6 @@ _nvswitch_configure_reserved_throughput_counters
|
||||
DRF_DEF(_NVLTLC_TX_LNK, _DEBUG_TP_CNTR_CTRL_0, _ENABLE, _ENABLE));
|
||||
}
|
||||
|
||||
void
|
||||
nvswitch_program_l1_scratch_reg_ls10
|
||||
(
|
||||
nvswitch_device *device,
|
||||
NvU32 linkNumber
|
||||
)
|
||||
{
|
||||
NvU32 scrRegVal;
|
||||
NvU32 tempRegVal;
|
||||
|
||||
// Read L1 register and store initial/VBIOS L1 Threshold Value in Scratch register
|
||||
tempRegVal = NVSWITCH_LINK_RD32_LS10(device, linkNumber, NVLIPT_LNK, _NVLIPT_LNK, _PWRM_L1_ENTER_THRESHOLD);
|
||||
|
||||
scrRegVal = NVSWITCH_LINK_RD32_LS10(device, linkNumber, NVLIPT_LNK, _NVLIPT_LNK, _SCRATCH_WARM);
|
||||
|
||||
// Update the scratch register value only if it has not been written to before
|
||||
if (scrRegVal == NV_NVLIPT_LNK_SCRATCH_WARM_DATA_INIT)
|
||||
{
|
||||
NVSWITCH_LINK_WR32_LS10(device, linkNumber, NVLIPT_LNK, _NVLIPT_LNK, _SCRATCH_WARM, tempRegVal);
|
||||
}
|
||||
}
|
||||
|
||||
#define BUG_3797211_LS10_VBIOS_VERSION 0x9610410000
|
||||
|
||||
void
|
||||
nvswitch_init_lpwr_regs_ls10
|
||||
(
|
||||
@@ -134,55 +110,33 @@ nvswitch_init_lpwr_regs_ls10
|
||||
NvU32 tempRegVal, lpEntryThreshold;
|
||||
NvU8 softwareDesired;
|
||||
NvBool bLpEnable;
|
||||
NvU64 biosVersion;
|
||||
|
||||
if (IS_RTLSIM(device) || IS_EMULATION(device) || IS_FMODEL(device))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (device->regkeys.enable_pm == NV_SWITCH_REGKEY_ENABLE_PM_NO)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (nvswitch_lib_get_bios_version(device, &biosVersion) != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, WARN, "%s Get VBIOS version failed.\n",
|
||||
__FUNCTION__);
|
||||
biosVersion = 0;
|
||||
}
|
||||
|
||||
// bios_config = nvswitch_get_bios_nvlink_config(device);
|
||||
if (biosVersion >= BUG_3797211_LS10_VBIOS_VERSION)
|
||||
|
||||
// IC Enter Threshold
|
||||
if (device->regkeys.lp_threshold == NV_SWITCH_REGKEY_SET_LP_THRESHOLD_DEFAULT)
|
||||
{
|
||||
// IC Enter Threshold
|
||||
if (device->regkeys.lp_threshold == NV_SWITCH_REGKEY_SET_LP_THRESHOLD_DEFAULT)
|
||||
{
|
||||
//
|
||||
// Do nothing since VBIOS (version 96.10.41.00.00 and above)
|
||||
// sets the default L1 threshold.
|
||||
// Refer Bug 3797211 for more info.
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
lpEntryThreshold = device->regkeys.lp_threshold;
|
||||
tempRegVal = 0;
|
||||
tempRegVal = FLD_SET_DRF_NUM(_NVLIPT, _LNK_PWRM_L1_ENTER_THRESHOLD, _THRESHOLD, lpEntryThreshold, tempRegVal);
|
||||
NVSWITCH_LINK_WR32_LS10(device, linkNum, NVLIPT_LNK, _NVLIPT_LNK, _PWRM_L1_ENTER_THRESHOLD, tempRegVal);
|
||||
}
|
||||
//
|
||||
// Do nothing since VBIOS sets the default L1 threshold.
|
||||
// Refer Bug 3797211 for more info.
|
||||
//
|
||||
}
|
||||
else
|
||||
{
|
||||
// IC Enter Threshold
|
||||
if (device->regkeys.lp_threshold == NV_SWITCH_REGKEY_SET_LP_THRESHOLD_DEFAULT)
|
||||
{
|
||||
lpEntryThreshold = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lpEntryThreshold = device->regkeys.lp_threshold;
|
||||
}
|
||||
|
||||
tempRegVal = 0;
|
||||
tempRegVal = FLD_SET_DRF_NUM(_NVLIPT, _LNK_PWRM_L1_ENTER_THRESHOLD, _THRESHOLD, lpEntryThreshold, tempRegVal);
|
||||
NVSWITCH_LINK_WR32_LS10(device, linkNum, NVLIPT_LNK, _NVLIPT_LNK, _PWRM_L1_ENTER_THRESHOLD, tempRegVal);
|
||||
lpEntryThreshold = device->regkeys.lp_threshold;
|
||||
tempRegVal = 0;
|
||||
tempRegVal = FLD_SET_DRF_NUM(_NVLIPT, _LNK_PWRM_L1_ENTER_THRESHOLD, _THRESHOLD, lpEntryThreshold, tempRegVal);
|
||||
NVSWITCH_LINK_WR32_LS10(device, linkNum, NVLIPT_LNK, _NVLIPT_LNK, _PWRM_L1_ENTER_THRESHOLD, tempRegVal);
|
||||
}
|
||||
|
||||
//LP Entry Enable
|
||||
@@ -211,6 +165,7 @@ nvswitch_corelib_training_complete_ls10
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify PORT_UP event\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
nvswitch_record_port_event(device, &(device->log_PORT_EVENTS), link->linkNumber, NVSWITCH_PORT_EVENT_TYPE_UP);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1470,7 +1425,7 @@ nvswitch_load_link_disable_settings_ls10
|
||||
nvswitch_device *device,
|
||||
nvlink_link *link
|
||||
)
|
||||
{
|
||||
{
|
||||
NvU32 regVal;
|
||||
|
||||
// Read state from NVLIPT HW
|
||||
@@ -1479,7 +1434,7 @@ nvswitch_load_link_disable_settings_ls10
|
||||
|
||||
if (FLD_TEST_DRF(_NVLIPT_LNK, _CTRL_LINK_STATE_STATUS, _CURRENTLINKSTATE, _DISABLE, regVal))
|
||||
{
|
||||
|
||||
|
||||
// Set link to invalid and unregister from corelib
|
||||
device->link[link->linkNumber].valid = NV_FALSE;
|
||||
nvlink_lib_unregister_link(link);
|
||||
@@ -1619,7 +1574,7 @@ nvswitch_reset_and_train_link_ls10
|
||||
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))
|
||||
(link_intr_subcode == MINION_ALARM_BUSY))
|
||||
{
|
||||
|
||||
status = nvswitch_request_tl_link_state_ls10(link,
|
||||
|
||||
@@ -1353,7 +1353,7 @@ nvswitch_init_warm_reset_ls10
|
||||
)
|
||||
{
|
||||
NVSWITCH_PRINT(device, WARN, "%s: Function not implemented\n", __FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Helper funcction to query MINION to see if DL clocks are on
|
||||
@@ -1401,11 +1401,8 @@ _nvswitch_are_dl_clocks_on
|
||||
return NV_TRUE;
|
||||
}
|
||||
|
||||
//
|
||||
// Implement reset and drain sequence for ls10
|
||||
//
|
||||
NvlStatus
|
||||
nvswitch_reset_and_drain_links_ls10
|
||||
static NvlStatus
|
||||
_nvswitch_reset_and_drain_links_ls10
|
||||
(
|
||||
nvswitch_device *device,
|
||||
NvU64 link_mask
|
||||
@@ -1425,7 +1422,6 @@ nvswitch_reset_and_drain_links_ls10
|
||||
NvBool bAreDlClocksOn;
|
||||
NVSWITCH_TIMEOUT timeout;
|
||||
|
||||
|
||||
if (link_mask == 0)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Invalid link_mask 0\n",
|
||||
@@ -1538,6 +1534,14 @@ nvswitch_reset_and_drain_links_ls10
|
||||
NVSWITCH_PRINT(device, ERROR,
|
||||
"%s: link %d failed to enter emergency shutdown\n",
|
||||
__FUNCTION__, link);
|
||||
|
||||
// Re-register links.
|
||||
status = nvlink_lib_register_link(device->nvlink_device, link_info);
|
||||
if (status != NVL_SUCCESS)
|
||||
{
|
||||
nvswitch_destroy_link(link_info);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1632,10 +1636,10 @@ nvswitch_reset_and_drain_links_ls10
|
||||
nvswitch_soe_restore_nport_state_ls10(device, link);
|
||||
|
||||
// Step 7.0 : Re-program the routing table for DBEs
|
||||
|
||||
|
||||
// Step 8.0 : Reset NVLW and NPORT interrupt state
|
||||
_nvswitch_link_reset_interrupts_ls10(device, link);
|
||||
|
||||
|
||||
// Re-register links.
|
||||
status = nvlink_lib_register_link(device->nvlink_device, link_info);
|
||||
if (status != NVL_SUCCESS)
|
||||
@@ -1654,16 +1658,18 @@ nvswitch_reset_and_drain_links_ls10
|
||||
// Request active, but don't block. FM will come back and check
|
||||
// active link status by blocking on this TLREQ's completion
|
||||
//
|
||||
status = nvswitch_request_tl_link_state_ls10(link_info,
|
||||
NV_NVLIPT_LNK_CTRL_LINK_STATE_REQUEST_REQUEST_ACTIVE,
|
||||
NV_FALSE);
|
||||
|
||||
if (status != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR,
|
||||
"%s: TL link state request to active for ALI failed for link: 0x%x\n",
|
||||
__FUNCTION__, link);
|
||||
continue;
|
||||
status = nvswitch_request_tl_link_state_ls10(link_info,
|
||||
NV_NVLIPT_LNK_CTRL_LINK_STATE_REQUEST_REQUEST_ACTIVE,
|
||||
NV_FALSE);
|
||||
|
||||
if (status != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR,
|
||||
"%s: TL link state request to active for ALI failed for link: 0x%x\n",
|
||||
__FUNCTION__, link);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
bAreDlClocksOn = NV_FALSE;
|
||||
@@ -1692,7 +1698,26 @@ nvswitch_reset_and_drain_links_ls10
|
||||
}
|
||||
FOR_EACH_INDEX_IN_MASK_END;
|
||||
|
||||
// TODO: CCI Links Support: Reset the CCI links
|
||||
return NVL_SUCCESS;
|
||||
}
|
||||
|
||||
//
|
||||
// Implement reset and drain sequence for ls10
|
||||
//
|
||||
NvlStatus
|
||||
nvswitch_reset_and_drain_links_ls10
|
||||
(
|
||||
nvswitch_device *device,
|
||||
NvU64 link_mask
|
||||
)
|
||||
{
|
||||
NvlStatus status = NVL_SUCCESS;
|
||||
|
||||
status = _nvswitch_reset_and_drain_links_ls10(device, link_mask);
|
||||
if (status != NVL_SUCCESS)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
return NVL_SUCCESS;
|
||||
}
|
||||
@@ -2841,17 +2866,6 @@ nvswitch_set_fatal_error_ls10
|
||||
|
||||
NVSWITCH_ASSERT(link_id < nvswitch_get_num_links(device));
|
||||
|
||||
// On first fatal error, notify PORT_DOWN
|
||||
if (!device->link[link_id].fatal_error_occurred)
|
||||
{
|
||||
if (nvswitch_lib_notify_client_events(device,
|
||||
NVSWITCH_DEVICE_EVENT_PORT_DOWN) != NVL_SUCCESS)
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify PORT_DOWN event\n",
|
||||
__FUNCTION__);
|
||||
}
|
||||
}
|
||||
|
||||
device->link[link_id].fatal_error_occurred = NV_TRUE;
|
||||
|
||||
if (device_fatal)
|
||||
@@ -2927,6 +2941,11 @@ nvswitch_is_soe_supported_ls10
|
||||
return NV_FALSE;
|
||||
}
|
||||
|
||||
if (device->regkeys.soe_disable == NV_SWITCH_REGKEY_SOE_DISABLE_YES)
|
||||
{
|
||||
NVSWITCH_PRINT(device, WARN, "SOE can not be disabled via regkey.\n");
|
||||
}
|
||||
|
||||
return NV_TRUE;
|
||||
}
|
||||
|
||||
@@ -5896,29 +5915,29 @@ nvswitch_read_vbios_link_entries_ls10
|
||||
tblPtr += (sizeof(NVLINK_VBIOS_CONFIG_DATA_LINKENTRY_20)/sizeof(NvU32));
|
||||
|
||||
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"<<<---- NvLink ID 0x%x ---->>>\n", i);
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 0 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam0, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam0));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 1 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam1, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam1));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 2 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam2, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam2));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 3 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam3, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam3));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 4 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam4, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam4));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 5 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam5, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam5));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 6 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam6, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam6));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 7 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam7, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam7));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 8 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam8, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam8));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"NVLink Params 9 \t0x%x \tBinary:"BYTE_TO_BINARY_PATTERN"\n", vbios_link_entry.nvLinkparam9, BYTE_TO_BINARY(vbios_link_entry.nvLinkparam9));
|
||||
NVSWITCH_PRINT(device, SETUP,
|
||||
NVSWITCH_PRINT(device, NOISY,
|
||||
"<<<---- NvLink ID 0x%x ---->>>\n\n", i);
|
||||
}
|
||||
*identified_link_entriesCount = i;
|
||||
|
||||
@@ -515,7 +515,7 @@ nvswitch_soe_disable_nport_fatal_interrupts_ls10
|
||||
NvlStatus stat;
|
||||
|
||||
stat = device->hal.nvswitch_ctrl_get_bios_info(device, &p);
|
||||
if ((stat != NVL_SUCCESS) || ((p.version & SOE_VBIOS_VERSION_MASK) <
|
||||
if ((stat != NVL_SUCCESS) || ((p.version & SOE_VBIOS_VERSION_MASK) <
|
||||
SOE_VBIOS_REVLOCK_DISABLE_NPORT_FATAL_INTR))
|
||||
{
|
||||
NVSWITCH_PRINT(device, ERROR,
|
||||
|
||||
Reference in New Issue
Block a user