SGI: Development

IRIX PCI Driver Example

Does anyone on Nekochan have experience or code that uses pciio_pio_read() functions to read/write PCI register values for a device driver? Probably a long shot but if there is noone around here with the info then I don't know where else to ask.

I've been looking through the SGI Device Driver docs and the examples they give just don't make sense to me at the moment.
DevDriver Chapter21

So far I can dump the contents of the Configuration space, to get the Vendor and Device ID which is cool.
But now I need to read/write values to the registers on a device and I'm rather lost on how exactly to do that.

I'm working from a modified copy of the Example PCI Driver given in the documentation.

So anyone with some solid info on this please share.
Many thanks :D
Apple Unibody MBP 2.66Ghz, 8Gb OSX 10.6
Apple MacMini 1.83Ghz, 1Gb OSX 10.5
Apple Power Mac Cube 450Mhz, 256Mb, OSX 10.3 Sweet!
Sun Ultra10 440Mhz 1Gb, SunOS 5.10

http://gothmog.homeunix.net/blog
SupremeCmdr wrote: Does anyone on Nekochan have experience or code that uses pciio_pio_read() functions to read/write PCI register values for a device driver? Probably a long shot but if there is noone around here with the info then I don't know where else to ask.

I've been looking through the SGI Device Driver docs and the examples they give just don't make sense to me at the moment.
DevDriver Chapter21

So far I can dump the contents of the Configuration space, to get the Vendor and Device ID which is cool.
But now I need to read/write values to the registers on a device and I'm rather lost on how exactly to do that.

I'm working from a modified copy of the Example PCI Driver given in the documentation.

So anyone with some solid info on this please share.
Many thanks :D


Go back toward the very beginning of the document, in the first few chapters there is alot about memory.
I have a ream of paper about 1000 pages of code.. PCI vt6212..
Look at the Linux/MIPS code for the same driver, lots of ideas will come from it...

Some thaughts about when writing driver on any platform, be it NT, Solaris, HPUX, Tru64, AIX or IRIX....
Build very simple drivers first and then build larger and larger and more complex drivers as your experience and confidence grows and keep banging your head against it.. Be relentless... driver code doesn't normally come easy..

Drop by sometime..

Regan
:Onyx2R: :Onyx2R: :0300: :0300: :0300: :O200: :Octane: :Octane: :O2: :O2: :Indigo2IMP: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x SUN, 2 x Mac, 3 x Alpha, 2 x RS/6000
Thanks Regan :D

I've been banging my head against it for a while so I should probably leave it and come back to it tomorrow with fresh eyes.
On the upside I know heaps more about IRIX and device drivers than I did before.
Apple Unibody MBP 2.66Ghz, 8Gb OSX 10.6
Apple MacMini 1.83Ghz, 1Gb OSX 10.5
Apple Power Mac Cube 450Mhz, 256Mb, OSX 10.3 Sweet!
Sun Ultra10 440Mhz 1Gb, SunOS 5.10

http://gothmog.homeunix.net/blog
I never tackled a kernel driver, but we had success writing a user space PCI driver for a National Instrumential I/O board. We used the pciba interface to open and mmap the device. There were some big-endian issues to sort out, but after that it was all about just learning the register layout of the particular device.

When I get back to the office next week, I'll see if I can't post the driver somewhere.
That would be brilliant if you could post that squeen or at least certain snippets of the code.

I've had a look at the pciba stuff but for my purposes at the moment this stuff has to be in-kernel.

Look forward to reading your code.
Apple Unibody MBP 2.66Ghz, 8Gb OSX 10.6
Apple MacMini 1.83Ghz, 1Gb OSX 10.5
Apple Power Mac Cube 450Mhz, 256Mb, OSX 10.3 Sweet!
Sun Ultra10 440Mhz 1Gb, SunOS 5.10

http://gothmog.homeunix.net/blog
pm replied.
:Onyx2R: :Onyx2R: :0300: :0300: :0300: :O200: :Octane: :Octane: :O2: :O2: :Indigo2IMP: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x SUN, 2 x Mac, 3 x Alpha, 2 x RS/6000
Does anyone know where I can get a copy of the Developer's Toolkit CD-ROM?
Apparently there is another example of a PCI device driver for the Barco Chameleon Color Converter under toolbox/hardware/PCI/barco directory. Something that actually writes/reads from a PCI device would be nice, as the examples in the Device Driver guide aren't proving to be that helpful.

Meanwhile I have made some progress, I can now read the registers on a PCI device and place a new entry into 'hinv'. But no progress on actually writing to the device registers. I'm probably doing something stupid but at least I am making progress.



Please note I'm not asking for illegal software etc etc, and if it is please ignore my request.
Apple Unibody MBP 2.66Ghz, 8Gb OSX 10.6
Apple MacMini 1.83Ghz, 1Gb OSX 10.5
Apple Power Mac Cube 450Mhz, 256Mb, OSX 10.3 Sweet!
Sun Ultra10 440Mhz 1Gb, SunOS 5.10

http://gothmog.homeunix.net/blog
SupremeCmdr wrote: Does anyone know where I can get a copy of the Developer's Toolkit CD-ROM?
Apparently there is another example of a PCI device driver for the Barco Chameleon Color Converter under toolbox/hardware/PCI/barco directory. Something that actually writes/reads from a PCI device would be nice, as the examples in the Device Driver guide aren't proving to be that helpful.

Meanwhile I have made some progress, I can now read the registers on a PCI device and place a new entry into 'hinv'. But no progress on actually writing to the device registers. I'm probably doing something stupid but at least I am making progress.



Please note I'm not asking for illegal software etc etc, and if it is please ignore my request.


I have examples and please do not tell me you are developing with gcc.. :roll: :shock:
What do you mean by Developer's Toolkit CD-ROM? I have the MIPS Pro Compiler collection. That spans many CD-ROMs.. Or do you mean a specific device driver developer CD-ROM..?

Regan
:Onyx2R: :Onyx2R: :0300: :0300: :0300: :O200: :Octane: :Octane: :O2: :O2: :Indigo2IMP: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy: :Indy:
:hpserv: J5600, 2 x SUN, 2 x Mac, 3 x Alpha, 2 x RS/6000
regan_russell wrote: What do you mean by Developer's Toolkit CD-ROM?

Perhaps he means the old "Developer's Tool box " discs, which included example code and documentation for a range of projects. Once upon a time, Developer's Program members could subscribe (for a fee) to receive DT cds a couple of times a year, and there also was a fair amount of stuff at the old DT website , which seems lost to antiquity.

{edited for clarity}
GCC :lol:
I'm using MIPSPro 7.3, a bit old but thats all I have at the moment.

As for the CD, at the bottom of page here they mention
The Developer's Toolkit CD-ROM contains a sample PCI device driver for the Barco Chameleon Color Converter. Look in the toolbox/hardware/PCI/barco directory.

So I'm not sure if that should be Toolkit or Toolbox, I just want a copy of the code :)

The link I managed to dig up via google was this but it doesn't work no more :(
Apple Unibody MBP 2.66Ghz, 8Gb OSX 10.6
Apple MacMini 1.83Ghz, 1Gb OSX 10.5
Apple Power Mac Cube 450Mhz, 256Mb, OSX 10.3 Sweet!
Sun Ultra10 440Mhz 1Gb, SunOS 5.10

http://gothmog.homeunix.net/blog
josehill wrote: there also was a fair amount of stuff at the old DT website , which seems lost to antiquity.


Nooooooo.

After some creative use of Wayback Machine it looks like you were right.
It has the links to the code I was after but they don't have a cached version of it. :cry:

Why SGI would u take stuff like that down? :x

Please if someone has a copy of this could u share it.
Apple Unibody MBP 2.66Ghz, 8Gb OSX 10.6
Apple MacMini 1.83Ghz, 1Gb OSX 10.5
Apple Power Mac Cube 450Mhz, 256Mb, OSX 10.3 Sweet!
Sun Ultra10 440Mhz 1Gb, SunOS 5.10

http://gothmog.homeunix.net/blog
I believe that jan-jaap mentioned at some point that he archived off the Developer Toolbox site before it went down. You might want to have a chat with him.
nvukovlj wrote: I believe that jan-jaap mentioned at some point that he archived off the Developer Toolbox site before it went down.

Affirmative :)
Now this is a deep dark secret, so everybody keep it quiet :)
It turns out that when reset, the WD33C93 defaults to a SCSI ID of 0, and it was simpler to leave it that way... -- Dave Olson, in comp.sys.sgi

Currently in commercial service: Image :Onyx2: (2x) :O3x02L:
In the museum : almost every MIPS/IRIX system.
Wanted : GM1 board for Professional Series GT graphics (030-0076-003, 030-0076-004)