From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (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 A5D7981E68 for ; Tue, 15 Nov 2016 03:23:00 -0800 (PST) Received: by mail-it0-x232.google.com with SMTP id q124so186836042itd.1 for ; Tue, 15 Nov 2016 03:23:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GMAWYjx2cZx4yBnEKlKfrg6Gy89WqDE8l9xWlDkyMuM=; b=B+9yj5PVyuNu/FqBBj0vmzlapHX6FXbtUei3SRuYB0bfCq7+r5kVsRTDQ9wIBKeU21 aAZqJ64adnfmtsbgS3FpyWFdFpQ2AnENix3trWHA5RVz7DGxEmrjRX7HsgYQU/NedO6J JBqZF/RFdKIdZho+P0aMRkiO0cVSBqSEVOjc8= 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=GMAWYjx2cZx4yBnEKlKfrg6Gy89WqDE8l9xWlDkyMuM=; b=CWnLBU1VH2AoOiHEosOSjF3GXDkgTQ4wnhpxxhlNn4QbSYXbm6FPBWXbbgiVay4rjZ URmdcrUCOVgMGjm2IFpJIi7ZFjhtqUgeqgi1pXIvp/wPLGtkXTxYH2hFc1/VEWfrpPt3 V6ialviHdm5cvk4s83Odf7dl/J/sQmt2P+Hd/mfWDmLfYG06d21nGydAkYlTMLojt53K jDxxYgENo2Hdh8g2EzmefYzjYbl8BtevRHm71KrVUpECdDl+eTkDoncw4pOiqtedSQel rHuv0Ww0Bi8qzpiVi0j39egYncZ/yYb0ku6Eu84tCZEFJ7uC3LPoploxC/KwyajdB2hB OojQ== X-Gm-Message-State: ABUngvcKHTmjsj28Wdj683tBzVQ0ZAuD/IQY9Rni8STvaub2D/VaM1uManPI7lpBbsWwZKz3C6US62XCDHRUBQ8P X-Received: by 10.107.2.8 with SMTP id 8mr28333777ioc.83.1479208984826; Tue, 15 Nov 2016 03:23:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.59.147 with HTTP; Tue, 15 Nov 2016 03:23:04 -0800 (PST) In-Reply-To: References: <1478173239-22270-1-git-send-email-ard.biesheuvel@linaro.org> From: Ard Biesheuvel Date: Tue, 15 Nov 2016 11:23:04 +0000 Message-ID: To: Marcin Wojtas Cc: edk2-devel-01 , Leif Lindholm , "Kinney, Michael D" , "afish@apple.com" , "Tian, Feng" , "Zeng, Star" Subject: Re: [PATCH v2 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: Tue, 15 Nov 2016 11:23:00 -0000 Content-Type: text/plain; charset=UTF-8 On 14 November 2016 at 20:52, Marcin Wojtas wrote: > Hi Ard, > > I tested your solution on Marvell Armada 70x0, whose upstream process > to OpenPlatformPkg is being finalized now. So far I was able to check > generic XHCI IP (MdeModulePkg/Bus/Pci/XhciDxe) and custom SD/MMC > driver - they both work fine with following modification in your code: > > --- 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; > > Any value lower than SIZE_16KB of BarSize resulted in XhcReadExtCapReg > function failing due to reaching out of declared space. So happened > with custom SD/MMC driver. Is it a problem to extend the space? > No, not at all. It was just a ballpark figure derived from a quick glance at the PCI drivers. > Did you consider extending RegisterNonDiscoverableDevice() function > with possible custom BarSize value? I think enabling the users > overriding the default value could be possible. What do you think? > Well, it depends on whether the PCI drivers will actually access that space. The idea is to make the non-discoverable device description as simple as possible. > I also reviewed the code during debug and have no objections. > Thanks! Note to reviewers: Marcin's patch series to add AHCI, XHCI and SDHCI support went from 10 files changed, 1583 insertions(+), 3 deletions(-) to 7 files changed, 271 insertions(+) which sounds like an improvement to me. Thanks, Ard.