summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
AgeCommit message (Collapse)AuthorFilesLines
2016-05-12MdeModulePkg AtaAtapiPassThru: Fix incorrect parameter description commentHao Wu1-6/+6
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-12MdeModulePkg Ata: Use the new (incompatible) PortMultiplierPort semanticsHao Wu3-23/+66
The Mantis ticket 1353 <https://mantis.uefi.org/mantis/view.php?id=1353> and Mantis ticket 1472 <https://mantis.uefi.org/mantis/view.php?id=1472> updated the description of the port multiplier port number parameter in SATA Device Path Node and ATA Pass-Through Protocol. Now, this parameter should be set to 0xFFFF instead of 0 to indicate that an ATA device is directly attached on the controller port. Please note that this is an incompatible change. The consumer of SATA device path or ATA_PASS_THRU needs to re-examine its usage to follow UEFI 2.5 mantis 1353 and 1472. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-12MdeModulePkg/UsbMouseAbsolutePointerDxe: fix VS2015 NOOPT build errorFeng Tian1-4/+4
Cc: Shumin Qiu <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-05-11MdeModulePkg/PciHostBridgeDxe: Honor ResourceAssignedRuiyu Ni3-58/+134
Change PciHostBridgeDxe driver to not install the PciHostBridgeResourceAllocation protocol and let PciRootBridgeIo.Configuration() return the correct PCI resource assignment information when the ResourceAssigned is TRUE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-11MdeModulePkg/PciHostBridgeDxe: Fix a Base/Limit comparing bugRuiyu Ni2-14/+14
When the aperture base equals to aperture limit, the old code treats the aperture as non-existent. It's not correct because it indicates a range starting with base and the length is 1. The new code corrects the comparing bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-11MdeModulePkg/PciHostBridgeDxe: Don't miss prefetchable MMIO apertureRuiyu Ni1-1/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-10MdeModulePkg/PciSioSerialDxe: Do not flush the UARTRuiyu Ni1-26/+1
The patch aligns to the IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe driver not flush the UART in Reset() and SetAttributes() function. It was found the flush causes hang on certain PCI serial devices. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Eric Jin <eric.jin@intel.com>
2016-05-09MdeModulePkg/Sd: add Erase Block support on sd/emmc deviceFeng Tian10-6/+978
It's done by producing EFI_ERASE_BLOCK_PROTOCOL protocol instance. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-05-06MdeModulePkg/SdMmcPciHcDxe: Check SD's supported bus mode before switchFeng Tian3-41/+75
Before switch to a bus mode, we need check if the SD device supports this bus mode. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
2016-05-06MdeModulePkg/SdMmcPciHcDxe: Error handling enhance on tuning procedureFeng Tian4-21/+56
Enhance the code to reset tuning circuit when tuning error case happens. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
2016-05-06MdeModulePkg/SdMmcPciHcDxe: Using PIO rather than DMA for clock tuningFeng Tian3-98/+164
The original code is using ADMA mode to do clock tuning procedure. It may have problem on some SD/MMC host controllers as there is no way to know when to send next tuning cmd. Update it to PIO mode to strictly follow SD Host Controller Simplified Specification 3.0 Figure 2-29. By this way, if the Buffer Read Ready interrupt is set, we could know it's ok to send the next clock tuning cmd. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
2016-05-06MdeModulePkg/SdMmcPciHcDxe: Use BaseClk if the target clock is largerFeng Tian3-3/+20
The original code has a bug to calculate which clock freq should be used when the target clock freq is larger than the BaseClock Freq provided by the system. Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
2016-05-06MdeModulePkg/SdMmcPciHcDxe: break cmd exec if the card isn't identifiedFeng Tian2-5/+29
Check if the card is identified/initialized correctly. if not, break the following cmd execution through PassThru()/ResetDevice(). Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com>
2016-05-06MdeModulePkg NvmExpressDxe: Initialize IoAlign info for an NVMe deviceHao Wu1-0/+1
The "IoAlign" field in EFI_BLOCK_IO_MEDIA of an NVMe device is not initialized properly, leading to a zero value for this field. It should be initialized from the "IoAlign" field in the EFI_NVM_EXPRESS_PASS_THRU_MODE structure maintained by the NVMe controller. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-05-05MdeModulePkg: ScsiDiskDxe: cope with broken "Supported VPD Pages" VPD pageLaszlo Ersek1-0/+37
The USB flash drive with Vendor ID 0x1516 (CompUSA) and Product ID 0x6221 returns a broken "Supported VPD Pages" VPD page. In particular, the PageLength field has the invalid value 0x0602 (decimal 1538). This prevents the loop from terminating that scans for the Block Limits VPD page code in ScsiDiskInquiryDevice(): for (Index = 0; Index < PageLength; Index++) { because the Index variable has type UINT8, and it wraps from 255 to 0, without ever reaching PageLength (1538), and because EFI_SCSI_PAGE_CODE_BLOCK_LIMITS_VPD does not occur at offsets 0 through 255. * The fix is not to change the type of Index to UINT16 or a wider type. Namely, section 7.8.14 Supported VPD Pages VPD page in the "SCSI Primary Commands - 4" (SPC-4) specification names the following requirement: The supported VPD page list shall contain a list of all VPD page codes (see 7.8) implemented by the logical unit in ascending order beginning with page code 00h. Since page codes are 8-bit unsigned quantities, it follows that the maximum size for the Supported VPD Pages VPD page is 0x100 bytes, in which every possible page code (0x00 through 0xFF) will be found, before the UINT8 offset wraps around. (EFI_SCSI_SUPPORTED_VPD_PAGES_VPD_PAGE.SupportedVpdPageList is correctly sized as well, in "MdePkg/Include/IndustryStandard/Scsi.h".) * Instead, add sanity checks that enforce the above requirement. If the device breaks the spec, simply fall back to the "Block Limits page absent" case. Cc: Feng Tian <feng.tian@intel.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Ref: https://bugzilla.redhat.com/show_bug.cgi?id=1330955 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-04-29MdeModulePkg/PciBusDxe: don't create bogus descriptor if no resources neededArd Biesheuvel1-5/+2
If the current PCI configuration requires no resources to be allocated at all (i.e., unpopulated bus), the PCI enumeration code creates a single ACPI_ADDRESS_SPACE_DESCRIPTOR memory descriptor with all fields cleared. This is rejected by the SubmitResources() implementation of the generic PciHostBridgeDxe in the following way: PciHostBridge: SubmitResources for PcieRoot(0x0) Mem: Granularity/SpecificFlag = 0 / 00 Length/Alignment = 0x0 / 0x0 PciBus: HostBridge->SubmitResources() - Invalid Parameter ASSERT_EFI_ERROR (Status = Invalid Parameter) ASSERT [PciBusDxe] .../PciBusDxe/PciLib.c(561): !EFI_ERROR (Status) So instead, create the empty configuration as a single entry of type EFI_ACPI_END_TAG_DESCRIPTOR. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-04-29MdeModulePkg/NvmExpressDxe: comments update to meet implementationFeng Tian1-7/+5
Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Wu, Hao A <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Wu, Hao A <hao.a.wu@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
2016-04-26MdeModulePkg/NvmExpress: Clean Phase/CqHdbl/SqTdbl fields to restart HCTian Feng2-4/+12
Phase Tag, SqTdbl/CqHdbl and SqBuffer/CqBuffer should be cleared in NvmeControllerInit() to make HC functionality work when user invokes NvmeBlockIoReset(). Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
2016-04-26MdeModulePkg/NvmExpress: Fix bug of handling not null-terminated stringsFeng Tian2-6/+15
In EnumerateNvmeDevNamespace(), when Private->ControllerData->Sn and/or Private->ControllerData->Mn are NOT null-terminated strings, UnicodeSPrintAsciiFormat(…) may generate unexpected (garbage) output string. Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-04-26MdeModulePkg/NvmExpress: Fix mem leak in error handling of Start()Tian Feng1-0/+4
Memory pointed to by Private->ControllerData has not been freed up correctly at error handling path. Cc: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Simon (Xiang) Lian-SSI <simon.lian@ssi.samsung.com>
2016-04-26MdeModulePkg/EmmcDxe: Fix wrong coding style on close braceFeng Tian1-2/+3
The close brace of EmmcDxeComponentNameGetControllerName should be at the beginning of a line. Cc: Qiu Shumin <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-26MdeModulePkg/EmmcDxe: Fix wrong typo on function commentsFeng Tian2-2/+3
Cc: Qiu Shumin <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-26MdeModulePkg/Sd: Not explicitly compare BOOLEAN type with TRUE/FALSEFeng Tian1-4/+4
It's coding style update to follow EDKII coding style doc. Cc: Qiu Shumin <shumin.qiu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-21MdeModulePkg/Sd: wait 1ms before check DATA line in voltage switch procFeng Tian2-2/+2
According to SD Host Controller 3.0 spec figure 3-10, we have to wait 1ms before checking DAT[3:0] in voltage switch proc Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-04-21MdeModulePkg/SdMmcPciHc: Reset the slot when sd device is connectedFeng Tian1-0/+7
The original code doesn't reset the slot when there is device change. It may bring issue on device identification procedure of some SD cards. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@Intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-04-21MdeModulePkg/Sd: Fix wrong response type of SD Deselect cmdFeng Tian2-4/+8
The SD CMD7 deselect cmd have no response according to SD physical layer simplified spec. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-04-21MdeModulePkg/Sd: update the sd detection logicFeng Tian2-15/+18
If there is no card presented before power on, there would have no card change interrupt generated. This is a corner case which can't be handled by old logic. The patch is used to move card present detection in the front of card change interrupt detection. Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-04-21MdeModulePkg/Usb: Fix wrong condition judgment to support usb3.1 devFeng Tian4-8/+8
The bcdUSB value of usb3.1 is 0x0310, we update the condition judgment to get correct max packet size for usb3.1 dev. Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-04-21MdeModulePkg/UsbKbDxe: don't assert when the key read is invalidFeng Tian1-5/+10
The GetKeyDescriptor() may return NULL when the KeyData is invalid. For such case, we should go to error handling path rather than assert Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-04-18MdeModulePkg NvmExpressDxe: Ensure write-through for NVMe write commandHao Wu1-1/+4
Set the Force Unit Access (FUA) bit in NVMe Write - Command Dword 12 to ensure write-through behavior. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-04-13MdeModulePkg/Ps2MouseDxe: Use a different FILE_GUIDRuiyu Ni1-1/+1
Change to use a different FILE_GUID to avoid using the same GUID as the module in IntelFrameworkModulePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-13MdeModulePkg/Ps2KeyboardDxe: Use a different FILE_GUIDRuiyu Ni1-1/+1
Change to use a different FILE_GUID to avoid using the same GUID as the module in IntelFrameworkModulePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-13MdeModulePkg/Ps2Mouse: Fix potential buffer overflow issue.Ruiyu Ni1-1/+1
Count is initially 1 but is assigned to 2 in case PS2_READ_DATA_BYTE. Though the state machine doesn't go back from PS2_READ_DATA_BYTE to PS2_READ_BYTE_ONE (not a true bug), force assign Count to 1 to avoid potential buffer overflow issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
2016-04-13MdeModulePkg/Ps2MouseDxe: Fix build failure of GCC tool chainQiu, Shumin1-1/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-04-08MdeModulePkg: Add Ps2MouseDxe driverRuiyu Ni8-0/+2798
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-04-08MdeModulePkg: Add Ps2KeyboardDxe driver.Ruiyu Ni8-0/+4232
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-31MdeModulePkg EmmcDxe: Fix GCC build failure with set but unused variablesZeng, Star1-3/+1
Cc: Feng Tian <feng.tian@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-30MdeModulePkg/SdMmc: Add EDKII SD/MMC stackFeng Tian49-0/+24326
This stack includes: 1. Dxe phase support by: 1) SdMmcPciHcDxe driver to consume PciIo and produce SdMmcPassThru. 2) SdDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2. 3) EmmcDxe driver to consume SdMmcPassThru to produce BlkIo1/BlkIo2/SSP. 2. Pei phase support 1) SdBlockIoPei driver to consume SdMmcHostController Ppi and produce VirutalBlkIo1&2. 2) EmmcBlockIoPei driver to consume SdMmcHostController Ppi and produce VirutalBlkIo1&2. 3) SdMmcPciHcPei driver to produce SdMmcHostController Ppi. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
2016-03-29MdeModulePkg ScsiDiskDxe: Fix hang issue when reconnecting an ISCSI deviceHao Wu1-5/+13
The 'Reset' function for BlockIO(2) in ScsiDiskDxe should return EFI_SUCCESS instead of EFI_DEVICE_ERROR when a device does not support reset feature. Otherwise, a 'reconnect -r' action when an ISCSI device is attached will cause system hang. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2016-03-25MdeModulePkg: UfsPassThruDxe: remove set but unused variablesLaszlo Ersek2-10/+1
Cc: Feng Tian <feng.tian@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-03-25MdeModulePkg/PciHostBridgeDxe: remove unused but set variablesArd Biesheuvel1-8/+0
Remove variables that are declared, assigned but never referenced. This fixes a warning emitted by GCC when -Wunused-but-set-variable is in effect. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-03-24MdeModulePkg/PciBus: Should reserve enough bus number for HPCRuiyu Ni1-2/+2
When there is no bridge before the HPC (hot plug controller), the issue cannot be seen. But when there are bridges before the HPC, the PciBus will only use the value (= <CurrentBusNumber> + <ReservedBusNumber>) as the sub-ordinary bus number for HPC. The correct sub-ordinary bus number should be: <CurrentBusNumber> + <OccupiedBusNumber>(by earlier bridges) + <ReservedBusNumber>. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com>
2016-03-04MdeModulePkg/PciHostBridge: Don't assert when setting UC to MMIO failsRuiyu Ni1-1/+3
Failing to set EFI_MEMORY_UC to MMIO aperture is not a fatal error. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com>
2016-03-03MdeModulePkg: PciHostBridgeDxe: don't assume extended config spaceLaszlo Ersek2-1/+4
The "pc" ("pc-i440fx-*") machine types of QEMU don't support extended config space. Accordingly, OVMF will use the following library instances in connection with the core PciHostBridgeDxe driver: BasePciSegmentLibPci [class: PciSegmentLib] BasePciLibCf8 [class: PciLib] BasePciCf8Lib [class: PciCf8Lib] Add a new field to the PCI_ROOT_BRIDGE structure so that RootBridgeIoCheckParameter() can catch config space offsets above 0xFF on such old (emulated) platforms. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Marcel Apfelbaum <marcel@redhat.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-03-03MdeModulePkg: PciHostBridgeDxe: insert horizontal whitespaceLaszlo Ersek1-9/+9
... in preparation for the next patch. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-03-01MdeModulePkg/NvmExpress: Fix uninitialized field used in NVMe DiskInfoTian, Feng1-1/+2
Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-02-29MdeModuelPkg/PciBus: Return AddrTranslationOffset in GetBarAttributesRuiyu Ni1-0/+62
Some platform doesn't use CPU(HOST)/Device 1:1 mapping for PCI Bus. But PCI IO doesn't have interface to tell caller (device driver) whether the address returned by GetBarAttributes() is HOST address or device address. UEFI Spec 2.6 addresses this issue by clarifying the address returned is HOST address and caller can use AddrTranslationOffset to calculate the device address. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-29MdeModulePkg/PciBus: reorganize case-statement to reduce code linesRuiyu Ni1-24/+10
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-29MdeModulePkg/PciBus: Change local variable AddressSpace to DescriptorRuiyu Ni1-26/+22
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-02-26MdeModulePkg/PciHostBridge: Don't assume resources are fully NonExistentRuiyu Ni1-11/+294
The patch removes the assumption that the resources claimed by root bridges should not exist. Because resources might have been added: 1. by platform modules either in PEI through resource HOB, or in DXE, before the PCI host bridge driver runs. 2. Resources claimed by different root bridges may overlap so that resource adding operation for latter root bridges may fail if we assume the resource should not exist. In real world, this patch is to fit OVMF platform needs because different root bridges in OVMF platform shares the same resources. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> [lersek@redhat.com: intersection-based implementation] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>