Re: [edk2] why InsertResourceNode adds resources in reverse order.

Subject: Re: [edk2] why InsertResourceNode adds resources in reverse order.

From: Andrew Fish <afish@apple.com>

To: edk2-devel@lists.sourceforge.net

Date: 2014-06-03 08:33:04


On Jun 2, 2014, at 11:59 PM, Ganapatrao Kulkarni <gpkulkarni@gmail.com> wrote:

 we have 2 BARs, first one BAR0 is for the register access and BAR4 is for the MSI-X.

But from the system point of view they are both 64-bit memory BARs. They are both just registers in memory space that your device decodes. 

I thought MSI-X was implemented via PCI Express Capability Registers?

after the enumeration BAR0 will be programmed with resource at 0x20(MSI-x resource) and BAR4 for CSR access.

The bar is not a PCI CSR from the system point of view, it is just memory.  If your PCI device calls it a CSR, well that is just confusing since it is not PCI terminology. 

this is happening since the last resource is added to the head.  which lists resources in reverse order  and i don't see any need to have resources in reverse order.

Where is this illegal in the PCI spec? Im rusty on MSI-X programming. 

Thanks,

Andrew Fish



regards
Ganapat





On Tue, Jun 3, 2014 at 11:57 AM, Andrew Fish <afish@apple.com> wrote:

On Jun 2, 2014, at 11:07 PM, Ganapatrao Kulkarni <gpkulkarni@gmail.com> wrote:

can some one please explain me on this?


On Mon, May 26, 2014 at 10:19 AM, Ganapatrao Kulkarni <gpkulkarni@gmail.com> wrote:
Hi All,

i came across function InsertResourceNode in file MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
is adding the last resource as the first node, with that our controller 2 BARs (BAR0 and BAR4, 64bit mode, type mem)  are getting
allocated in reverse order, i.e first region is getting programmed at offset 0x20 and second one at 0x10.
IMHO, it should be other way.


Why does it matter?  The system just needs to forward the addresses for your two bars to the bus your device sits on. Only your device knows what the addressees mean. 

Thanks,

Andrew Fish

can some one please explain me on this?

my source base-lined with version git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15439 6f19259b-4bc3-4df7-8a09-765794883524


thanks
Ganapat


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel