diff options
author | Sebastien Boeuf <sebastien.boeuf@intel.com> | 2021-12-10 22:41:54 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-12-11 14:26:05 +0000 |
commit | 9afcd48a94e85586bc8ea61f2fba21476e716ca1 (patch) | |
tree | 69515dad78f5ed295dd150269e941f2b91239fb0 /OvmfPkg/Library/ResetSystemLib | |
parent | e81a81e5846edcc4c2e91cf3a39d0ba8c31b687a (diff) | |
download | edk2-9afcd48a94e85586bc8ea61f2fba21476e716ca1.tar.gz edk2-9afcd48a94e85586bc8ea61f2fba21476e716ca1.tar.bz2 edk2-9afcd48a94e85586bc8ea61f2fba21476e716ca1.zip |
OvmfPkg: Handle Cloud Hypervisor host bridge
Handle things differently when the detected host bridge matches the
Cloud Hypervisor PCI host bridge identifier.
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Rob Bradford <robert.bradford@intel.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Diffstat (limited to 'OvmfPkg/Library/ResetSystemLib')
-rw-r--r-- | OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c | 3 | ||||
-rw-r--r-- | OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c b/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c index 29abd57fa7..c21d3c89cf 100644 --- a/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c +++ b/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c @@ -40,6 +40,9 @@ ResetShutdown ( case INTEL_Q35_MCH_DEVICE_ID:
AcpiPmBaseAddress = ICH9_PMBASE_VALUE;
break;
+ case CLOUDHV_DEVICE_ID:
+ IoWrite8 (CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS, 5 << 2 | 1 << 5);
+ CpuDeadLoop ();
default:
ASSERT (FALSE);
CpuDeadLoop ();
diff --git a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c b/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c index a0db8b50bf..31f01b82e4 100644 --- a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c +++ b/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c @@ -16,6 +16,7 @@ #include <OvmfPlatforms.h> // PIIX4_PMBA_VALUE
STATIC UINT16 mAcpiPmBaseAddress;
+STATIC UINT16 mAcpiHwReducedSleepCtl;
EFI_STATUS
EFIAPI
@@ -34,6 +35,9 @@ DxeResetInit ( case INTEL_Q35_MCH_DEVICE_ID:
mAcpiPmBaseAddress = ICH9_PMBASE_VALUE;
break;
+ case CLOUDHV_DEVICE_ID:
+ mAcpiHwReducedSleepCtl = CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS;
+ break;
default:
ASSERT (FALSE);
CpuDeadLoop ();
@@ -56,7 +60,12 @@ ResetShutdown ( VOID
)
{
- IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0);
- IoOr16 (mAcpiPmBaseAddress + 4, BIT13);
+ if (mAcpiHwReducedSleepCtl) {
+ IoWrite8 (mAcpiHwReducedSleepCtl, 5 << 2 | 1 << 5);
+ } else {
+ IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0);
+ IoOr16 (mAcpiPmBaseAddress + 4, BIT13);
+ }
+
CpuDeadLoop ();
}
|