diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c index 98dd732a40..e33d863d2a 100644 --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c @@ -405,7 +405,7 @@ AtaAhciInitPrivateDataFromPciDevice ( { EFI_STATUS Status; PCI_TYPE00 PciData; - UINTN MmioBase; + UINT32 MmioBase; EFI_DEVICE_PATH_PROTOCOL *DevicePath; UINTN DevicePathLength; UINT64 EnabledPciAttributes; @@ -454,13 +454,15 @@ AtaAhciInitPrivateDataFromPciDevice ( &PciDevice->PciIo, EfiPciIoWidthUint32, 0x24, - sizeof (UINTN), + 1, &MmioBase ); if (EFI_ERROR (Status)) { return EFI_UNSUPPORTED; } + MmioBase &= 0xFFFFFFF0; + DevicePathLength = GetDevicePathSize (PciDevice->DevicePath); DevicePath = PciDevice->DevicePath;