public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: Marcin Wojtas <mw@semihalf.com>
Cc: edk2-devel-01 <edk2-devel@lists.01.org>,
	Leif Lindholm <leif.lindholm@linaro.org>,
	 "Kinney, Michael D" <michael.d.kinney@intel.com>,
	"afish@apple.com" <afish@apple.com>,
	 "Tian, Feng" <feng.tian@intel.com>,
	"Zeng, Star" <star.zeng@intel.com>
Subject: Re: [PATCH v2 0/5] MdeModulePkg: add support for non-discoverable devices
Date: Tue, 15 Nov 2016 11:23:04 +0000	[thread overview]
Message-ID: <CAKv+Gu_M7GnSQffkwUVOGwdjwtk8B_mb=p9UEPpYg68t_3n3AA@mail.gmail.com> (raw)
In-Reply-To: <CAPv3WKcv=k3BAP6S76G2_wxKjLPbCT5HZ+8DG1WUwOPnMA5qrg@mail.gmail.com>

On 14 November 2016 at 20:52, Marcin Wojtas <mw@semihalf.com> 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.


  reply	other threads:[~2016-11-15 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 11:40 [PATCH v2 0/5] MdeModulePkg: add support for non-discoverable devices Ard Biesheuvel
2016-11-14 20:52 ` Marcin Wojtas
2016-11-15 11:23   ` Ard Biesheuvel [this message]
2016-11-15 12:02     ` Marcin Wojtas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKv+Gu_M7GnSQffkwUVOGwdjwtk8B_mb=p9UEPpYg68t_3n3AA@mail.gmail.com' \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox