Rafael Machado [mailto:[email protected]] wrote:

]Hi everyone
]
]I'm facing a problem with a system and I'd like some help to check
]one strange behavior. At the UDK2014.SP1\MdePkg\Include\Library\PciCf8Lib.h
]
]We have the following macro:
]#define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
]  (((Offset) & 0xfff) | (((Function) & 0x07) << 12) | (((Device) & 0x1f) << 
15) | (((Bus) & 0xff) << 20))
]
]When using the following parameters Bus: 0xFF, Dev: 0x1F, Func: 0x7
]The resulting value is: 0xFFFF000

That looks more like a PCIe offset, not a CF8 dword value.

]As far as I know, the expected value should be: 0xFF1F0700

Shouldn't the CF8 dword look like:
 10000000 11111111 11111 111 000000 00 or 0x80FFFF00?

]So I believe that the correct macro should be something like:
]
]#define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
]  (((Offset) & 0xff) | (((Function) & 0x07) << 8) | (((Device) & 0x1f) << 16) 
| (((Bus) & 0xff) << 24))

I think something more like this...
#define PCI_CF8_LIB_ADDRESS(Bus,Device,Function,Offset) \
  (((Offset) & 0xfc) | (((Function) & 0x07) << 8) | (((Device) & 0x1f) << 11) | 
(((Bus) & 0xff) << 16))

]I have tested this because I had problems with a device at bus: 0, dev: 1, 
func: 0,
]that was never reached by 0xCF8 with the value converted by the first macro.
]With the proposed new macro everything works fine.
]
]I'd like an experts opinion about this. In case this is really an issue I can 
generate the patch.
]
]Thanks and Regards
]Rafael R. Machado



------------------------------------------------------------------------------
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

Reply via email to