RTEMS version: 4.6.5-1.0.19 pci bug?

Aitor.Viana.Sanchez at esa.int Aitor.Viana.Sanchez at esa.int
Mon Aug 11 15:31:41 UTC 2008

Hi all,

I think I found a bug in the pci_allocate_resources() RTEMS function. We 
are working with RTEMS for leon2 processor, and writing drivers for some 
other PCI boards we discovered a bad behaviour in the init_pci() function. 

RTEMS version: 4.6.5-1.0.19 
Source file affected: pci.c 
Path: rtems-4.6.5/c/src/lib/libbsp/sparc/leon2/pci 
Affected functions: 
void pci_allocate_resources(void) 

Modification description 
void pci_allocate_resources(void). 
Lines: 472 and 563 
Substitute the line: 
if (size == 0 || size == 0xffffffff || (size & 0x3f1) != 0) { 
by the line: 
if ((size == 0 || size == 0xffffffff) != 0) { 


In our PCI boards, the bits 3:0 of the BAR1 address are hardcoded to 
"1000" and the (size & 0x3f1) statement made the condition to be false 
always. The change does not affect the rest of boards we had already 
working. The reason why this condition is set in the original "pci.c" file 
is not clear and is not documented (maybe Jiri may say some).

I didn't have a look, but maybe this also affects to RTEMS 4.8 and RTEMS 
4.9 and maybe not only leon2 code but also leon3.


Aitor Viana Sánchez

ESA - European Space Technology Centre (ESTEC)
TEC-EDD - Computer and Data Systems Section
ESA/ESTEC P.O. Box 299 / 2200AG Noordwijk ZH, The Netherlands
Tel (+31) 71 565 6727
Email: aitor.viana.sanchez at esa.int

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20080811/ecd36ccf/attachment-0001.html>

More information about the users mailing list