vme driver for pc386

Till Straumann strauman at slac.stanford.edu
Wed Jun 17 20:48:44 UTC 2009


lee wrote:
> hi Till...
>
>
> Same problem... just if im unclear of why I previously cut/paste the
> directories was to try and solve this problem.
>
> Same errors.... now its the pci.h..
>
> ./pc386/lib/include  -Wall -Wimplicit-function-declaration
> -Wstrict-prototypes -Wnested-externs -ansi -fasm -mtune=i386 -O2 -g -MT
> vmeUniverse.o -MD -MP -MF .deps/vmeUniverse.Tpo -c -o vmeUniverse.o
> `test -f '../../shared/vmeUniverse/vmeUniverse.c' || echo
> '/opt/rtems/c/src/lib/libbsp/i386/pc386/'`../../shared/vmeUniverse/vmeUniverse.c
> /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.c:107:21: error: bsp/pci.h: No such file or directory
>   
Oops - my bad. I forgot to mention that I also had to patch vmeUniverse.c,
sorry. The relevant routines are nowadays exported by <rtems/pci.h>:

Index: c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c
===================================================================
RCS file: 
/usr1/CVS/rtems/c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c,v
retrieving revision 1.23
diff -c -r1.23 vmeUniverse.c
*** c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c    22 May 2008 
23:17:58 -0000    1.23
--- c/src/lib/libbsp/shared/vmeUniverse/vmeUniverse.c    17 Jun 2009 
20:46:59 -0000
***************
*** 104,110 ****
  #include <stdlib.h>
  #include <rtems/bspIo.h>    /* printk */
  #include <rtems/error.h>
! #include <bsp/pci.h>
  #include <bsp.h>
  #include <libcpu/byteorder.h>
 
--- 104,110 ----
  #include <stdlib.h>
  #include <rtems/bspIo.h>    /* printk */
  #include <rtems/error.h>
! #include <rtems/pci.h>
  #include <bsp.h>
  #include <libcpu/byteorder.h>
 
