On 2014-12-04 17:04:52, Andrew Fish wrote: > > On Dec 4, 2014, at 4:30 PM, Jordan Justen <[email protected]> > wrote: > > On 2014-12-04 15:32:50, Scott Duplichan wrote: > > True, but the chosen name is quite confusing. PCI CF8 predates UEFI > (and even EFI) by years. When someone speaks of a PCI CF8 address, > there is little doubt they refer to the layout defined in the > conventional PCI specification. A name such as PCI_LIB_ADDRESS or > PCI_GENERIC_LIB_ADDRESS would have eliminated the confusion. > > > Yeah, it is a bit confusing. It seems likely that > MdePkg/Library/BasePciLibCf8 could just directly access cf8/cfc, > rather than going through PciCf8Lib. (And, perhaps then there is no > need for the PcfCf8Lib interface?) > > > > I think you guys are missing a few subtle points. > > The PciLib class, PciCf8Lib.h class, and the PciExpressLib.h share the same > abstraction for PCI access. > > In general if you are just trying to read and write PCI config space you > should > always use the PciLib. The platform will map it to the correct library > instance > to do the operation. > > The only reason the PciCf8Lib, and PciExpressLib classes exist is for early > chipset code. There are times when the chipset specifies you must use CF8, or > you must use PCIe, and that is the only reasons these library classes exist.
Right. I guess I had this in my head at some point. For example, you might need to use cf8/cfc to set the PCI express base address. :) Maybe there are more examples that make wanting to use the PciCf8Lib very common? If not, it seems like one might argue that the chipset code could use direct cf8/cfc accesses for the small set of code that requires this, and then use PciLib otherwise. > Thus likely Scott could just use the PciLib, and map it to the correct > instance. His code should not care about the underlying mechanism used to > accesses PCI Config space. The goal was also to make the algorithms in the > code > more portable, and having the same abstraction for PCI config space does > this. Yeah, I think I did recommend sticking to the PciLib interface. > ]PCI_CF8_LIB_ADDRESS appears to be designed to match PCI_LIB_ADDRESS. > ](I guess PciCf8Lib did not want to reuse PCI_LIB_ADDRESS directly.) > ] > ]By the way, it is probably better to interface with PciLib rather > than > ]PciCf8Lib. Oh yeah, here it is. :) -Jordan ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
