From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5926C81EAB for ; Wed, 23 Nov 2016 06:31:05 -0800 (PST) Received: by mail-oi0-x229.google.com with SMTP id y198so16152133oia.1 for ; Wed, 23 Nov 2016 06:31:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=k92AoLlQ0DsdtkqC8wp3ffLJVn/u/be/clRTPlXA0e0=; b=h66YUSska08wvx+IViw1gDPiSt5WNu3fYrn6FK9wjWUJDjUaZ8tlXF0+CzyVf00LUm cLNEpm3qLZnF20iryPCv/4pWdH8q74czqtg6u0xCKkE7ewsd3Ptp/UVW3hewnNfi24cr bdljZc/b2J+fTHDNojrbu/KZQM88Rd0wWKLL2spQH9R71qhWOn7JWpBRft4RGBW7y5er 1cnqOVOxoJhDjTcMBeyyk2Jyt0BwlPq6WDcXDGtCroaD399aHEqYRZOtfDSBT4cKsjld 2OomCyw7PUYA3pMchJaARcgzE31pVkx68B4DTugLrjJW+rKMbuQ9Wo+j7Bk3z7KYs943 ZIhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=k92AoLlQ0DsdtkqC8wp3ffLJVn/u/be/clRTPlXA0e0=; b=Sjdq9AUXdQXAxtjhUOYzxWjWtQmaWReKnxL5EJyQrrHOPeQAlrZFKSW6ZNkejY4KaD Epno/lElrsvUP1kX5OLc9HN1Vi/5rBy9YBzomlLdmlPkmYbVzP+sq5lBj0YvJ2956fxr bx05NGcMnAdfYWEH/V+OhFNnti/hq/Rir2ljwqGnjKRPC0WtsZAz1PvsUHuV73oLrmA5 CtYEIQ49X3WxMJRYneFMHhsq6QJQyH4TGo0i800JD+gKjzA0+YLezdJXtnr4Mf7RkpLY 5hlHYGDMzbgf4A31M4/zYLAljbsahxwO9bcCmvUSdc1uUMy+CF9olVdDbXom+gP2xwbj Ttmg== X-Gm-Message-State: AKaTC032x1W78/wpEajkODC41EknwXu74AeMWemiburkvkcoXmu9jUxqqQzsCOH+YGad/sMkJoYVGmOP772hqA== X-Received: by 10.36.31.200 with SMTP id d191mr6808293itd.70.1479911464370; Wed, 23 Nov 2016 06:31:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.25.140 with HTTP; Wed, 23 Nov 2016 06:31:03 -0800 (PST) In-Reply-To: References: <1479315571-14953-1-git-send-email-ard.biesheuvel@linaro.org> From: Marcin Wojtas Date: Wed, 23 Nov 2016 15:31:03 +0100 Message-ID: To: Ard Biesheuvel Cc: edk2-devel-01 , "Gao, Liming" , "Ni, Ruiyu" , "Kinney, Michael D" , afish@apple.com, Leif Lindholm Subject: Re: [PATCH v3 0/5] MdeModulePkg: add support for non-discoverable devices X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 14:31:05 -0000 Content-Type: text/plain; charset=UTF-8 Hi, Also AHCI works fine, as well as init quirk mechanism. Best regards, Marcin 2016-11-17 5:36 GMT+01:00 Marcin Wojtas : > Hi Ard, > > Series tested on Marvell Armada 7040 board (XHCI and SDHCI). You can add: > Tested-by: Marcin Wojtas > > Best regards, > Marcin > > 2016-11-16 17:59 GMT+01:00 Ard Biesheuvel : >> The rationale for this series is the fact that many ARM platforms implement >> some form of PCI 'emulation', to allow non-discoverable devices that implement >> standardized host controller interfaces (i.e., EHCI, AHCI) to be controlled by >> the generic EDK2 drivers, which are layered on top of the PCI I/O protocols >> (even though the respective host controller specifications don't mandate that) >> >> There are a couple of problems with that approach: >> - Most implementations are based on the original code created for BeagleBoard, >> which is a 32-bit platform. Unlike x86, which usually does not perform PCI >> DMA above 4 GB, the ARM ecosystem is much more heterogeneous, and platforms >> that have memory both above and below the 4 GB mark may ship with, e.g., EHCI >> controllers that do not implement 64-bit DMA addressing. >> - Implementations depend on the DmaLib library class in EmbeddedPkg, of which >> coherent and non-coherent implementations exists. However, both types of >> devices may appear on a single platform, requiring several instances of the >> same driver. >> - Existing implementations do not follow the UEFI driver model, but instantiate >> a fixed number of PCI I/O protocol handles, and bring up all the devices when >> doing so. However, the UEFI philosophy is to only instantiate (and thus >> initialize) devices that are involved in booting. >> >> So instead, let's define a base protocol that simply asserts the presence of >> a certain kind of device at a certain memory offset, allowing platforms to >> instantiate any number of these statically, and leave it to post-DXE driver >> dispatch to actually bind the drivers as usual. This is implemented in patch #1. >> Note that it includes an AMBA device type, which we intend to use in the future >> to move ARM AMBA drivers to the UEFI driver model as well (i.e., LCD controller, >> SD/MMC controller) >> >> Patch #2 implements a utility library to register non-discoverable devices. >> >> Patch #3 implements the UEFI driver that instantiates PCI I/O protocol handles >> for non-discoverable devices that we know can be driven by a generic driver in >> EDK2. The initial version implements coherent DMA only. >> >> Patch #4 implements non-coherent DMA for the driver added in patch #3. >> >> Patch #5 is included for reference. It ports the BeagleBoard platform to the >> new driver stack. >> >> Changes in v3: >> - Modified the base protocol to describe any number of resources using ACPI >> resource descriptors. The current crop of targeted peripherals does not >> require that, but it allows for much more flexibility in the future. This >> also means that the MMIO region sizes are no longer hard-coded base on the >> controller type (EHCI, AHCI, etc) but need to be declared when the devices >> are registered. >> - Update the registration library API to allow multiple MMIO regions to be >> declared. >> - When performing uncached allocations, record the original memory region >> attributes so we can restore them correctly on free. >> - Some fixes in the 4GB boundary checks for Map/Unmap >> - Rename gNonDiscoverableDeviceProtocolGuid to >> gEdkiiNonDiscoverableDeviceProtocolGuid >> >> Ard Biesheuvel (5): >> MdeModulePkg: introduce non-discoverable device protocol >> MdeModule: introduce helper library to register non-discoverable >> devices >> MdeModulePkg: implement generic PCI I/O driver for non-discoverable >> devices >> MdeModulePkg/NonDiscoverablePciDeviceDxe: add support for non-coherent >> DMA >> Omap35xxPkg/PciEmulation: port to new non-discoverable device >> infrastructure >> >> BeagleBoardPkg/BeagleBoardPkg.dsc | 2 + >> BeagleBoardPkg/BeagleBoardPkg.fdf | 1 + >> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/ComponentName.c | 75 ++ >> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c | 226 ++++ >> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf | 44 + >> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c | 1187 ++++++++++++++++++++ >> MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h | 113 ++ >> MdeModulePkg/Include/Library/NonDiscoverableDeviceRegistrationLib.h | 49 + >> MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h | 90 ++ >> MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c | 161 +++ >> MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf | 34 + >> MdeModulePkg/MdeModulePkg.dec | 7 + >> MdeModulePkg/MdeModulePkg.dsc | 3 + >> Omap35xxPkg/Omap35xxPkg.dsc | 2 +- >> Omap35xxPkg/PciEmulation/PciEmulation.c | 578 +--------- >> Omap35xxPkg/PciEmulation/PciEmulation.h | 292 ----- >> Omap35xxPkg/PciEmulation/PciEmulation.inf | 16 +- >> Omap35xxPkg/PciEmulation/PciRootBridgeIo.c | 306 ----- >> 18 files changed, 2025 insertions(+), 1161 deletions(-) >> create mode 100644 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/ComponentName.c >> create mode 100644 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.c >> create mode 100644 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceDxe.inf >> create mode 100644 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.c >> create mode 100644 MdeModulePkg/Bus/Pci/NonDiscoverablePciDeviceDxe/NonDiscoverablePciDeviceIo.h >> create mode 100644 MdeModulePkg/Include/Library/NonDiscoverableDeviceRegistrationLib.h >> create mode 100644 MdeModulePkg/Include/Protocol/NonDiscoverableDevice.h >> create mode 100644 MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.c >> create mode 100644 MdeModulePkg/Library/NonDiscoverableDeviceRegistrationLib/NonDiscoverableDeviceRegistrationLib.inf >> delete mode 100644 Omap35xxPkg/PciEmulation/PciEmulation.h >> delete mode 100644 Omap35xxPkg/PciEmulation/PciRootBridgeIo.c >> >> -- >> 2.7.4 >>