555.42.02

(cherry picked from commit 5a1c474040)
This commit is contained in:
Bernhard Stoeckner
2024-05-21 15:11:46 +02:00
committed by Gaurav Juvekar
parent caa2dd11a0
commit 3084c04453
1004 changed files with 172522 additions and 150960 deletions

View File

@@ -208,6 +208,13 @@ typedef struct
NvBool bEnable;
} RM_SOE_CORE_CMD_NPORT_INTRS;
typedef struct
{
NvU8 cmdType;
NvU32 nport;
NvBool bStop;
} RM_SOE_CORE_CMD_INGRESS_STOP;
typedef struct
{
NvU8 cmdType;
@@ -284,6 +291,7 @@ typedef union
RM_SOE_CORE_CMD_WRITE_CPLD writeCpld;
RM_SOE_CORE_CMD_PERFORM_ONBOARD_PHASE performOnboardPhase;
RM_SOE_CORE_CMD_NPORT_FATAL_INTR nportDisableIntr;
RM_SOE_CORE_CMD_INGRESS_STOP ingressStop;
} RM_SOE_CORE_CMD;
typedef struct

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -87,7 +87,7 @@ _nvswitch_fsp_poll_for_queue_empty
do
{
bKeepPolling = nvswitch_timeout_check(&timeout) ? NV_FALSE : NV_TRUE;
bKeepPolling = nvswitch_timeout_check(&timeout) ? NV_FALSE : NV_TRUE;
bMsgqEmpty = _nvswitch_fsp_is_msgq_empty(device);
bCmdqEmpty = _nvswitch_fsp_is_queue_empty(device);
@@ -98,7 +98,7 @@ _nvswitch_fsp_poll_for_queue_empty
//
if (!bCmdqEmpty && !bMsgqEmpty)
{
nvswitch_fsp_read_message(device, NULL, 0, &timeout);
nvswitch_fsp_read_message(device, NULL, 0);
NVSWITCH_PRINT(device, ERROR, "Received error message from FSP while waiting for CMDQ to be empty.\n");
return -NVL_ERR_GENERIC;
}
@@ -125,22 +125,23 @@ _nvswitch_fsp_poll_for_queue_empty
* @brief Poll for response from FSP via RM message queue
*
* @param[in] device nvswitch_device pointer
* @param[in] pTimeout RPC timeout
*
* @return NVL_SUCCESS, or NV_ERR_TIMEOUT
*/
static NvlStatus
_nvswitch_fsp_poll_for_response
(
nvswitch_device *device,
NVSWITCH_TIMEOUT *pTimeout
nvswitch_device *device
)
{
NvBool bKeepPolling;
NVSWITCH_TIMEOUT timeout;
nvswitch_timeout_create(10 * NVSWITCH_INTERVAL_1MSEC_IN_NS, &timeout);
do
{
bKeepPolling = nvswitch_timeout_check(pTimeout) ? NV_FALSE : NV_TRUE;
bKeepPolling = nvswitch_timeout_check(&timeout) ? NV_FALSE : NV_TRUE;
//
// Poll for message queue to wait for FSP's reply
@@ -177,8 +178,6 @@ _nvswitch_fsp_poll_for_response
* @param[in] device nvswitch_device pointer
* @param[in/out] pPayloadBuffer Buffer in which to return message payload
* @param[in] payloadBufferSize Payload buffer size
* @param[in] pTimeout RPC timeout
*
*
* @return NVL_SUCCESS, NV_ERR_INVALID_DATA, NV_ERR_INSUFFICIENT_RESOURCES, or errors
* from functions called within
@@ -188,8 +187,7 @@ nvswitch_fsp_read_message
(
nvswitch_device *device,
NvU8 *pPayloadBuffer,
NvU32 payloadBufferSize,
NVSWITCH_TIMEOUT *pTimeout
NvU32 payloadBufferSize
)
{
NvU8 *pPacketBuffer;
@@ -208,7 +206,7 @@ nvswitch_fsp_read_message
if (pPacketBuffer == NULL)
{
NVSWITCH_PRINT(device, ERROR,
"%s: Failed to allocate memory!!\n", __FUNCTION__);
"Failed to allocate memory for GLT!!\n");
return -NVL_NO_MEM;
}
@@ -221,10 +219,9 @@ nvswitch_fsp_read_message
NvU8 tag;
// Wait for next packet
status = _nvswitch_fsp_poll_for_response(device, pTimeout);
status = _nvswitch_fsp_poll_for_response(device);
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR, "%s: Timed out waiting for response from FSP!\n", __FUNCTION__);
goto done;
}
@@ -356,7 +353,6 @@ nvswitch_fsp_send_packet
* @param[in] nvdmType NVDM type of message being sent
* @param[in] pResponsePayload Buffer in which to return response payload
* @param[in] responseBufferSize Response payload buffer size
* @param[in] pTimeout RPC timeout
*
* @return NVL_SUCCESS, or NV_ERR_*
*/
@@ -368,8 +364,7 @@ nvswitch_fsp_send_and_read_message
NvU32 size,
NvU32 nvdmType,
NvU8 *pResponsePayload,
NvU32 responseBufferSize,
NVSWITCH_TIMEOUT *pTimeout
NvU32 responseBufferSize
)
{
NvU32 dataSent, dataRemaining;
@@ -448,13 +443,12 @@ nvswitch_fsp_send_and_read_message
}
}
status = _nvswitch_fsp_poll_for_response(device, pTimeout);
status = _nvswitch_fsp_poll_for_response(device);
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR, "%s: Timed out waiting for response from FSP!\n", __FUNCTION__);
goto failed;
}
status = nvswitch_fsp_read_message(device, pResponsePayload, responseBufferSize, pTimeout);
status = nvswitch_fsp_read_message(device, pResponsePayload, responseBufferSize);
failed:
nvswitch_os_free(pBuffer);

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -91,8 +91,8 @@ typedef enum mctp_packet_state
MCTP_PACKET_STATE_SINGLE_PACKET
} MCTP_PACKET_STATE, *PMCTP_PACKET_STATE;
NvlStatus nvswitch_fsp_read_message(nvswitch_device *device, NvU8 *pPayloadBuffer, NvU32 payloadBufferSize, struct NVSWITCH_TIMEOUT *pTimeout);
NvlStatus nvswitch_fsp_read_message(nvswitch_device *device, NvU8 *pPayloadBuffer, NvU32 payloadBufferSize);
NvlStatus nvswitch_fsp_send_packet(nvswitch_device *device, NvU8 *pPacket, NvU32 packetSize);
NvlStatus nvswitch_fsp_send_and_read_message(nvswitch_device *device, NvU8 *pPayload, NvU32 size, NvU32 nvdmType, NvU8 *pResponsePayload, NvU32 responseBufferSize, struct NVSWITCH_TIMEOUT *pTimeout);
NvlStatus nvswitch_fsp_send_and_read_message(nvswitch_device *device, NvU8 *pPayload, NvU32 size, NvU32 nvdmType, NvU8 *pResponsePayload, NvU32 responseBufferSize);
#endif //_FSPRPC_NVSWITCH_H_