HTH
-- Till
> /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.c:224:2: warning: #warning "SYNC instruction unknown for this architecture"
> /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.c: In function 'vmeUniverseFindPciBase':
>
>
> 1.) busy with new download of cvs again...
> 2.) I see in the makefile.am you send that mine is a bit newer, could
> this be the problem?
>
> Lee :)
>
>
> On Wed, 2009-06-17 at 14:37 -0500, Till Straumann wrote:
>   
>> lee wrote:
>>     
>>> Hey Till...
>>>
>>> I still get that same error. After doing your changes. I've attached my
>>> Makefile.am from the bsp i want to use which is pc386.
>>>
>>> In file included
>>> from /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.c:59:
>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.h:59:29: error: bsp/vme_am_defs.h: No such file or directory
>>>
>>> In file included
>>> from /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.c:60:
>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverseDMA.h:49:29: error: bsp/vmeUniverse.h: No such file or directory
>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/../../shared/vmeUniverse/vmeUniverse.c:107:21: error: bsp/pci.h: No such file or directory
>>>
>>> i've done bootstrap -p and also did what you said about : " ampolish3
>>> Makefile.am > preintall.am" 
>>>       
>> I wasn't aware of the bootstrap '-p' option. Seems that this
>> takes care of 'ampolish3' so you don't have to execute that
>> manually.
>>
>> The steps should therefore be:
>>
>> bootstrap -p
>> bootstrap
>> <remove and recreate your build directory>
>> configure
>> build
>>
>> Please try this and let me know if you still have problems.
>>
>> HTH
>> -- Till
>>     
>>> I still get that same error
>>>
>>> Lee
>>>
>>>
>>> On Mon, 2009-06-15 at 11:22 -0500, Till Straumann wrote:
>>>       
>>>> lee wrote:
>>>>         
>>>>> Hi Till
>>>>>
>>>>> I have a few questions regarding the powerpc vmeUniverse driver.
>>>>> Im busy, after a couple of months on another project, to again try and
>>>>> port the vmeUniverse driver from powerpc to i386/pc386. 
>>>>>
>>>>> What i've done so far was to copy the relevant directories and vmeconfig
>>>>> files to the directory.
>>>>>           
>>>> That's almost certainly a bad idea. You never want to copy/paste
>>>> stuff that can be shared among different BSPs. Instead, let
>>>> your Makefile just pull in the sources from another BSP.
>>>> Ideally, such shared pieces (involves most of the things under
>>>> libbsp/powerpc/shared/vme) should eventually go into a separate library
>>>> to be used by different BSPs.
>>>>         
>>>>> . The readme file is a bit difficult to follow for
>>>>> me, because it assumes familiarity with rtems at a level of which im not
>>>>> at the moment.
>>>>>
>>>>> I would like to at least get it compiled into pc386, whether it works or
>>>>> not, then continue implementing the driver for my needs. That is
>>>>> actually the part that I would do quickly :P.
>>>>>           
>>>> I got to compile everything in < 15min. All I had to do was
>>>> modify the pc386 BSP's Makefile.am and add a BSP specific
>>>> VMEConfig.h:
>>>>
>>>> 1) Modify Makefile.am:
>>>>
>>>> Index: Makefile.am
>>>> ===================================================================
>>>> RCS file: /usr1/CVS/rtems/c/src/lib/libbsp/i386/pc386/Makefile.am,v
>>>> retrieving revision 1.41.2.1
>>>> diff -c -r1.41.2.1 Makefile.am
>>>> *** Makefile.am    24 Sep 2008 07:32:19 -0000    1.41.2.1
>>>> --- Makefile.am    15 Jun 2009 16:11:41 -0000
>>>> ***************
>>>> *** 89,94 ****
>>>> --- 89,108 ----
>>>>  
>>>>   ide_SOURCES = ide/idecfg.c ide/ide.c
>>>>  
>>>> +
>>>> + include_bsp_HEADERS += ../../shared/vmeUniverse/vmeUniverse.h \
>>>> +     ../../shared/vmeUniverse/vme_am_defs.h \
>>>> +     ../../shared/vmeUniverse/VME.h \
>>>> +     include/VMEConfig.h \
>>>> +     ../../shared/vmeUniverse/vmeUniverseDMA.h\
>>>> +     ../../shared/vmeUniverse/bspVmeDmaList.h\
>>>> +     ../../shared/vmeUniverse/VMEDMA.h
>>>> + vme_SOURCES = ../../shared/vmeUniverse/vmeUniverse.c \
>>>> +     ../../shared/vmeUniverse/bspVmeDmaList.c \
>>>> +     ../../powerpc/shared/vme/vmeconfig.c \
>>>> +     ../../powerpc/shared/vme/vme_universe.c
>>>> +
>>>> +
>>>>   if HAS_NETWORKING
>>>>   ne2000_CPPFLAGS = -D__INSIDE_RTEMS_BSD_TCPIP_STACK__
>>>>   noinst_PROGRAMS += ne2000.rel
>>>> ***************
>>>> *** 120,126 ****
>>>>   noinst_LIBRARIES = libbsp.a
>>>>   libbsp_a_SOURCES = $(clock_SOURCES) $(console_SOURCES) $(gdb_SOURCES) \
>>>>       $(gnat_SOURCES) $(pci_SOURCES) $(startup_SOURCES) $(timer_SOURCES) \
>>>> !     $(ide_SOURCES)
>>>>  
>>>>   libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel \
>>>>       ../../../libcpu/@RTEMS_CPU@/page.rel \
>>>> --- 134,140 ----
>>>>   noinst_LIBRARIES = libbsp.a
>>>>   libbsp_a_SOURCES = $(clock_SOURCES) $(console_SOURCES) $(gdb_SOURCES) \
>>>>       $(gnat_SOURCES) $(pci_SOURCES) $(startup_SOURCES) $(timer_SOURCES) \
>>>> !     $(ide_SOURCES) $(vme_SOURCES)
>>>>  
>>>>   libbsp_a_LIBADD = ../../../libcpu/@RTEMS_CPU@/cache.rel \
>>>>       ../../../libcpu/@RTEMS_CPU@/page.rel \
>>>>
>>>> 2) Add new VMEConfig.h  ***NOTE*** the actual values I defined there
>>>>    are ***BOGUS*** -- they are specific to a particular board and you
>>>>    should revise them. I have no pc386 hardware with VME available.
>>>>    ( I attached a template that I put into libbsp/i386/pc386/include )
>>>>
>>>> 3) run ampolish3 to update 'preinstall.am'
>>>>
>>>>      ampolish3 Makefile.am > preintall.am
>>>>
>>>> 4) (unless you configured your rtems with --enable-maintainer-mode)
>>>>    re-run 'bootstrap', configure RTEMS and build.
>>>>
>>>>
>>>> HTH
>>>> -- Till
>>>>         
>>>>> I need to get midas ported onto rtems before end of july. so u can see
>>>>> my rush for this... :P 
>>>>>
>>>>> at the moment I get these compile errors: 
>>>>>
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:27:23: error:
>>>>> libcpu/io.h: No such file or directory
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:31:21: error:
>>>>> bsp/pci.h: No such file or directory
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:32:23: error:
>>>>> bsp/gtreg.h: No such file or directory
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:33:27: error:
>>>>> bsp/gtpcireg.h: No such file or directory
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:68: error: expected
>>>>> '=', ',', ';', 'asm' or '__attribute__' before
>>>>> 'BSP_sysControllerVersion'
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:69: error: expected
>>>>> '=', ',', ';', 'asm' or '__attribute__' before 'BSP_VMEinterface'
>>>>> /opt/rtems/c/src/lib/libbsp/i386/pc386/pci/pci.c:70: error: expected
>>>>> '=', ',', ';', 'asm' or '__attribute__'
>>>>>
>>>>> I figure that bsp dir is something that is created at configure time.
>>>>> I've set i386/Makefile.am and pc386/Makefile.am as follows:
>>>>>
>>>>> [pc386/Makefile.am ]
>>>>>
>>>>> include_HEADERS += ../../i386/shared/pci/pcibios.h pci/pci.h \
>>>>> 	pci/gtpcireg.h
>>>>> # pci
>>>>> libbsp_a_SOURCES += ../../i386/shared/pci/pcibios.c \
>>>>>     ../../i386/shared/pci/pcibios.h pci/pci.c \
>>>>>     pci/pcifinddevice.c
>>>>>
>>>>>
>>>>> [i386/Makefile.am]# shared/pci
>>>>> EXTRA_DIST += shared/pci/pcibios.h
>>>>> EXTRA_DIST += shared/pci/pcibios.c
>>>>> EXTRA_DIST += shared/pci/pci.c shared/pci/pcifinddevice.c \
>>>>> 	shared/pci/generic_clear_hberrs.c 
>>>>>
>>>>>
>>>>>
>>>>> Now for the questions :P
>>>>>
>>>>> Are these the only things in the Makefile that I have to set. When I set
>>>>> them I do a bootstrap, configure and make RTEMS_BSP etc.
>>>>>
>>>>> Also,these are just my pci problems. 
>>>>>
>>>>> Kind Regards
>>>>> Lee
>>>>>
>>>>>
>>>>>           
>
>   




More information about the users mailing list