Skip to content

Commit

Permalink
feat: Log C2C init failure to BMC
Browse files Browse the repository at this point in the history
Log an error POST code to BMC for each C2C link training failure. Also
send the socket, controller number, and C2C status code as an OEM string
to BMC.

Signed-off-by: Dat Mach <dmach@nvidia.com>
Tested-by: Jake Garver <jake@nvidia.com>
Reviewed-by: Jake Garver <jake@nvidia.com>
  • Loading branch information
nvidia-dmach authored and jgarver committed Feb 11, 2025
1 parent 61583ad commit b2fe155
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
20 changes: 20 additions & 0 deletions Silicon/NVIDIA/Drivers/PcieControllerDxe/PcieControllerDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#include <Library/PcdLib.h>
#include <Library/PciHostBridgeLib.h>
#include <Library/PlatformResourceLib.h>
#include <Library/PrintLib.h>
#include <Library/TegraPlatformInfoLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/SortLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiBootServicesTableLib.h>
Expand All @@ -45,6 +47,9 @@
#include <TH500/TH500Definitions.h>
#include <TH500/TH500MB1Configuration.h>

#include <NVIDIAStatusCodes.h>
#include <OemStatusCodes.h>

#include "PcieControllerConfigGPU.h"
#include "PcieControllerPrivate.h"
#include <Protocol/PciPlatform.h>
Expand Down Expand Up @@ -534,6 +539,7 @@ InitializeController (
PCI_CAPABILITY_PCIEXP *PciExpCap = NULL;
UINT8 C2cStatus;
VOID *Hob;
CHAR8 OemDesc[sizeof (OEM_EC_DESC_C2C_INIT_FAILULE)];

TEGRABL_EARLY_BOOT_VARIABLES *Mb1Config = NULL;
UINTN ChipId;
Expand Down Expand Up @@ -638,6 +644,20 @@ InitializeController (
Private->C2cInitSuccessful = TRUE;
} else {
DEBUG ((DEBUG_ERROR, "%a: C2C link training failed with error code: 0x%x\r\n", __FUNCTION__, C2cStatus));
AsciiSPrint (
OemDesc,
sizeof (OemDesc),
OEM_EC_DESC_C2C_INIT_FAILULE,
Private->SocketId,
Private->CtrlId,
C2cStatus
);
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
EFI_ERROR_CODE | EFI_ERROR_MAJOR,
EFI_CLASS_NV_FIRMWARE | EFI_NV_FW_UEFI_EC_C2C_INIT_FAILED,
OemDesc,
AsciiStrSize (OemDesc)
);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# PCIe Controller Driver
#
# SPDX-FileCopyrightText: Copyright (c) 2019-2024 NVIDIA CORPORATION. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
Expand Down Expand Up @@ -50,6 +50,7 @@
DxeServicesTableLib
DevicePathLib
PlatformResourceLib
ReportStatusCodeLib

[Pcd]
gNVIDIATokenSpaceGuid.PcdBPMPPCIeControllerEnable
Expand Down
3 changes: 2 additions & 1 deletion Silicon/NVIDIA/Include/NVIDIAStatusCodes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file
*
* SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
Expand Down Expand Up @@ -178,6 +178,7 @@
#define EFI_NV_FW_UEFI_EC_TPM_PPI_EXECUTE (EFI_NV_FIRMWARE_UEFI | 0x00000015)
#define EFI_NV_FW_UEFI_EC_TPM_CLEAR_FAILED (EFI_NV_FIRMWARE_UEFI | 0x00000016)
#define EFI_NV_FW_UEFI_EC_SECURE_BOOT_FAILED (EFI_NV_FIRMWARE_UEFI | 0x00000017)
#define EFI_NV_FW_UEFI_EC_C2C_INIT_FAILED (EFI_NV_FIRMWARE_UEFI | 0x00000018)
///@}

///
Expand Down
5 changes: 4 additions & 1 deletion Silicon/NVIDIA/Include/Server/OemStatusCodes.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/** @file
*
* SPDX-FileCopyrightText: Copyright (c) 2023-2024 NVIDIA CORPORATION. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2023-2025 NVIDIA CORPORATION. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
Expand Down Expand Up @@ -101,6 +101,9 @@
#define OEM_EC_DESC_SECURE_BOOT_FAILURE \
"Secure boot failure "

#define OEM_EC_DESC_C2C_INIT_FAILULE \
"S%uC%u C2C init failed - 0x%02X"

///@}

#endif

0 comments on commit b2fe155

Please sign in to comment.