Hi,
I send v2 of PciEmulation + USB + SATA support. The changes from v1 are significant. The driver was adjusted to cooperate with NonDiscoverablePciDeviceDxe driver, based on: [PATCH v2 0/5] MdeModulePkg: add support for non-discoverable devices
Debug showed that the above patchset had to be modified in a minor way in order to allow XHCI and SD/MMC driver (will be sent later) to operate properly:
--- a/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c +++ b/MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c @@ -942,7 +942,7 @@ InitializePciIoProtocol ( Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_CLASS_SERIAL_USB; Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SERIAL; Dev->BarIndex = 0; - Dev->BarSize = SIZE_2KB; + Dev->BarSize = SIZE_16KB; break;
case NonDiscoverableDeviceTypeAhci: @@ -958,7 +958,7 @@ InitializePciIoProtocol ( Dev->ConfigSpace.Hdr.ClassCode[1] = PCI_SUBCLASS_SD_HOST_CONTROLLER; Dev->ConfigSpace.Hdr.ClassCode[2] = PCI_CLASS_SYSTEM_PERIPHERAL; Dev->BarIndex = 0; - Dev->BarSize = 0x100; + Dev->BarSize = 0x300; break;
I let know about above on EDK2 mailing lists.
As a result the submitted code is greatly simplified and it allows for very flexible adding new devices (currently AHCI, XHCI, SDHCI) - only via PCD, without need of touching the driver.
NOTE: AHCI wasn't tested yet, I'm waiting for the board with the silicon revision, which is supposed to comprise quirkless AHCI IP (it should arrive in coming days).
Please let me know your opinion. Despite NonDiscoverablePciDeviceDxe is not yet in the tree, I'm looking forward to your review and remarks, so that we would be ready on OPP side for this to happen.
Best regards, Marcin
Jan Dąbroś (4): Platforms/Marvell: Enable PciEmulation driver for Armada70x0 platform Platforms/Marvell: Enable USB stack for Armada70x0 platform Platforms/Marvell: Enable two xHCI ports for Armada70x0 board Platforms/Marvell: Enable SATA stack for Armada70x0 platform
Marcin Wojtas (2): Platforms/Marvell: Add PciEmulation driver Platforms/Marvell: Enable SATA port for Armada70x0 board
.../Marvell/PortingGuide/PciEmulation.txt | 46 +++++++++ Platforms/Marvell/Armada/Armada.dsc.inc | 19 ++++ Platforms/Marvell/Armada/Armada70x0.dsc | 10 ++ Platforms/Marvell/Armada/Armada70x0.fdf | 18 ++++ Platforms/Marvell/Marvell.dec | 6 ++ Platforms/Marvell/PciEmulation/PciEmulation.c | 112 +++++++++++++++++++++ Platforms/Marvell/PciEmulation/PciEmulation.inf | 60 +++++++++++ 7 files changed, 271 insertions(+) create mode 100644 Documentation/Marvell/PortingGuide/PciEmulation.txt create mode 100644 Platforms/Marvell/PciEmulation/PciEmulation.c create mode 100644 Platforms/Marvell/PciEmulation/PciEmulation.inf