RTEMS version: 4.6.5-1.0.19 pci bug?

Kristoffer Glembo kristoffer at gaisler.com
Tue Aug 12 08:26:14 UTC 2008


Hello Aitor,

The line "*if (size == 0 || size == 0xffffffff || (size & 0x3f1) != 0)" 
decides which devices
are enabled. For example I/O devices are not supported by the RTEMS 
LEON2 PCI
code and should not be enabled. The (size & 0x3f1) != 0 comparison 
enables only
memory areas bigger than 1 KB.

I agree that this comparison should be modified and I suggest that you 
change it to:
"i**f (size == 0 || size == 0xffffffff || (size & 0x7) != 0)". This 
would ensure that devices
with small BARs (of type 00) are enabled.

We will test and incorporate this change.

Best regards,
Kristoffer Glembo
Gaisler Research
*
Aitor.Viana.Sanchez at esa.int wrote:
>
> 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.
>
>
> //avs
>
> -----------------------------
> 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
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list