View File

@@ -288,6 +288,7 @@
_op(NvlStatus, nvswitch_fsp_error_code_to_nvlstatus_map, (nvswitch_device *device, NvU32 errorCode), _arch) \
_op(NvlStatus, nvswitch_fsp_get_packet_info, (nvswitch_device *device, NvU8 *pBuffer, NvU32 size, NvU8 *pPacketState, NvU8 *pTag), _arch) \
_op(NvlStatus, nvswitch_fsprpc_get_caps, (nvswitch_device *device, NVSWITCH_FSPRPC_GET_CAPS_PARAMS *params), _arch) \
_op(NvlStatus, nvswitch_soe_issue_ingress_stop, (nvswitch_device *device, NvU32 nport, NvBool bStop), _arch) \
_op(NvlStatus, nvswitch_detect_tnvl_mode, (nvswitch_device *device), _arch) \
_op(NvBool, nvswitch_is_tnvl_mode_enabled, (nvswitch_device *device), _arch) \
_op(NvBool, nvswitch_is_tnvl_mode_locked, (nvswitch_device *device), _arch) \

View File

@@ -42,7 +42,8 @@
__FUNCTION__, __LINE__, _unhandled); \
NVSWITCH_PRINT_SXID(_device, \
NVSWITCH_ERR_HW_HOST_UNHANDLED_INTERRUPT, \
"Fatal, unhandled interrupt\n"); \
"Fatal, unhandled interrupt in %s(%d)\n", \
__FUNCTION__, __LINE__); \
NVSWITCH_LOG_FATAL_DATA(_device, _HW, \
_HW_HOST_UNHANDLED_INTERRUPT, 0, 0, NV_FALSE, &_unhandled);\
} \

View File

@@ -62,5 +62,6 @@ void nvswitch_soe_unregister_events_lr10(nvswitch_device *device);
void nvswitch_therm_soe_callback_lr10(nvswitch_device *device, union RM_FLCN_MSG *pMsg,
void *pParams, NvU32 seqDesc, NV_STATUS status);
NvlStatus nvswitch_soe_register_event_callbacks_lr10(nvswitch_device *device);
void nvswitch_soe_init_l2_state_lr10(nvswitch_device *device);
void nvswitch_soe_init_l2_state_lr10(nvswitch_device *device);
NvlStatus nvswitch_soe_issue_ingress_stop_lr10(nvswitch_device *device, NvU32 nport, NvBool bStop);
#endif //_SOE_LR10_H_

View File

@@ -188,7 +188,7 @@
#define SOE_VBIOS_VERSION_MASK 0xFF0000
#define SOE_VBIOS_REVLOCK_DISABLE_NPORT_FATAL_INTR 0x370000
#define SOE_VBIOS_REVLOCK_ISSUE_INGRESS_STOP 0x440000
#define SOE_VBIOS_REVLOCK_ISSUE_INGRESS_STOP 0x4C0000
// LS10 Saved LED state
#define ACCESS_LINK_LED_STATE CPLD_MACHXO3_ACCESS_LINK_LED_CTL_NVL_CABLE_LED
@@ -220,12 +220,6 @@
#define NVSWITCH_MINION_WR32_BCAST_LS10(_d, _dev, _reg, _data) \
NVSWITCH_ENG_WR32(_d, MINION, _BCAST, 0, _dev, _reg, _data)
#define NVSWITCH_NPG_WR32_LS10(_d, _engidx, _dev, _reg, _data) \
NVSWITCH_ENG_WR32(_d, NPG, , _engidx, _dev, _reg, _data)
#define NVSWITCH_NPG_RD32_LS10(_d, _engidx, _dev, _reg) \
NVSWITCH_ENG_RD32(_d, NPG, , _engidx, _dev, _reg)
//
// Per-chip device information
//
@@ -515,7 +509,7 @@ typedef struct
NV_NPORT_PORTSTAT_LS10(_block, _reg, _idx, ), _data); \
}
#define NVSWITCH_DEFERRED_LINK_STATE_CHECK_INTERVAL_NS ((device->bModeContinuousALI ? 15 : 30) *\
#define NVSWITCH_DEFERRED_LINK_STATE_CHECK_INTERVAL_NS ((device->bModeContinuousALI ? 12 : 30) *\
NVSWITCH_INTERVAL_1SEC_IN_NS)
#define NVSWITCH_DEFERRED_FAULT_UP_CHECK_INTERVAL_NS (12 * NVSWITCH_INTERVAL_1MSEC_IN_NS)
@@ -613,6 +607,7 @@ typedef struct
// Nvlink error reporting management
NVLINK_LINK_ERROR_REPORTING deferredLinkErrors[NVSWITCH_NUM_LINKS_LS10];
NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS deferredLinkErrorsArgs[NVSWITCH_NUM_LINKS_LS10];
} ls10_device;
@@ -857,7 +852,6 @@ typedef const struct
#define nvswitch_link_lane_reversed_ls10 nvswitch_link_lane_reversed_lr10
#define nvswitch_i2c_get_port_info_ls10 nvswitch_i2c_get_port_info_lr10
#define nvswitch_i2c_set_hw_speed_mode_ls10 nvswitch_i2c_set_hw_speed_mode_lr10
#define nvswitch_ctrl_get_err_info_ls10 nvswitch_ctrl_get_err_info_lr10
@@ -938,6 +932,7 @@ NvlStatus nvswitch_request_tl_link_state_lr10(nvlink_link *link, NvU32 tlLinkSta
NvlStatus nvswitch_wait_for_tl_request_ready_lr10(nvlink_link *link);
NvlStatus nvswitch_parse_bios_image_lr10(nvswitch_device *device);
NvU32 nvswitch_i2c_get_port_info_ls10(nvswitch_device *device, NvU32 port);
NvU32 nvswitch_i2c_get_port_info_lr10(nvswitch_device *device, NvU32 port);
void nvswitch_i2c_set_hw_speed_mode_lr10(nvswitch_device *device, NvU32 port, NvU32 speedMode);
NvlStatus nvswitch_ctrl_i2c_indexed_lr10(nvswitch_device *device, NVSWITCH_CTRL_I2C_INDEXED_PARAMS *pParams);

View File

@@ -50,5 +50,5 @@ void nvswitch_heartbeat_soe_callback_ls10(nvswitch_device *device, RM_FLCN_
NvlStatus nvswitch_soe_set_nport_interrupts_ls10(nvswitch_device *device, NvU32 nport, NvBool bEnable);
void nvswitch_soe_disable_nport_fatal_interrupts_ls10(nvswitch_device *device, NvU32 nport,
NvU32 nportIntrEnable, NvU8 nportIntrType);
NvlStatus nvswitch_soe_issue_ingress_stop_ls10(nvswitch_device *device, NvU32 nport, NvBool bStop);
#endif //_SOE_LS10_H_

View File

@@ -2419,6 +2419,7 @@ nvswitch_ctrl_set_routing_id_valid_lr10
NvU32 ram_address = p->firstIndex;
NvU32 i;
NvU32 ram_size;
NvlStatus retval;
if (!NVSWITCH_IS_LINK_ENG_VALID_LR10(device, NPORT, p->portNum))
{
@@ -2441,6 +2442,15 @@ nvswitch_ctrl_set_routing_id_valid_lr10
return -NVL_BAD_ARGS;
}
// Stop traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_TRUE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to stop traffic on nport %d\n", p->portNum);
return retval;
}
// Select RID RAM and disable Auto Increment.
rid_ctrl =
DRF_DEF(_INGRESS, _REQRSPMAPADDR, _RAM_SEL, _SELECTSRIDROUTERAM) |
@@ -2472,6 +2482,14 @@ nvswitch_ctrl_set_routing_id_valid_lr10
NVSWITCH_LINK_WR32_LR10(device, p->portNum, NPORT, _INGRESS, _RIDTABDATA0, rid_tab_data0);
}
// Allow traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_FALSE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to restart traffic on nport %d\n", p->portNum);
return retval;
}
return NVL_SUCCESS;
}
@@ -2543,8 +2561,26 @@ nvswitch_ctrl_set_routing_id_lr10
}
}
// Stop traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_TRUE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to stop traffic on nport %d\n", p->portNum);
return retval;
}
_nvswitch_set_routing_id_lr10(device, p->portNum, p->firstIndex, p->numEntries, p->routingId);
// Allow traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_FALSE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to restart traffic on nport %d\n", p->portNum);
return retval;
}
return retval;
}
@@ -2702,8 +2738,26 @@ nvswitch_ctrl_set_routing_lan_lr10
}
}
// Stop traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_TRUE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to stop traffic on nport %d\n", p->portNum);
return retval;
}
_nvswitch_set_routing_lan_lr10(device, p->portNum, p->firstIndex, p->numEntries, p->routingLan);
// Allow traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_FALSE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to restart traffic on nport %d\n", p->portNum);
return retval;
}
return retval;
}
@@ -2907,6 +2961,7 @@ nvswitch_ctrl_set_routing_lan_valid_lr10
NvU32 ram_address = p->firstIndex;
NvU32 i;
NvU32 ram_size;
NvlStatus retval;
if (!NVSWITCH_IS_LINK_ENG_VALID_LR10(device, NPORT, p->portNum))
{
@@ -2929,6 +2984,15 @@ nvswitch_ctrl_set_routing_lan_valid_lr10
return -NVL_BAD_ARGS;
}
// Stop traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_TRUE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to stop traffic on nport %d\n", p->portNum);
return retval;
}
// Select RLAN RAM and disable Auto Increament.
rlan_ctrl =
DRF_DEF(_INGRESS, _REQRSPMAPADDR, _RAM_SEL, _SELECTSRLANROUTERAM) |
@@ -2959,6 +3023,15 @@ nvswitch_ctrl_set_routing_lan_valid_lr10
NVSWITCH_LINK_WR32_LR10(device, p->portNum, NPORT, _INGRESS, _RLANTABDATA0, rlan_tab_data[0]);
}
// Allow traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_FALSE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to restart traffic on nport %d\n", p->portNum);
return retval;
}
return NVL_SUCCESS;
}
@@ -4075,9 +4148,7 @@ nvswitch_ctrl_get_nvlink_status_lr10
}
else
{
nvlink_lib_discover_and_get_remote_conn_info(link, &conn_info,
NVLINK_STATE_CHANGE_SYNC,
NV_FALSE);
nvlink_lib_discover_and_get_remote_conn_info(link, &conn_info, NVLINK_STATE_CHANGE_SYNC);
}
// Set NVLINK per-link caps

View File

@@ -2552,6 +2552,18 @@ _soeWaitForInitAck_LR10
return NV_OK;
}
NvlStatus
nvswitch_soe_issue_ingress_stop_lr10
(
nvswitch_device *device,
NvU32 nport,
NvBool bStop
)
{
// Not supported on LR10
return NVL_SUCCESS;
}
/*!
* @brief set hal function pointers for functions defined in LR10 (i.e. this file)
*

View File

@@ -1354,7 +1354,6 @@ nvswitch_process_discovery_ls10
NVSWITCH_PRINT(device, SETUP,
"%s: Disable link #%d\n",
__FUNCTION__, i);
nvswitch_link_disable_interrupts_ls10(device, i);
device->link[i].valid = NV_FALSE;
chip_device->engNPORT[i].valid = NV_FALSE;
chip_device->engNPORT_PERFMON[i].valid = NV_FALSE;

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -585,16 +585,13 @@ nvswitch_fsprpc_get_caps_ls10
TNVL_RPC_CAPS_PAYLOAD payload;
TNVL_RPC_CAPS_RSP_PAYLOAD responsePayload;
NvlStatus status;
NVSWITCH_TIMEOUT timeout;
payload.subMessageId = TNVL_CAPS_SUBMESSAGE_ID;
nvswitch_os_memset(&responsePayload, 0, sizeof(TNVL_RPC_CAPS_RSP_PAYLOAD));
nvswitch_timeout_create(5 * NVSWITCH_INTERVAL_1SEC_IN_NS, &timeout);
status = nvswitch_fsp_send_and_read_message(device,
(NvU8*) &payload, sizeof(TNVL_RPC_CAPS_PAYLOAD), NVDM_TYPE_CAPS_QUERY,
(NvU8*) &responsePayload, sizeof(TNVL_RPC_CAPS_RSP_PAYLOAD), &timeout);
(NvU8*) &responsePayload, sizeof(TNVL_RPC_CAPS_RSP_PAYLOAD));
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR, "RPC failed for FSP caps query\n");

View File

@@ -135,6 +135,7 @@ _nvswitch_initialize_nvlipt_interrupts_ls10
{
NvU32 i;
NvU32 regval = 0;
NvU64 link_enable_mask;
//
// NVLipt interrupt routing (NVLIPT_COMMON, NVLIPT_LNK, NVLDL, NVLTLC)
@@ -234,6 +235,24 @@ _nvswitch_initialize_nvlipt_interrupts_ls10
regval = DRF_DEF(_CPR_SYS, _NVLW_INTR_2_MASK, _CPR_INTR, _DISABLE) |
DRF_DEF(_CPR_SYS, _NVLW_INTR_2_MASK, _INTR2, _ENABLE);
NVSWITCH_ENG_WR32(device, CPR, _BCAST, 0, _CPR_SYS, _NVLW_INTR_2_MASK, regval);
//
// Disable engine interrupts requested by regkey "LinkEnableMask".
// All the links are enabled by default.
//
link_enable_mask = ((NvU64)device->regkeys.link_enable_mask2 << 32 |
(NvU64)device->regkeys.link_enable_mask);
for (i = 0; i < NVSWITCH_NUM_LINKS_LS10; i++)
{
if ((NVBIT64(i) & link_enable_mask) == 0)
{
NVSWITCH_PRINT(device, SETUP,
"%s: Disabling interrupts for link #%d\n",
__FUNCTION__, i);
nvswitch_link_disable_interrupts_ls10(device, i);
}
}
}
static void
@@ -5860,8 +5879,6 @@ _nvswitch_deferred_link_state_check_ls10
// 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;
@@ -5922,18 +5939,17 @@ nvswitch_create_deferred_link_state_check_task_ls10
}
status = NVL_ERR_GENERIC;
pErrorReportParams = nvswitch_os_malloc(sizeof(NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS));
if(pErrorReportParams != NULL)
{
pErrorReportParams->nvlipt_instance = nvlipt_instance;
pErrorReportParams->link = link;
pErrorReportParams = &chip_device->deferredLinkErrorsArgs[link];
nvswitch_os_memset(pErrorReportParams, 0, sizeof(NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS));
pErrorReportParams->nvlipt_instance = nvlipt_instance;
pErrorReportParams->link = link;
status = nvswitch_task_create_args(device, (void*)pErrorReportParams,
&_nvswitch_deferred_link_state_check_ls10,
NVSWITCH_DEFERRED_LINK_STATE_CHECK_INTERVAL_NS,
NVSWITCH_TASK_TYPE_FLAGS_RUN_ONCE |
NVSWITCH_TASK_TYPE_FLAGS_VOID_PTR_ARGS);
}
status = nvswitch_task_create_args(device, (void*)pErrorReportParams,
&_nvswitch_deferred_link_state_check_ls10,
NVSWITCH_DEFERRED_LINK_STATE_CHECK_INTERVAL_NS,
NVSWITCH_TASK_TYPE_FLAGS_RUN_ONCE |
NVSWITCH_TASK_TYPE_FLAGS_VOID_PTR_ARGS);
if (status == NVL_SUCCESS)
{
@@ -5946,7 +5962,6 @@ nvswitch_create_deferred_link_state_check_task_ls10
__FUNCTION__);
_nvswitch_emit_deferred_link_errors_ls10(device, nvlipt_instance, link);
_nvswitch_clear_deferred_link_errors_ls10(device, link);
nvswitch_os_free(pErrorReportParams);
}
}
@@ -5964,9 +5979,6 @@ _nvswitch_deferred_link_errors_check_ls10
ls10_device *chip_device;
NvU32 pending;
nvswitch_os_free(pErrorReportParams);
pErrorReportParams = NULL;
chip_device = NVSWITCH_GET_CHIP_DEVICE_LS10(device);
chip_device->deferredLinkErrors[link].state.bLinkErrorsCallBackEnabled = NV_FALSE;
@@ -6007,18 +6019,18 @@ _nvswitch_create_deferred_link_errors_task_ls10
}
status = NVL_ERR_GENERIC;
pErrorReportParams = nvswitch_os_malloc(sizeof(NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS));
if(pErrorReportParams != NULL)
{
pErrorReportParams->nvlipt_instance = nvlipt_instance;
pErrorReportParams->link = link;
pErrorReportParams = &chip_device->deferredLinkErrorsArgs[link];
nvswitch_os_memset(pErrorReportParams, 0, sizeof(NVSWITCH_DEFERRED_ERROR_REPORTING_ARGS));
pErrorReportParams->nvlipt_instance = nvlipt_instance;
pErrorReportParams->link = link;
status = nvswitch_task_create_args(device, (void*)pErrorReportParams,
&_nvswitch_deferred_link_errors_check_ls10,
NVSWITCH_DEFERRED_FAULT_UP_CHECK_INTERVAL_NS,
NVSWITCH_TASK_TYPE_FLAGS_RUN_ONCE |
NVSWITCH_TASK_TYPE_FLAGS_VOID_PTR_ARGS);
}
status = nvswitch_task_create_args(device, (void*)pErrorReportParams,
&_nvswitch_deferred_link_errors_check_ls10,
NVSWITCH_DEFERRED_FAULT_UP_CHECK_INTERVAL_NS,
NVSWITCH_TASK_TYPE_FLAGS_RUN_ONCE |
NVSWITCH_TASK_TYPE_FLAGS_VOID_PTR_ARGS);
if (status == NVL_SUCCESS)
{
@@ -6031,7 +6043,6 @@ _nvswitch_create_deferred_link_errors_task_ls10
__FUNCTION__);
_nvswitch_emit_deferred_link_errors_ls10(device, nvlipt_instance, link);
_nvswitch_clear_deferred_link_errors_ls10(device, link);
nvswitch_os_free(pErrorReportParams);
}
}
@@ -6728,9 +6739,6 @@ _nvswitch_service_nvlipt_lnk_status_ls10
//
_nvswitch_clear_deferred_link_errors_ls10(device, link_id);
chip_device->deferredLinkErrors[link_id].state.lastLinkUpTime = nvswitch_os_get_platform_time();
// Reset NV_NPORT_SCRATCH_WARM_PORT_RESET_REQUIRED to 0x0
NVSWITCH_LINK_WR32(device, link_id, NPORT, _NPORT, _SCRATCH_WARM, 0);
}
else if (mode == NVLINK_LINKSTATE_FAULT)
{

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -148,9 +148,9 @@ nvswitch_init_lpwr_regs_ls10
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR, "%s: Failed to set L1 Threshold\n",
__FUNCTION__);
__FUNCTION__);
}
}
}
void
nvswitch_corelib_training_complete_ls10
@@ -708,8 +708,16 @@ nvswitch_init_buffer_ready_ls10
FLD_TEST_DRF(_SWITCH_REGKEY, _SKIP_BUFFER_READY, _NPORT, _NO,
device->regkeys.skip_buffer_ready))
{
val = DRF_NUM(_NPORT, _CTRL_BUFFER_READY, _BUFFERRDY, 0x1);
NVSWITCH_LINK_WR32_LS10(device, linkNum, NPORT, _NPORT, _CTRL_BUFFER_READY, val);
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
}
else
{
val = DRF_NUM(_NPORT, _CTRL_BUFFER_READY, _BUFFERRDY, 0x1);
NVSWITCH_LINK_WR32_LS10(device, linkNum, NPORT, _NPORT, _CTRL_BUFFER_READY, val);
}
}
}
@@ -1438,7 +1446,7 @@ nvswitch_load_link_disable_settings_ls10
nvswitch_device *device,
nvlink_link *link
)
{
{
NvU32 regVal;
// Read state from NVLIPT HW
@@ -1447,8 +1455,15 @@ nvswitch_load_link_disable_settings_ls10
if (FLD_TEST_DRF(_NVLIPT_LNK, _CTRL_LINK_STATE_STATUS, _CURRENTLINKSTATE, _DISABLE, regVal))
{
NVSWITCH_ASSERT(!cciIsLinkManaged(device, link->linkNumber));
if(cciIsLinkManaged(device, link->linkNumber))
{
NVSWITCH_PRINT(device, ERROR,
"%s: link #%d is cci managed and should not be disabled.\n",
__FUNCTION__, link->linkNumber);
return;
}
// Set link to invalid and unregister from corelib
device->link[link->linkNumber].valid = NV_FALSE;
nvlink_lib_unregister_link(link);
@@ -1594,7 +1609,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,
@@ -1785,8 +1800,8 @@ nvswitch_request_tl_link_state_ls10
{
keepPolling = (nvswitch_timeout_check(&timeout)) ? NV_FALSE : NV_TRUE;
// Check for state requested
linkStatus = NVSWITCH_LINK_RD32_LS10(device, link->linkNumber,
// Check for state requested
linkStatus = NVSWITCH_LINK_RD32_LS10(device, link->linkNumber,
NVLIPT_LNK , _NVLIPT_LNK , _CTRL_LINK_STATE_STATUS);
if (DRF_VAL(_NVLIPT_LNK, _CTRL_LINK_STATE_STATUS, _CURRENTLINKSTATE, linkStatus) ==
@@ -1807,18 +1822,17 @@ nvswitch_request_tl_link_state_ls10
linkStatus = NVSWITCH_LINK_RD32_LS10(device, link->linkNumber,
NVLIPT_LNK , _NVLIPT_LNK , _CTRL_LINK_STATE_STATUS);
if (DRF_VAL(_NVLIPT_LNK, _CTRL_LINK_STATE_STATUS, _CURRENTLINKSTATE, linkStatus) !=
tlLinkState)
{
NVSWITCH_PRINT(device, ERROR,
"%s: TL link state request to state 0x%x for link #%d did not complete!\n",
__FUNCTION__, tlLinkState, link->linkNumber);
return -NVL_ERR_GENERIC;
if (DRF_VAL(_NVLIPT_LNK, _CTRL_LINK_STATE_STATUS, _CURRENTLINKSTATE, linkStatus) !=
tlLinkState)
{
NVSWITCH_PRINT(device, ERROR,
"%s: TL link state request to state 0x%x for link #%d did not complete!\n",
__FUNCTION__, tlLinkState, link->linkNumber);
return -NVL_ERR_GENERIC;
}
}
}
}
return status;
}

View File

@@ -1232,6 +1232,13 @@ nvswitch_internal_latency_bin_log_ls10
return;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return;
}
time_nsec = nvswitch_os_get_platform_time();
last_visited_time_nsec = chip_device->latency_stats->last_visited_time_nsec;
@@ -1568,7 +1575,6 @@ _nvswitch_reset_and_drain_links_ls10
//
// Step 4.0 : Send command to SOE to perform the following steps :
// - Backup NPORT state before reset
// - Set the INGRESS_STOP bit of CTRL_STOP (0x48)
// - Assert debug_clear for the given port NPORT by writing to the
// DEBUG_CLEAR (0x144) register
// - Assert NPortWarmReset[i] using the WARMRESET (0x140) register
@@ -1641,7 +1647,6 @@ _nvswitch_reset_and_drain_links_ls10
//
// Step 6.0 : Send command to SOE to perform the following steps :
// - Clear the INGRESS_STOP bit of CTRL_STOP (0x48)
// - Clear the CONTAIN_AND_DRAIN (0x5c) status
// - Assert NPORT INITIALIZATION and program the state tracking RAMS
// - Restore NPORT state after reset
@@ -1664,8 +1669,8 @@ _nvswitch_reset_and_drain_links_ls10
continue;
}
// Reset NV_NPORT_SCRATCH_WARM_PORT_RESET_REQUIRED to 0x0
NVSWITCH_LINK_WR32(device, link, NPORT, _NPORT, _SCRATCH_WARM, 0);
// Initialize select scratch registers to 0x0
device->hal.nvswitch_init_scratch(device);
//
// Step 9.0: Launch ALI training to re-initialize and train the links
@@ -3357,6 +3362,13 @@ _nvswitch_set_remap_policy_ls10
NvU32 address_limit;
NvU32 rfunc;
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return;
}
NVSWITCH_LINK_WR32_LS10(device, portNum, NPORT, _INGRESS, _REQRSPMAPADDR,
DRF_NUM(_INGRESS, _REQRSPMAPADDR, _RAM_ADDRESS, firstIndex) |
DRF_NUM(_INGRESS, _REQRSPMAPADDR, _RAM_SEL, remap_ram_sel) |
@@ -3431,6 +3443,13 @@ _nvswitch_set_mc_remap_policy_ls10
NvU32 rfunc;
NvU32 reflective;
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return;
}
NVSWITCH_LINK_WR32_LS10(device, portNum, NPORT, _INGRESS, _MCREMAPTABADDR,
DRF_NUM(_INGRESS, _MCREMAPTABADDR, _RAM_ADDRESS, firstIndex) |
DRF_DEF(_INGRESS, _MCREMAPTABADDR, _AUTO_INCR, _ENABLE));
@@ -3702,13 +3721,38 @@ nvswitch_ctrl_set_remap_policy_ls10
}
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
if (p->tableSelect == NVSWITCH_TABLE_SELECT_REMAP_MULTICAST)
{
_nvswitch_set_mc_remap_policy_ls10(device, p->portNum, p->firstIndex, p->numEntries, p->remapPolicy);
}
else
{
// Stop traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_TRUE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to stop traffic on nport %d\n", p->portNum);
return retval;
}
_nvswitch_set_remap_policy_ls10(device, p->portNum, remap_ram_sel, p->firstIndex, p->numEntries, p->remapPolicy);
// Allow traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_FALSE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to restart traffic on nport %d\n", p->portNum);
return retval;
}
}
return retval;
@@ -3764,6 +3808,13 @@ nvswitch_ctrl_get_remap_policy_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
nvswitch_os_memset(params->entry, 0, (NVSWITCH_REMAP_POLICY_ENTRIES_MAX *
sizeof(NVSWITCH_REMAP_POLICY_ENTRY)));
@@ -3938,6 +3989,22 @@ nvswitch_ctrl_set_remap_policy_valid_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
// Stop traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_TRUE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to stop traffic on nport %d\n", p->portNum);
return retval;
}
if (p->tableSelect == NVSWITCH_TABLE_SELECT_REMAP_MULTICAST)
{
for (i = 0; i < p->numEntries; i++)
@@ -3996,6 +4063,15 @@ nvswitch_ctrl_set_remap_policy_valid_ls10
}
}
// Allow traffic on the port
retval = nvswitch_soe_issue_ingress_stop(device, p->portNum, NV_FALSE);
if (retval != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
"Failed to restart traffic on nport %d\n", p->portNum);
return retval;
}
return NVL_SUCCESS;
}
@@ -4113,6 +4189,13 @@ NvlStatus nvswitch_ctrl_get_mc_rid_table_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
nvswitch_os_memset(&table_entry, 0, sizeof(NVSWITCH_MC_RID_ENTRY_LS10));
table_entry.index = (NvU8)p->index;
@@ -4863,6 +4946,13 @@ nvswitch_ctrl_get_residency_bins_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
if (p->table_select == NVSWITCH_TABLE_SELECT_MULTICAST)
{
// Snap the histogram
@@ -4978,6 +5068,13 @@ nvswitch_ctrl_get_rb_stall_busy_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
if (p->table_select == NVSWITCH_TABLE_SELECT_MULTICAST)
{
// Snap the histogram
@@ -6189,7 +6286,7 @@ _nvswitch_set_led_state_ls10
regVal = FLD_SET_REF_NUM(CPLD_MACHXO3_ACCESS_LINK_LED_CTL_NVL_CABLE_LED,
_nvswitch_get_led_state_regval_ls10(device, ledState),
regVal);
// Set state for LED
retval = nvswitch_cci_ports_cpld_write(device, CPLD_MACHXO3_ACCESS_LINK_LED_CTL, regVal);
if (retval != NVL_SUCCESS)

View File

@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2020-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2020-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -208,6 +208,13 @@ nvswitch_minion_send_command_ls10
NVSWITCH_GET_LINK_ENG_INST(device, linkNumber, MINION), _MINION, _MISC_0, data);
break;
case NV_MINION_NVLINK_DL_CMD_COMMAND_INITPHASE1:
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
//
// WAR bug 2708497
// Before INITPHASE1, we must clear these values, then set back to
@@ -285,8 +292,7 @@ nvswitch_minion_send_command_ls10
data = FLD_SET_DRF_NUM(_MINION, _NVLINK_DL_CMD, _FAULT, 1, 0x0);
NVSWITCH_MINION_LINK_WR32_LS10(device, linkNumber, _MINION, _NVLINK_DL_CMD(localLinkNumber), data);
return (DRF_VAL(_NVLSTAT, _MN00, _LINK_INTR_SUBCODE, statData) == MINION_ALARM_BUSY) ?
-NVL_ERR_STATE_IN_USE : -NVL_ERR_INVALID_STATE;
return -NVL_ERR_INVALID_STATE;
}
else
{

View File

@@ -1510,6 +1510,13 @@ nvswitch_mc_invalidate_mc_rid_entry_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
if (use_extended_table)
reg = FLD_SET_DRF(_ROUTE, _RIDTABADDR, _RAM_SEL, _SELECTSEXTMCRIDROUTERAM, 0);
else
@@ -1608,6 +1615,13 @@ nvswitch_mc_program_mc_rid_entry_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
if (table_entry->use_extended_table)
reg = FLD_SET_DRF(_ROUTE, _RIDTABADDR, _RAM_SEL, _SELECTSEXTMCRIDROUTERAM, 0);
else
@@ -1749,6 +1763,13 @@ nvswitch_mc_read_mc_rid_entry_ls10
return -NVL_BAD_ARGS;
}
if (nvswitch_is_tnvl_mode_locked(device))
{
NVSWITCH_PRINT(device, ERROR,
"%s(%d): Security locked\n", __FUNCTION__, __LINE__);
return -NVL_ERR_INSUFFICIENT_PERMISSIONS;
}
// set the address
if (table_entry->use_extended_table)
reg = FLD_SET_DRF(_ROUTE, _RIDTABADDR, _RAM_SEL, _SELECTSEXTMCRIDROUTERAM, 0);

View File

@@ -23,6 +23,7 @@
#include "common_nvswitch.h"
#include "boards_nvswitch.h"
#include "regkey_nvswitch.h"
#include "ls10/ls10.h"
#include "ls10/pmgr_ls10.h"
@@ -32,7 +33,6 @@
#include "export_nvswitch.h"
#include "soe/soe_nvswitch.h"
#include "soe/soeifcore.h"
#include "boards_nvswitch.h"
#include "nvswitch/ls10/dev_pmgr.h"
@@ -375,3 +375,34 @@ nvswitch_i2c_is_device_access_allowed_ls10
// Check will be performed in SOE
return NV_TRUE;
}
/*!
* @brief Return I2c port info used in PMGR implementation.
*/
NvU32
nvswitch_i2c_get_port_info_ls10
(
nvswitch_device *device,
NvU32 port
)
{
NvU16 boardId;
NvlStatus status;
status = nvswitch_get_board_id(device, &boardId);
if (status != NVL_SUCCESS)
{
return 0;
}
//
// Board has no devices we care about on I2C port C
// Bug 4312082
//
if ((boardId == NVSWITCH_BOARD_LS10_4262_0000_895) &&
(port == NVSWITCH_I2C_PORT_I2CC))
{
return 0;
}
return nvswitch_i2c_get_port_info_lr10(device, port);
}

