public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Andrew Fish" <afish@apple.com>
To: Michael Brown <mcb30@ipxe.org>
Cc: edk2-devel-groups-io <devel@edk2.groups.io>,
	tien.hock.loh@intel.com, Mike Kinney <michael.d.kinney@intel.com>,
	"thloh85@gmail.com" <thloh85@gmail.com>,
	Leif Lindholm <leif@nuviainc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>
Subject: Re: [edk2-devel] [PATCH V5 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver
Date: Tue, 27 Apr 2021 16:45:52 -0700	[thread overview]
Message-ID: <7A9BDBC1-4107-41A3-9FE0-FAF502E390EC@apple.com> (raw)
In-Reply-To: <61871098-5a01-8125-ae9b-7ccac33d3577@ipxe.org>



> On Apr 27, 2021, at 2:40 PM, Michael Brown <mcb30@ipxe.org> wrote:
> 
> On 27/04/2021 18:31, Andrew Fish via groups.io wrote:
>> One trick people have pulled in the past is to write a driver that produces a “fake” PCI IO Protocol. The “fake” PCI IO driver abstracts how the MMIO device shows up on the platform. This works well if the MMIO device is really the same IP block as a PCI device. This usually maps to the PCI BAR being the same thing as the magic MMIO range. The “fake” PCI IO Protocol also abstracts platform specific DMA rules from the generic driver.
> 
> Slightly off-topic, but I've always been curious about this: given that the entire purpose of PCI BARs is to allow for the use of straightforward MMIO operations, in which standard CPU read/write instructions can be used to access device registers with zero overhead and no possible error conditions, why do the EFI_PCI_IO_PROTOCOL.Mem.Read (and related) abstractions exist?  They seem to add a lot of complexity for negative benefit, and I'd be interested to know if there was some reason why the design was chosen.
> 

Michael,

Assuming physical address == non-catchable memory region is not always true. For example on Itainium you had to flip bit 63 in physical mode to do a non-cached transaction. There are also some high end servers that have different physical address ranges for PCI v.s DRAM. 

Basically we were paranoid about portability. That and we really don’t want #ifdef in the code for different architectures. 

Thanks,

Andrew Fish

> Thanks,
> 
> Michael


  reply	other threads:[~2021-04-27 23:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210322032439.9312-1-tien.hock.loh@intel.com>
2021-03-22  3:24 ` [PATCH V5 1/1] EmbeddedPkg: DwMmcHcDxe: Add support for Designware SDMMC driver Loh, Tien Hock
2021-03-30  4:36   ` Loh, Tien Hock
2021-04-16  5:34     ` Loh, Tien Hock
2021-04-26 17:53   ` Michael D Kinney
2021-04-27  9:08     ` Loh, Tien Hock
2021-04-27 10:27       ` Loh, Tien Hock
2021-04-27 17:31       ` [edk2-devel] " Andrew Fish
2021-04-27 19:31         ` Michael D Kinney
2021-04-28 13:03           ` Ard Biesheuvel
2021-04-28 14:58             ` Andrew Fish
2021-04-29  0:33               ` Loh, Tien Hock
2021-04-27 21:40         ` Michael Brown
2021-04-27 23:45           ` Andrew Fish [this message]
2021-04-28  0:06             ` Michael D Kinney
2021-04-28  0:52               ` Andrew Fish

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=7A9BDBC1-4107-41A3-9FE0-FAF502E390EC@apple.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