I'm trying to develop PCI driver for a PCI Timer card for a Pentium
machine. The OS is Vxworks. DP8570A is the timer ic in the PCI card.
All registers were mapped to the PCI bus.
Since i'm new to PCI drivers in the Vxworks, i expect some help from
the group members.
The card is getting detected using pciFindDevice(). But i'm not
getting how to proceed further. I'm not seeing any PCI driver
template in the Tornado installation directory.
My doubts are
1.pciFindDevice() returns a base address as 0xCF8, what is this
address?
2.What pciDevConfig()does? Whether this function needs to be called
for each PCI device? If so, where should i call?
3.How to do memory mapping of registers in the card? What are the
function need to be called for this?
4.Is any template or example code available anywhere?
5.In my target pciHeaderShow etc were not working, what should i
enable while building the image to get these routines working in my
machine?
6.Should i use iosDrvInstall() and iosDevAdd() routines for my
purpose?
7. What are the things need to be taken care of?
I would expect all group members valuable guidance to make this
project a success.
Thanks in advance
Regards,
Santhosh
> Since i'm new to PCI drivers in the Vxworks, i expect some help from
> the group members.
I'm hoping that it is your lack of English skills that lead you to
write that sentence: Its somewhat demanding tone is very unlikely to
get you much help here.
> The card is getting detected using pciFindDevice(). But i'm not
> getting how to proceed further. I'm not seeing any PCI driver
> template in the Tornado installation directory.
Take a look in your BSP directory - there should be a number of things
(most often network adapters) that deal with PCI initialisation.
> My doubts are
> 1.pciFindDevice() returns a base address as 0xCF8, what is this
> address?
As far as I know, pciFindDevice() does not return a base address at
all. It returns a status code, and, if successful, fills in the bus
number, device number and function number values passed in as pointers
to integers.
Unfortunately, it is possible that the version of VxWorks you are
using does something different, so please be more explicit about what
you are doing in future (e.g. include the line of code *exactly* as
you had it written in the source file, and state what all the values
you passed to it were).
> 2.What pciDevConfig()does? Whether this function needs to be called
> for each PCI device? If so, where should i call?
Configures a PCI device:
For most PC type systems the BIOS will already have done this and you
won't need to use this function at all.
> 3.How to do memory mapping of registers in the card? What are the
> function need to be called for this?
Search the group for sysMmuMapAdd() which is the function used in x86
systems to add the address ranges allocated by the BIOS to the OS'
memory map.
> 4.Is any template or example code available anywhere?
Take a driver writer's course, or buy the source for a driver from
Wind River (or someone else). Most of the PCI stuff is elementary
though - getting a good book about PCI would probably be a good start.
If your driver is going to be used on other platforms, then you will
need to think a bit more about the configuration (usually done in the
BSP as it is somewhat board specific).
> 5.In my target pciHeaderShow etc were not working, what should i
> enable while building the image to get these routines working in my
> machine?
Reports that include 'not working' are never useful. What do you mean
by not working? Are they even included in your kernel configuration?
Did they display any error messages? How were you using them (i.e. did
you even pass them the correct parameters)?
> 6.Should i use iosDrvInstall() and iosDevAdd() routines for my
> purpose?
Maybe. Depends on what your 'purpose' is. Again, I suggest that you
sign up for a VxWorks training course (esp. one that includes driver
writing specifics, though I suspect that you might also benefit from a
basic VxWorks course first.
> 7. What are the things need to be taken care of?
a) You need to read the VxWorks Programmer's Guide and really
understand it
b) You need to get some books about PCI
c) You should ask about getting some professional training
d) If all else fails, look into hiring an experience consultant to
develop the driver for you (probably in just a few days, depending on
what the device is).
> I would expect all group members valuable guidance to make this
> project a success.
Once again, I'm going to give you the benefit of the doubt here and
assume that it is your English that lead you to include that sentence.
As with the one earlier in the posting, its tone is not appropriate
for a forum where people volunteer their advice free of charge. We do
not owe you anything, nor do we have any direct interest in the
success of your project. This is a community where people help each
other to learn and find solutions to specific problems.
HTH,
John...
=====
Contribute to the VxWorks Cookbook at: http://books.bluedonkey.org/
Hi,
Thanks John for the help and advice.
I solved myself the problems related to pciFindDevice. I'm trying
myself to convert the whole driver as a IO device so that the user can
call using IO functions like read write ioctl open and close. So i
assume that iosDrvInstall() and iosDevAdd() need to be called.
The problem related to the pciHeaderShow() also solved, The files
related to those functions were missing in its path.
Sorry for the demanding tone as u felt, it was not intentional. I
will try myself to improve my English skills too.
Thanks a lot for the patience u showed to answer my queries.
Regards,
Santhosh