View File

@@ -38,6 +38,7 @@
#include "nvswitch/ls10/dev_nvlsaw_ip.h"
#include "nvswitch/ls10/dev_nvlsaw_ip_addendum.h"
#include "nvswitch/ls10/dev_riscv_pri.h"
#include "nvswitch/ls10/dev_nport_ip.h"
#include "flcn/flcnable_nvswitch.h"
#include "flcn/flcn_nvswitch.h"
@@ -517,22 +518,23 @@ nvswitch_soe_disable_nport_fatal_interrupts_ls10
if ((status != NVL_SUCCESS) || ((p.version & SOE_VBIOS_VERSION_MASK) <
SOE_VBIOS_REVLOCK_DISABLE_NPORT_FATAL_INTR))
{
NVSWITCH_PRINT(device, ERROR,
NVSWITCH_PRINT(device, INFO,
"%s: Skipping DISABLE_NPORT_FATAL_INTR command to SOE. Update firmware "
"from .%02X to .%02X\n",
__FUNCTION__, (NvU32)((p.version & SOE_VBIOS_VERSION_MASK) >> 16),
SOE_VBIOS_REVLOCK_DISABLE_NPORT_FATAL_INTR);
SOE_VBIOS_REVLOCK_DISABLE_NPORT_FATAL_INTR);
return;
}
if (!nvswitch_is_soe_supported(device))
{
NVSWITCH_PRINT(device, INFO, "%s: SOE is not supported\n",
__FUNCTION__);
NVSWITCH_PRINT(device, INFO,
"%s: SOE is not supported\n",
__FUNCTION__);
return;
}
pFlcn = device->pSoe->pFlcn;
pFlcn = device->pSoe->pFlcn;
nvswitch_os_memset(&cmd, 0, sizeof(cmd));
cmd.hdr.unitId = RM_SOE_UNIT_CORE;
@@ -554,11 +556,116 @@ nvswitch_soe_disable_nport_fatal_interrupts_ls10
&timeout);
if (status != NV_OK)
{
NVSWITCH_PRINT(device, ERROR, "%s: Failed to send DISABLE_NPORT_FATAL_INTR command to SOE, status 0x%x\n",
__FUNCTION__, status);
NVSWITCH_PRINT(device, ERROR,
"%s: Failed to send DISABLE_NPORT_FATAL_INTR command to SOE, status 0x%x\n",
__FUNCTION__, status);
}
}
/*
* @Brief : Issue INGRESS STOP in SOE
*
* @param[in] device
* @param[in] nport
* @param[in] bStop
*/
NvlStatus
nvswitch_soe_issue_ingress_stop_ls10
(
nvswitch_device *device,
NvU32 nport,
NvBool bStop
)
{
FLCN *pFlcn;
NvU32 cmdSeqDesc = 0;
NV_STATUS status;
RM_FLCN_CMD_SOE cmd;
NVSWITCH_TIMEOUT timeout;
RM_SOE_CORE_CMD_INGRESS_STOP *pIngressStop;
NVSWITCH_GET_BIOS_INFO_PARAMS params = { 0 };
NvBool bKeepPolling;
NvU32 val;
if (!nvswitch_is_soe_supported(device))
{
NVSWITCH_PRINT(device, INFO,
"%s: SOE is not supported\n",
__FUNCTION__);
return NVL_SUCCESS; // -NVL_ERR_NOT_SUPPORTED
}
status = device->hal.nvswitch_ctrl_get_bios_info(device, &params);
if ((status != NVL_SUCCESS) || ((params.version & SOE_VBIOS_VERSION_MASK) <
SOE_VBIOS_REVLOCK_ISSUE_INGRESS_STOP))
{
return NVL_SUCCESS; // -NVL_ERR_NOT_SUPPORTED
}
pFlcn = device->pSoe->pFlcn;
nvswitch_os_memset(&cmd, 0, sizeof(cmd));
cmd.hdr.unitId = RM_SOE_UNIT_CORE;
cmd.hdr.size = RM_SOE_CMD_SIZE(CORE, INGRESS_STOP);
pIngressStop = &cmd.cmd.core.ingressStop;
pIngressStop->nport = nport;
pIngressStop->cmdType = RM_SOE_CORE_CMD_ISSUE_INGRESS_STOP;
pIngressStop->bStop = bStop;
nvswitch_timeout_create(NVSWITCH_INTERVAL_5MSEC_IN_NS, &timeout);
status = flcnQueueCmdPostBlocking(device, pFlcn,
(PRM_FLCN_CMD)&cmd,
NULL, // pMsg
NULL, // pPayload
SOE_RM_CMDQ_LOG_ID,
&cmdSeqDesc,
&timeout);
if (status != NV_OK)
{
NVSWITCH_PRINT(device, ERROR,
"%s: Failed to send INGRESS STOP command to SOE status 0x%x\n",
__FUNCTION__, status);
return -NVL_ERR_GENERIC;
}
//
// After asserting INGRESS_STOP, wait until nport is idle
// to indicate that traffic is drained out.
//
if (bStop)
{
nvswitch_timeout_create(NVSWITCH_INTERVAL_1MSEC_IN_NS, &timeout);
do
{
bKeepPolling = (nvswitch_timeout_check(&timeout)) ? NV_FALSE : NV_TRUE;
val = NVSWITCH_NPORT_RD32_LS10(device, nport, _NPORT, _STATUS);
if (FLD_TEST_DRF(_NPORT, _STATUS, _INGRESS_IDLE, _IDLE, val) &&
FLD_TEST_DRF(_NPORT, _STATUS, _ROUTE_IDLE, _IDLE, val))
{
break;
}
NVSWITCH_NSEC_DELAY(2 * NVSWITCH_INTERVAL_1USEC_IN_NS);
} while (bKeepPolling);
if (!FLD_TEST_DRF(_NPORT, _STATUS, _INGRESS_IDLE, _IDLE, val) ||
!FLD_TEST_DRF(_NPORT, _STATUS, _ROUTE_IDLE, _IDLE, val))
{
NVSWITCH_PRINT(device, ERROR,
"%s: Traffic failed to drain after ingress stop is asserted, val = 0x%x\n",
__FUNCTION__, val);
return -NVL_ERR_GENERIC;
}
}
return NVL_SUCCESS;
}
/*
* @Brief : Init sequence for SOE FSP RISCV image
*

View File

@@ -639,7 +639,6 @@ _nvswitch_tnvl_get_cert_chain_from_fsp_ls10
NvlStatus status;
TNVL_GET_ATT_CERTS_CMD_PAYLOAD *pCmdPayload = nvswitch_os_malloc(sizeof(TNVL_GET_ATT_CERTS_CMD_PAYLOAD));
TNVL_GET_ATT_CERTS_RSP_PAYLOAD *pRspPayload = nvswitch_os_malloc(sizeof(TNVL_GET_ATT_CERTS_RSP_PAYLOAD));
NVSWITCH_TIMEOUT timeout;
if (pCmdPayload == NULL || pRspPayload == NULL)
{
@@ -654,11 +653,9 @@ _nvswitch_tnvl_get_cert_chain_from_fsp_ls10
pCmdPayload->minorVersion = 0;
pCmdPayload->majorVersion = 1;
nvswitch_timeout_create(5 * NVSWITCH_INTERVAL_1SEC_IN_NS, &timeout);
status = nvswitch_fsp_send_and_read_message(device,
(NvU8*) pCmdPayload, sizeof(TNVL_GET_ATT_CERTS_CMD_PAYLOAD), NVDM_TYPE_TNVL,
(NvU8*) pRspPayload, sizeof(TNVL_GET_ATT_CERTS_RSP_PAYLOAD), &timeout);
(NvU8*) pRspPayload, sizeof(TNVL_GET_ATT_CERTS_RSP_PAYLOAD));
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
@@ -765,10 +762,6 @@ nvswitch_tnvl_get_attestation_certificate_chain_ls10
goto ErrorExit;
}
certChainLength = certChainLength -
NVSWITCH_IK_HASH_LENGTH -
NVSWITCH_ATT_CERT_SIZE_FIELD_LENGTH -
NVSWITCH_ATT_RSVD1_FIELD_LENGTH;
//
// pCertChainBufferEnd represents last valid byte for cert buffer.
//
@@ -872,7 +865,6 @@ nvswitch_tnvl_get_attestation_report_ls10
NvlStatus status;
TNVL_GET_ATT_REPORT_CMD_PAYLOAD *pCmdPayload;
TNVL_GET_ATT_REPORT_RSP_PAYLOAD *pRspPayload;
NVSWITCH_TIMEOUT timeout;
if (!nvswitch_is_tnvl_mode_enabled(device))
{
@@ -900,11 +892,9 @@ nvswitch_tnvl_get_attestation_report_ls10
pCmdPayload->majorVersion = 1;
nvswitch_os_memcpy(pCmdPayload->nonce, params->nonce, NVSWITCH_NONCE_SIZE);
nvswitch_timeout_create(10 * NVSWITCH_INTERVAL_1SEC_IN_NS, &timeout);
status = nvswitch_fsp_send_and_read_message(device,
(NvU8*) pCmdPayload, sizeof(TNVL_GET_ATT_REPORT_CMD_PAYLOAD), NVDM_TYPE_TNVL,
(NvU8*) pRspPayload, sizeof(TNVL_GET_ATT_REPORT_RSP_PAYLOAD), &timeout);
(NvU8*) pRspPayload, sizeof(TNVL_GET_ATT_REPORT_RSP_PAYLOAD));
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,
@@ -980,7 +970,6 @@ nvswitch_tnvl_send_fsp_lock_config_ls10
NvlStatus status;
TNVL_LOCK_CONFIG_CMD_PAYLOAD *pCmdPayload;
TNVL_LOCK_CONFIG_RSP_PAYLOAD *pRspPayload;
NVSWITCH_TIMEOUT timeout;
if (!nvswitch_is_tnvl_mode_enabled(device))
{
@@ -1006,11 +995,9 @@ nvswitch_tnvl_send_fsp_lock_config_ls10
pCmdPayload->minorVersion = 0;
pCmdPayload->majorVersion = 1;
nvswitch_timeout_create(5 * NVSWITCH_INTERVAL_1SEC_IN_NS, &timeout);
status = nvswitch_fsp_send_and_read_message(device,
(NvU8*) pCmdPayload, sizeof(TNVL_LOCK_CONFIG_CMD_PAYLOAD), NVDM_TYPE_TNVL,
(NvU8*) pRspPayload, sizeof(TNVL_LOCK_CONFIG_RSP_PAYLOAD), &timeout);
(NvU8*) pRspPayload, sizeof(TNVL_LOCK_CONFIG_RSP_PAYLOAD));
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR,

View File

@@ -291,7 +291,7 @@ _nvswitch_corelib_get_uphy_load
)
{
nvswitch_device *device = link->dev->pDevInfo;
return device->hal.nvswitch_corelib_get_uphy_load(link, bUnlocked);
device->hal.nvswitch_corelib_get_uphy_load(link, bUnlocked);
}
@@ -805,6 +805,17 @@ nvswitch_soe_init_l2_state
device->hal.nvswitch_soe_init_l2_state(device);
}
NvlStatus
nvswitch_soe_issue_ingress_stop
(
nvswitch_device *device,
NvU32 nport,
NvBool bStop
)
{
return device->hal.nvswitch_soe_issue_ingress_stop(device, nport, bStop);
}
void
nvswitch_fsp_update_cmdq_head_tail
(
@@ -813,7 +824,7 @@ nvswitch_fsp_update_cmdq_head_tail
NvU32 queueTail
)
{
return device->hal.nvswitch_fsp_update_cmdq_head_tail(device, queueHead, queueTail);
device->hal.nvswitch_fsp_update_cmdq_head_tail(device, queueHead, queueTail);
}
void
@@ -824,7 +835,7 @@ nvswitch_fsp_get_cmdq_head_tail
NvU32 *pQueueTail
)
{
return device->hal.nvswitch_fsp_get_cmdq_head_tail(device, pQueueHead, pQueueTail);
device->hal.nvswitch_fsp_get_cmdq_head_tail(device, pQueueHead, pQueueTail);
}
void
@@ -835,7 +846,7 @@ nvswitch_fsp_update_msgq_head_tail
NvU32 msgqTail
)
{
return device->hal.nvswitch_fsp_update_msgq_head_tail(device, msgqHead, msgqTail);
device->hal.nvswitch_fsp_update_msgq_head_tail(device, msgqHead, msgqTail);
}
void
@@ -846,7 +857,7 @@ nvswitch_fsp_get_msgq_head_tail
NvU32 *pMsgqTail
)
{
return device->hal.nvswitch_fsp_get_msgq_head_tail(device, pMsgqHead, pMsgqTail);
device->hal.nvswitch_fsp_get_msgq_head_tail(device, pMsgqHead, pMsgqTail);
}
NvU32
@@ -3417,7 +3428,7 @@ nvswitch_init_npg_multicast
nvswitch_device *device
)
{
return device->hal.nvswitch_init_npg_multicast(device);
device->hal.nvswitch_init_npg_multicast(device);
}
void
@@ -3426,7 +3437,7 @@ nvswitch_init_warm_reset
nvswitch_device *device
)
{
return device->hal.nvswitch_init_warm_reset(device);
device->hal.nvswitch_init_warm_reset(device);
}
static NvlStatus
@@ -4500,15 +4511,15 @@ nvswitch_filter_messages
if (nvswitch_is_message_persistent(device, msghdr))
{
if (nvListCount(&device->link[linkId].inbandData.persistent_list) <
device->hal.nvswitch_get_max_persistent_message_count(device))
{
nvListAdd(&msg->entry, &device->link[linkId].inbandData.persistent_list);
}
else
{
bSendNackOrDrop = NV_TRUE;
}
if (nvListCount(&device->link[linkId].inbandData.persistent_list) <
device->hal.nvswitch_get_max_persistent_message_count(device))
{
nvListAdd(&msg->entry, &device->link[linkId].inbandData.persistent_list);
}
else
{
bSendNackOrDrop = NV_TRUE;
}
}
else
{
@@ -4530,13 +4541,13 @@ nvswitch_filter_messages
}
else
{
status = nvswitch_lib_notify_client_events(device,
NVSWITCH_DEVICE_EVENT_INBAND_DATA);
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify INBAND_DATA event\n",
__FUNCTION__);
}
status = nvswitch_lib_notify_client_events(device,
NVSWITCH_DEVICE_EVENT_INBAND_DATA);
if (status != NVL_SUCCESS)
{
NVSWITCH_PRINT(device, ERROR, "%s: Failed to notify INBAND_DATA event\n",
__FUNCTION__);
}
}
device->link[linkId].inbandData.message = NULL;
@@ -5101,7 +5112,7 @@ nvswitch_init_clock_gating
nvswitch_device *device
)
{
return device->hal.nvswitch_init_clock_gating(device);
device->hal.nvswitch_init_clock_gating(device);
}
void
@@ -5494,7 +5505,7 @@ nvswitch_setup_link_loopback_mode
NvU32 linkNumber
)
{
return device->hal.nvswitch_setup_link_loopback_mode(device, linkNumber);
device->hal.nvswitch_setup_link_loopback_mode(device, linkNumber);
}
void
@@ -5504,7 +5515,7 @@ nvswitch_reset_persistent_link_hw_state
NvU32 linkNumber
)
{
return device->hal.nvswitch_reset_persistent_link_hw_state(device, linkNumber);
device->hal.nvswitch_reset_persistent_link_hw_state(device, linkNumber);
}
void
@@ -5514,7 +5525,7 @@ nvswitch_store_topology_information
nvlink_link *link
)
{
return device->hal.nvswitch_store_topology_information(device, link);
device->hal.nvswitch_store_topology_information(device, link);
}
void
@@ -5603,7 +5614,7 @@ nvswitch_init_buffer_ready
NvBool bNportBufferReady
)
{
return device->hal.nvswitch_init_buffer_ready(device, link, bNportBufferReady);
device->hal.nvswitch_init_buffer_ready(device, link, bNportBufferReady);
}
void
@@ -5613,7 +5624,7 @@ nvswitch_apply_recal_settings
nvlink_link *link
)
{
return device->hal.nvswitch_apply_recal_settings(device, link);
device->hal.nvswitch_apply_recal_settings(device, link);
}
NvlStatus