RTEMS version: 4.6.5-1.0.19 pci bug?

Joel Sherrill joel.sherrill at OARcorp.com
Mon Aug 11 16:07:30 UTC 2008


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 
This is a Gaisler specific version number and until 4.8 I don't
see pci.c under bsp/sparc at all.
>
> 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) {*
>
This line only appears once in the version in RTEMS CVS for leon2 and
it has not been changed since it was merged in September 2007.  It reads:

                if (size == 0 || size == 0xffffffff || (size & 0xff) != 0) {

Jiri/Daniel... any thoughts? 
>
> ------------------------------
>
> 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
>


-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985





More information about the users mailing list