Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve ACPI boot issues on AGX Orin #117

Merged
merged 2 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Platform/NVIDIA/NVIDIA.common.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,10 @@ gEfiSecurityPkgTokenSpaceGuid.PcdSingleBootApplicationGuid|{ GUID("cbf481fb-b373
gNVIDIATokenSpaceGuid.PcdL4TConfigurationSupport|TRUE
!endif

!ifdef CONFIG_NVIDIA_DISPLAY
gNVIDIATokenSpaceGuid.PcdNvGopSupported|TRUE
!endif

# SBSA Watchdog - always override the ArmPkg.dec values
gArmTokenSpaceGuid.PcdGenericWatchdogControlBase|$(CONFIG_ARM_WATCHDOG_CONTROL_BASE)
gArmTokenSpaceGuid.PcdGenericWatchdogRefreshBase|$(CONFIG_ARM_WATCHDOG_REFRESH_BASE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ AcpiProtocolReady (

Status = gBS->LocateProtocol (&gEfiAcpiTableProtocolGuid, NULL, (VOID **)&AcpiTableProtocol);
if (EFI_ERROR (Status)) {
goto Cleanup;
return;
}

gBS->CloseEvent (Event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1083,9 +1083,13 @@ DisplayCheckPerformHandoff (
)
{
EFI_STATUS Status;
EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
VOID *Table;

Status = EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, &Table);
if (!EFI_ERROR (Status)) {
return TRUE;
}

switch (Context->HandoffMode) {
case NVIDIA_SOC_DISPLAY_HANDOFF_MODE_NEVER:
default:
Expand All @@ -1095,26 +1099,9 @@ DisplayCheckPerformHandoff (
return TRUE;

case NVIDIA_SOC_DISPLAY_HANDOFF_MODE_AUTO:
Status = EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, &Table);
if (!EFI_ERROR (Status)) {
/* ACPI boot: reset the display unless it is active. */
Status = LocateChildGop (
Context->DriverHandle,
Context->ControllerHandle,
&Gop
);
return !EFI_ERROR (Status) && CheckGopModeActive (Gop);
}

Status = EfiGetSystemConfigurationTable (&gFdtTableGuid, &Table);
if (!EFI_ERROR (Status)) {
/* DT boot: reset the display unless the last FDT update was
successful. */
return Context->FdtUpdated;
}

/* Default to display reset. */
return FALSE;
/* DT boot: reset the display unless the last FDT update was
successful. */
return Context->FdtUpdated;
}
}

Expand Down
17 changes: 11 additions & 6 deletions Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,10 @@ InitializeSettings (
VOID *HobPointer;
BOOLEAN DiscardVariableOverrides;
CHAR16 ProductInfoVariableName[] = L"ProductInfo";
BOOLEAN AcpiMode;
VOID *Table;

AcpiMode = !EFI_ERROR (EfiGetSystemConfigurationTable (&gEfiAcpiTableGuid, &Table));

// Initialize PCIe Form Settings
PcdSet8S (PcdPcieResourceConfigNeeded, PcdGet8 (PcdPcieResourceConfigNeeded));
Expand Down Expand Up @@ -1876,12 +1880,13 @@ InitializeSettings (
mOpRomDisMask = 0;
}

mHiiControlSettings.L4TSupported = PcdGetBool (PcdL4TConfigurationSupport);
mHiiControlSettings.QuickBootSupported = FeaturePcdGet (PcdQuickBootSupported);
mHiiControlSettings.DebugMenuSupported = FeaturePcdGet (PcdDebugMenuSupport);
mHiiControlSettings.RedfishSupported = FeaturePcdGet (PcdRedfishSupported);
mHiiControlSettings.TpmPresent = PcdGetBool (PcdTpmPresent);
mHiiControlSettings.MemoryTestsSupported = PcdGetBool (PcdMemoryTestsSupported);
mHiiControlSettings.L4TSupported = PcdGetBool (PcdL4TConfigurationSupport);
mHiiControlSettings.QuickBootSupported = FeaturePcdGet (PcdQuickBootSupported);
mHiiControlSettings.DebugMenuSupported = FeaturePcdGet (PcdDebugMenuSupport);
mHiiControlSettings.RedfishSupported = FeaturePcdGet (PcdRedfishSupported);
mHiiControlSettings.TpmPresent = PcdGetBool (PcdTpmPresent);
mHiiControlSettings.MemoryTestsSupported = PcdGetBool (PcdMemoryTestsSupported);
mHiiControlSettings.NvDisplayHandoffControlSupported = PcdGetBool (PcdNvGopSupported) && !AcpiMode;

HobPointer = GetFirstGuidHob (&gNVIDIATH500MB1DataGuid);
if (HobPointer != NULL) {
Expand Down
1 change: 1 addition & 0 deletions Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigDxe.inf
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
gNVIDIATokenSpaceGuid.PcdBoardRecoveryBoot
gNVIDIATokenSpaceGuid.PcdSocDisplayHandoffMode
gNVIDIATokenSpaceGuid.PcdServerPowerControlSetting
gNVIDIATokenSpaceGuid.PcdNvGopSupported

[Depex]
gEfiVariableArchProtocolGuid AND
Expand Down
1 change: 1 addition & 0 deletions Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.h
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ typedef struct {
BOOLEAN AdvertiseACS_1[MAX_PCIE];
BOOLEAN AdvertiseACS_2[MAX_PCIE];
BOOLEAN AdvertiseACS_3[MAX_PCIE];
BOOLEAN NvDisplayHandoffControlSupported;
} NVIDIA_CONFIG_HII_CONTROL;

#define ADD_GOTO_SOCKET_FORM(socket) \
Expand Down
2 changes: 2 additions & 0 deletions Silicon/NVIDIA/Drivers/NvidiaConfigDxe/NvidiaConfigHii.vfr
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ formset
endcheckbox;
endif;

suppressif ideqval NVIDIA_CONFIG_HII_CONTROL.NvDisplayHandoffControlSupported == 0;
oneof varid = SocDisplayHandoffMode.Mode,
questionid = KEY_SOC_DISPLAY_HANDOFF_MODE,
prompt = STRING_TOKEN(STR_SOC_DISPLAY_HANDOFF_MODE_PROMPT),
Expand All @@ -372,6 +373,7 @@ formset
option text = STRING_TOKEN(STR_ALWAYS), value = NVIDIA_SOC_DISPLAY_HANDOFF_MODE_ALWAYS, flags = 0;
option text = STRING_TOKEN(STR_AUTO), value = NVIDIA_SOC_DISPLAY_HANDOFF_MODE_AUTO, flags = 0;
endoneof;
endif;
endform;

//
Expand Down
3 changes: 3 additions & 0 deletions Silicon/NVIDIA/NVIDIA.dec
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,9 @@
## The maximum number of boot options supported.
gNVIDIATokenSpaceGuid.PcdMaximumBootOptions|0xFF|UINT16|0x0000012D

## Use to determine if the internal nvidia GOP driver is supported.
gNVIDIATokenSpaceGuid.PcdNvGopSupported|FALSE|BOOLEAN|0x00000132

[PcdsFeatureFlag]
#OPTEE presence
gNVIDIATokenSpaceGuid.PcdOpteePresent|FALSE|BOOLEAN|0x00000067
Expand Down