Xilinx IP core drivers for RTEMS- diff attached - BUILD SUCCESS!

Robert S. Grimes rsg at alum.mit.edu
Thu Dec 21 19:32:00 UTC 2006


Hi Greg,

Okay, no it is okay for you to be really annoyed with me.  It turns out
that I had subconsciously convinced myself that bootstrap was not necessary!

Still, there are a few minor glitches, one of which you already know
about.  This is the procedure I followed that finally worked.

Step 1. Unpack

    $ cd tools
    $ tar xjf ../archive/rtems-4.6.99.3

Step 2. Apply your/Keith's patch

    $ cd rtems-4.6.99.3
    $ cat ../../archive/proposed-gen405.diff | patch -p0

Step 3. Run bootstrap in rtems-4.6.99.3 source tree

    $ ./bootstrap

Step 4. Configure

    $ cd ../b-rtems
    $ ../rtems-4.6.99.3/configure --target=powerpc-rtems --enable-posix
    --enable-networking --enable-cxx --enable-rtemsbsp="gen405"
    --prefix=/usr/rtems/4.6.99.3

Step 5. First build attempt

    make all    #- fails due to missing xilemac.h file - old problem

Step 6. Second build attempt

    cp ../rtems-4.6.99.3/c/src/libchip/network/xilemac.h
    powerpc-rtems/gen405/lib/include/libchip
    make all  #-fails with this message

    if powerpc-rtems-gcc --pipe -B../../../../.././lib/
    -B../../../../.././gen405/lib/ -specs bsp_specs -qrtems -DPACKAGE_NA
    ME=\"rtems-c-src-lib-libcpu-powerpc\"
    -DPACKAGE_TARNAME=\"rtems-c-src-lib-libcpu-powerpc\"
    -DPACKAGE_VERSION=\"4.6.99.3\
    " -DPACKAGE_STRING=\"rtems-c-src-lib-libcpu-powerpc\ 4.6.99.3\"
    -DPACKAGE_BUGREPORT=\"rtems-bugs at rtems.com\" -I. -I../..
    /../../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc  -isystem
    ../../../../.././gen405/lib/include -I../../../../../.
    ./../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/old-exceptions  -Wall
    -mcpu=403 -D_OLD_EXCEPTIONS -Dppc405 -O4 -fno-keep-in
    line-functions -g -MT
    old-exceptions/old_exceptions_rtems_cpu_rel-cpu.o -MD -MP -MF
    "old-exceptions/.deps/old_exceptions
    _rtems_cpu_rel-cpu.Tpo" -c -o
    old-exceptions/old_exceptions_rtems_cpu_rel-cpu.o `test -f
    'old-exceptions/cpu.c' || echo
    '../../../../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/'`old-exceptions/cpu.c;
    \
    then mv -f
    "old-exceptions/.deps/old_exceptions_rtems_cpu_rel-cpu.Tpo"
    "old-exceptions/.deps/old_exceptions_rtems_cpu_re
    l-cpu.Po"; else rm -f
    "old-exceptions/.deps/old_exceptions_rtems_cpu_rel-cpu.Tpo"; exit 1; fi
    powerpc-rtems-gcc --pipe -B../../../../.././lib/
    -B../../../../.././gen405/lib/ -specs bsp_specs -qrtems -isystem ../../
    ../../.././gen405/lib/include  -DASM -mcpu=403 -D_OLD_EXCEPTIONS
    -Dppc405 -O4 -fno-keep-inline-functions -g  -c ../../..
    /../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/old-exceptions/cpu_asm.S
    powerpc-rtems-gcc --pipe -B../../../../.././lib/
    -B../../../../.././gen405/lib/ -specs bsp_specs -qrtems -Wall -mcpu=403
     -D_OLD_EXCEPTIONS -Dppc405 -O4 -fno-keep-inline-functions -g   -o
    old-exceptions/rtems-cpu.rel -qnolinkcmds -nostdlib -
    Wl,-r old-exceptions/old_exceptions_rtems_cpu_rel-cpu.o
    old-exceptions/cpu_asm.o
    powerpc-rtems-gcc: old-exceptions/cpu_asm.o: No such file or directory
    make[5]: *** [old-exceptions/rtems-cpu.rel] Error 1
    make[5]: Leaving directory
    `/cygdrive/c/Home/ll/etill/rtems-4.6.99.3/tools/b-rtems/powerpc-rtems/c/gen405/lib/libcpu/powerpc'

Step 7. Third build attempt

    $ cp powerpc-rtems/c/gen405/lib/libcpu/powerpc/cpu_asm.o
    powerpc-rtems/c/gen405/lib/libcpu/powerpc/old-exceptions/
    $ make all  #- fails with this message

    powerpc-rtems-gcc --pipe -B../../../../.././lib/
    -B../../../../.././gen405/lib/ -specs bsp_specs -qrtems -Wall -mcpu=403
     -D_OLD_EXCEPTIONS -Dppc405 -O4 -fno-keep-inline-functions -g   -o
    ppc403/vectors.rel -qnolinkcmds -nostdlib -Wl,-r ppc4
    03/vectors/vectors.o ppc403/vectors/align_h.o
    powerpc-rtems-gcc: ppc403/vectors/vectors.o: No such file or directory
    powerpc-rtems-gcc: ppc403/vectors/align_h.o: No such file or directory
    make[5]: *** [ppc403/vectors.rel] Error 1
    make[5]: Leaving directory
    `/cygdrive/c/Home/ll/etill/rtems-4.6.99.3/tools/b-rtems/powerpc-rtems/c/gen405/lib/libcpu/powerpc'

Step 8. Final build attempt

    $ cp -i powerpc-rtems/c/gen405/lib/libcpu/powerpc/vectors.o
    powerpc-rtems/c/gen405/lib/libcpu/powerpc/ppc403/vectors/
    $ cp -i powerpc-rtems/c/gen405/lib/libcpu/powerpc/align_h.o
    powerpc-rtems/c/gen405/lib/libcpu/powerpc/ppc403/vectors/
    $ make all
    $ make install

Completes Successfully!!!  I have a meeting now, so I can't actually
test anything yet, but that's next!

So it seems you still have some issues with the bootstrap/configure
process.  Sadly, I have absolutely no idea where - those tools are
completely foreign to me...

Sorry 'bout my mis-steps!
-Bob

Robert S. Grimes wrote:
> Oh, the final error is in the
> <BUILDROOT>/powerpc-rtems/c/gen405/testsuites/samples/hello example
> program build.
>
> Also, in the "First Attempt", the path should be
> <BUILDROOT>/powerpc-rtems/gen405/lib/include/libchip
>
> Robert S. Grimes wrote:
>   
>> Okay, I've got major egg on my face!  The "xilemac.c and xilemac.h are
>> identical" comment is false!  Red Herring!  My screw-up!
>>
>> This morning, I decided to start over, and see if I can prove or
>> disprove it.  So I started with a clean un-tar, applied the patch, then
>> looked at xilemac.h - lo and behold, it is now a real header file!  I
>> still can't quite get it to build, though.  Here is what I've found so
>> far...
>>
>> First Attempt:
>>
>>     make all
>>       - fails during compile due to missing xilemac.h file
>>     Fix:  cp <SOURCEROOT>/c/src/libchip/network/xilemac.h
>>     <BUILDROOT>/gen405/lib/include/libchip
>>
>> Second Attempt:
>>
>>     make all
>>       - fails during compile due to missing opbintctrl.h
>>     Fix: cp
>>     <SOURCEROOT>/c/src/lib/libbsp/powerpc/gen405/include/opbintctrl.h
>>     <BUILDROOT>/powerpc-rtems/gen405/lib/include
>>
>> Third Attempt
>>
>>     make all
>>       - fails during link due to error:
>>     gen405/lib/librtemsbsp.a(startup.rel): In function `bsp_predriver_hook':
>>     c/src/lib/libbsp/powerpc/gen405/startup/bspstart.c:107: undefined
>>     reference to `opb_intc_init'
>>
>> I haven't yet resolved the third problem, but I have narrowed it down a
>> wee bit.  Seems
>> <ROOT>/c/src/lib/libbsp/powerpc/gen405/opbintctrl/opbintctrl.c is not
>> being compiled or included in the link.
>>
>> I'll keep you informed, and once again, SORRY!!!
>>
>> -Bob
>>
>>
>> Robert S. Grimes wrote:
>>   
>>     
>>> Wow!  I don't know what happened, if it was the atuoconf/automake stuff
>>> or not, but I just realized in the source tree after patching, the files
>>> xilemac.c and xilemac.h are identical; specifically, they both contain
>>> what should be the .c contents!  This explains why there is the #include
>>> directive!  It may be my error, and I have to leave now so I can't
>>> confirm one way or the other, but my guess is that you might be sending
>>> xilemac.c to both the .c and .h files during configure.  Of course, it
>>> may be I don't know what I'm talking about...
>>>
>>> More tomorrow...
>>> -Bob
>>>
>>> gregory.menke at gsfc.nasa.gov wrote:
>>>   
>>>     
>>>       
>>>> Hi Bob,
>>>>
>>>> There is only one xilemac.h, and it should be in libchip.  
>>>>
>>>> gen405/include/bsp.h is supposed to include libchip/xilemac.h, so it can
>>>> obtain driver definitions.  I just checked the diff and it looks like I
>>>> screwed it up- I see the extra include as you say, but it does not exist
>>>> in my source.  Beats me how I messed it up, but there you go...
>>>>
>>>> With the gen405 in its present setup, I think xilemac would be better
>>>> located in the bsp than in libchip.  If/when a virtex bsp shows up, then
>>>> xilemac could be copied into libchip- leaving the current version in
>>>> gen405 sort of like how the pc386 bsp has its own network drivers.
>>>> If/when gen405 moves to new_exceptions then maybe it could abandon its
>>>> internal xilemac in favor of the libchip version.
>>>>
>>>> Given the above, I'd like to regenerate the diff with xilemac moved back
>>>> into the gen405 bsp, which makes sense given the old_exceptions and the
>>>> assumptions about the driver that the bsp makes.  I'll try to get a new
>>>> patch out in a day or so, and please accept my apologies for the broken
>>>> diffs...
>>>>
>>>> Regards,
>>>>
>>>> Greg
>>>>
>>>>
>>>>
>>>> Robert S. Grimes writes:
>>>>  > Yes,
>>>>  > 
>>>>  > It looks like $SOURCEDIR/c/src/libchip/network/xilemac.h (only xilemac.h
>>>>  > I was able to find in source tree) is not making it into
>>>>  > $BUILDIDR/powerpc-rtems/gen405/lib/include/libchip. 
>>>>  > 
>>>>  > I attempted to fix that by copying the file.  However, when I did that,
>>>>  > I got a problem about infinite include nesting; seems the file was
>>>>  > including itself?  Perhaps I am confused, but there is an include
>>>>  > directive in xilemac.h like this
>>>>  > #include <libchip/xilemac.h>
>>>>  > 
>>>>  > If I comment that out, the infinite nesting problem goes away, but is
>>>>  > replaced by these
>>>>  > 
>>>>  > In file included from ../../../../.././gen405/lib/include/bsp.h:73,
>>>>  >                  from
>>>>  > ../../../../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/old-exceptions/cpu.c:31:
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:234: error:
>>>>  > 'NUM_XILEMAC_UNITS' undeclared here (not in a function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilFifoRead32':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:270: error:
>>>>  > 'XEM_PFIFO_RXDATA_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:270: error: (Each
>>>>  > undeclared identifier is reported only once
>>>>  > ./../../../.././gen405/lib/include/libchip/xilemac.h:270: error: for
>>>>  > each function it appears in.)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilFifoWrite32':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:309: error:
>>>>  > 'XEM_PFIFO_TXREG_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:318: error:
>>>>  > 'DRIVER_PREFIX' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:327: error:
>>>>  > 'XEM_PFIFO_TXDATA_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilGetWrFifo32VacancyBytes':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:363: error:
>>>>  > 'XEM_PFIFO_TXREG_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilFifoRead64':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:385: error:
>>>>  > 'XEM_PFIFO_RXDATA_OFFSET' undeclared (first use in this function)
>>>>  > ./../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilFifoWrite64':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:440: error:
>>>>  > 'XEM_PFIFO_TXREG_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:445: error:
>>>>  > 'DRIVER_PREFIX' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:452: error:
>>>>  > 'XEM_PFIFO_TXDATA_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilGetWrFifo64VacancyBytes':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:507: error:
>>>>  > 'XEM_PFIFO_TXREG_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilGetWrFifoVacancyBytes':
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:533: error:
>>>>  > 'DRIVER_PREFIX' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h: In function
>>>>  > 'xilEmacStop':
>>>>  > ./../../../.././gen405/lib/include/libchip/xilemac.h:548: error:
>>>>  > dereferencing pointer to incomplete type
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:551: error:
>>>>  > dereferencing pointer to incomplete type
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:551: error:
>>>>  > 'XEM_ECR_OFFSET' undeclared (first use in this function)
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:555: error:
>>>>  > dereferencing pointer to incomplete type
>>>>  > ../../../../.././gen405/lib/include/libchip/xilemac.h:559: error:
>>>>  > dereferencing pointer to incomplete type
>>>>  >  
>>>>  > and so on, especially the deref pointer errors.
>>>>  > 
>>>>  > Seems something else is missing wrt the Xilinx definitions...
>>>>  > 
>>>>  > Thanks,
>>>>  > -Bob
>>>>  > 
>>>>  > gregory.menke at gsfc.nasa.gov wrote:
>>>>  > > Hi Robert,
>>>>  > >
>>>>  > > Its likely something missing from the patch since I had a strip out a
>>>>  > > lot of test things from the diff.  I'll have a look at get back to you.
>>>>  > >
>>>>  > > OTOH I continue to have problems with automake/autoconf occasionally
>>>>  > > generating makefiles that need editing because its unclear which
>>>>  > > versions work and which won't and RTEMS stays so close to the
>>>>  > > toolchain's bleeding edge that its hard to tell.  So there is some
>>>>  > > possiblity that automake/autoconf issues could be causing trouble.
>>>>  > >
>>>>  > > Greg
>>>>  > >
>>>>  > >
>>>>  > > Robert S. Grimes writes:
>>>>  > >  > Hi Greg,
>>>>  > >  > 
>>>>  > >  > I attempt to build using your patches on a clean install of 4.6.99.3,
>>>>  > >  > and I get this error:
>>>>  > >  > 
>>>>  > >  >     Making all in powerpc
>>>>  > >  >     make[5]: Entering directory
>>>>  > >  >     `/cygdrive/c/Home/ll/etill/rtems-4.6.99.3/tools/b-rtems-4.6.99.3/powerpc-rtems/c/gen405/lib/
>>>>  > >  >     libcpu/powerpc'
>>>>  > >  >     if powerpc-rtems-gcc --pipe -B../../../../.././lib/
>>>>  > >  >     -B../../../../.././gen405/lib/ -specs bsp_specs -qrtems -DPACKAGE_NA
>>>>  > >  >     ME=\"rtems-c-src-lib-libcpu-powerpc\"
>>>>  > >  >     -DPACKAGE_TARNAME=\"rtems-c-src-lib-libcpu-powerpc\"
>>>>  > >  >     -DPACKAGE_VERSION=\"4.6.99.3\
>>>>  > >  >     " -DPACKAGE_STRING=\"rtems-c-src-lib-libcpu-powerpc\ 4.6.99.3\"
>>>>  > >  >     -DPACKAGE_BUGREPORT=\"rtems-bugs at rtems.com\"  -I. -I../.
>>>>  > >  >     ./../../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc  -isystem
>>>>  > >  >     ../../../../.././gen405/lib/include -I../../../../../
>>>>  > >  >     ../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/old-exceptions  -Wall
>>>>  > >  >     -mcpu=403 -D_OLD_EXCEPTIONS -Dppc405 -O4 -fno-keep-i
>>>>  > >  >     nline-functions -g -MT
>>>>  > >  >     old-exceptions/old_exceptions_rtems_cpu_rel-cpu.o -MD -MP -MF
>>>>  > >  >     "old-exceptions/.deps/old_exception
>>>>  > >  >     s_rtems_cpu_rel-cpu.Tpo" -c -o
>>>>  > >  >     old-exceptions/old_exceptions_rtems_cpu_rel-cpu.o `test -f
>>>>  > >  >     'old-exceptions/cpu.c' || echo
>>>>  > >  >      '../../../../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/'`old-exceptions/cpu.c;
>>>>  > >  >     \
>>>>  > >  >     then mv -f
>>>>  > >  >     "old-exceptions/.deps/old_exceptions_rtems_cpu_rel-cpu.Tpo"
>>>>  > >  >     "old-exceptions/.deps/old_exceptions_rtems_cpu_re
>>>>  > >  >     l-cpu.Po"; else rm -f
>>>>  > >  >     "old-exceptions/.deps/old_exceptions_rtems_cpu_rel-cpu.Tpo"; exit 1; fi
>>>>  > >  >     In file included from
>>>>  > >  >     ../../../../../../../rtems-4.6.99.3/c/src/lib/libcpu/powerpc/old-exceptions/cpu.c:31:
>>>>  > >  >     ../../../../.././gen405/lib/include/bsp.h:73:29: error:
>>>>  > >  >     libchip/xilemac.h: No such file or directory
>>>>  > >  >     make[5]: *** [old-exceptions/old_exceptions_rtems_cpu_rel-cpu.o] Error 1
>>>>  > >  >     make[5]: Leaving directory
>>>>  > >  >     `/cygdrive/c/Home/ll/etill/rtems-4.6.99.3/tools/b-rtems-4.6.99.3/powerpc-rtems/c/gen405/lib/l
>>>>  > >  >     ibcpu/powerpc'
>>>>  > >  > 
>>>>  > >  > The "xilemac.h" file certainly does exist!  It seems there's an include
>>>>  > >  > path problem.  I'm going to try and track it down, but I thought you might:
>>>>  > >  >   - know what I did wrong (if it's my mistake), or
>>>>  > >  >   - want to know (if it's a patch problem).
>>>>  > >  > 
>>>>  > >  > I will let you know what I find on my end.
>>>>  > >  > 
>>>>  > >  > Thanks!
>>>>  > >  > -Bob
>>>>  > >  > 
>>>>  > >  > gregory.menke at gsfc.nasa.gov wrote:
>>>>  > >  > > Hi,
>>>>  > >  > >
>>>>  > >  > > I finally got back to some long-needed config management on the gen405
>>>>  > >  > > bsp.  I assembled the diffs against 4.6.99.3, the file is attached for
>>>>  > >  > > review.
>>>>  > >  > >
>>>>  > >  > > I hesitate to just check them in as some of the changes related to
>>>>  > >  > > uarts, fpu and memory map are highly idiosyncratic and I don't want to
>>>>  > >  > > mess up other people's work.  I think a compromise patch might make the
>>>>  > >  > > most sense, where I set up a diff that preserves the general character
>>>>  > >  > > of the bsp; base addresses, etc.. but gets in the updated drivers.
>>>>  > >  > >
>>>>  > >  > > Our bsp was peculiar in that the 405 units have 4 uarts and no fpu at
>>>>  > >  > > all, meaning, the entire toolchain has to be compiled with -msoft-float
>>>>  > >  > > to ensure nothing at all in newlib or above uses fp registers- the
>>>>  > >  > > va_args are problematic since the ppc ABI allows fpu registers to be
>>>>  > >  > > used when handing variable arguments.  I think it is this issue that
>>>>  > >  > > generally forces all PPC tasks to be floating point- its quite an
>>>>  > >  > > annoying architectural property.
>>>>  > >  > >
>>>>  > >  > > So I'd like to propose that folks interested in the Virtex 4 gen405 bsp
>>>>  > >  > > family have a look at the diffs and respond with issues & changes and
>>>>  > >  > > hopefully I can commit something that doesn't cause too much trouble.
>>>>  > >  > >
>>>>  > >  > > If folks' email systems won't pass the attachment, then please email me
>>>>  > >  > > and I'll resend directly.
>>>>  > >  > >
>>>>  > >  > > Thanks,
>>>>  > >  > >
>>>>  > >  > > Greg
>>>>  > >  > >
>>>>  > >  > >   
>>>>  > >  > > ------------------------------------------------------------------------
>>>>  > >  > >
>>>>  > >  > > _______________________________________________
>>>>  > >  > > rtems-users mailing list
>>>>  > >  > > rtems-users at rtems.com
>>>>  > >  > > http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>>  > >  > >   
>>>>  > >  > 
>>>>  > >
>>>>  > >
>>>>  > >   
>>>>  > 
>>>>
>>>>
>>>>   
>>>>     
>>>>       
>>>>         
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.com
>>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>>
>>>
>>>   
>>>     
>>>       
>> _______________________________________________
>> rtems-users mailing list
>> rtems-users at rtems.com
>> http://rtems.rtems.org/mailman/listinfo/rtems-users
>>
>>
>>   
>>     
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>
>
>   



More information about the users mailing list