Help with new Solaris 7 Device Driver needed

Help with new Solaris 7 Device Driver needed

Post by Stuart Swale » Sun, 29 Aug 1999 04:00:00



Hi

I'm trying to write a device driver on Solaris 7 (x86 at the moment) for
a PCI-based board that we've designed (using the PLX 9080 PCI bridge).

The board is seen by the Device Configuration Assistant floppy and
subsequently appears under the pci branch as pci10b5,1191 in 'prtconf'.

Sun's 'Writing Device Driver' book and the relevant man pages all seem
to imply that since PCI devices are auto-identifying, no configuration
file is necessary, but I simply can't see how the OS can perform the
required binding between my driver module and the installed device.

Can anybody help shed some light on this as I'm flummoxed!?

TIA
--
Stuart Swales

(Remove the nospam. when replying)

 
 
 

Help with new Solaris 7 Device Driver needed

Post by Bruce Adle » Sun, 29 Aug 1999 04:00:00



Quote:> I'm trying to write a device driver on Solaris 7 (x86 at the moment) for
> a PCI-based board that we've designed (using the PLX 9080 PCI bridge).

> The board is seen by the Device Configuration Assistant floppy and
> subsequently appears under the pci branch as pci10b5,1191 in 'prtconf'.

First you have to make certain your board uses a unique ID. Unless PLX
has expressly assigned device ID 1191 to you personally, your board can
potentially conflict with someone else's since vendor ID 10b5 doesn't
belong to you. You should get your own vendor ID and program that into
the 9080 chip's Subsystem ID and Subsystem Device ID registers (i.e.,
leave the chip's own ID registers set to their original values: 10b5,9080).

Quote:> Sun's 'Writing Device Driver' book and the relevant man pages all seem
> to imply that since PCI devices are auto-identifying, no configuration
> file is necessary, but I simply can't see how the OS can perform the
> required binding between my driver module and the installed device.

There are at least three different ways this can happen.

First, and simplest, is to just name your driver based on the Subsystem ID
and Subsystem Device ID your device uses. For example, if you gave your
board the subsys ID 'pci5000,1111' then that's what you name your driver.

Or, if you give your driver some random name, like foobar, then you could
use the "add_drv" command to create a driver_aliases entry for your device
(something like "add_drv -i 'pci5000,1111' ... foobar"). That's what's
usually done for non-PCI non-FCode self-identifying devices.

Or, lastly, you can name your driver 'foobar', and then add an entry to
the DCA devicedb/master file to tell it that the device 'pci5000,1111'
is compatible with the driver 'foobar'. The entry in the 'master'
file causes the appropriate 'compatible' property to be added to the
device's devinfo tree node. The kernel uses the compatible property,
if present, to determine what driver(s) to try to bind to the device.
Use the prtconf -pv command to see the property's value.

 
 
 

Help with new Solaris 7 Device Driver needed

Post by Stuart Swale » Tue, 31 Aug 1999 04:00:00






>> I'm trying to write a device driver on Solaris 7 (x86 at the moment) for
>> a PCI-based board that we've designed (using the PLX 9080 PCI bridge).

>> The board is seen by the Device Configuration Assistant floppy and
>> subsequently appears under the pci branch as pci10b5,1191 in 'prtconf'.

>First you have to make certain your board uses a unique ID. Unless PLX
>has expressly assigned device ID 1191 to you personally, your board can
>potentially conflict with someone else's since vendor ID 10b5 doesn't
>belong to you. You should get your own vendor ID and program that into
>the 9080 chip's Subsystem ID and Subsystem Device ID registers (i.e.,
>leave the chip's own ID registers set to their original values: 10b5,9080).

Yes, this is a PLX allocated device ID. We have had this board working
for some time on NT, now we need to do Solaris x86 and Sparc versions.

Quote:

>> Sun's 'Writing Device Driver' book and the relevant man pages all seem
>> to imply that since PCI devices are auto-identifying, no configuration
>> file is necessary, but I simply can't see how the OS can perform the
>> required binding between my driver module and the installed device.

>There are at least three different ways this can happen.

>First, and simplest, is to just name your driver based on the Subsystem ID
>and Subsystem Device ID your device uses. For example, if you gave your
>board the subsys ID 'pci5000,1111' then that's what you name your driver.

I hadn't worked out that it was so easy! Mind you, none of the device
drivers on my system seem to be named this way...

Quote:>Or, if you give your driver some random name, like foobar, then you could
>use the "add_drv" command to create a driver_aliases entry for your device
>(something like "add_drv -i 'pci5000,1111' ... foobar"). That's what's
>usually done for non-PCI non-FCode self-identifying devices.

This is the route I took. I've made quite a bit of progress with the
driver today having now managed to get the driver attached to its
device! I found that you had to enclose the alias in double quotes as
well to keep the entry that add_drv makes in /etc/driver_aliases happy.

Quote:>Or, lastly, you can name your driver 'foobar', and then add an entry to
>the DCA devicedb/master file to tell it that the device 'pci5000,1111'
>is compatible with the driver 'foobar'. The entry in the 'master'
>file causes the appropriate 'compatible' property to be added to the
>device's devinfo tree node. The kernel uses the compatible property,
>if present, to determine what driver(s) to try to bind to the device.
>Use the prtconf -pv command to see the property's value.

I'll probably get round to doing it this way too.

Thanks for your help on this!

--
Stuart Swales

(Remove the nospam. when replying)

 
 
 

1. HELP needed: Solaris PCI device driver, device not auto detected.

I am writing a device driver for two PCI adapter cards under Solaris 2.5.1
on x86 machines. The two PCI adapter cards are identical except that one
uses PLX 9060 chip and the other one uses PLX 9050 chip. When both cards
are present in the machine, the probe and attach routines of my driver are
invoked only for the card with 9060 chip. I used the following command to
install the driver:
   add_drv -i'"pci1248,4" "pci1248,204"' cdp
Our vendor ID is 0x1248, and device ID for these two cards is 0x04 and 0x204,
respectively, and "cdp" is the name of the driver. (No conf file is used.)

Did anyone have any clue why the card with 9050 chip is not auto detected?

I also tried to use the following conf file instead of letting the cards
be auto detected.
  name="cdp" parent="pci" reg=0x7800,0,0,0,0;
  name="cdp" parent="pci" reg=0x8000,0,0,0,0;
  ....
  ....
This way, it did find both cards, but ddi_regs_map_setup() failed for both
cards when I tried to map the local configuration registers.

Any information or suggestion is highly appreciated. Thanks in advance.

-zhong

2. apache solaris "mmap: bad file number"

3. New device device driver development tool for Solaris.

4. sysfs: Initialization order and system devices

5. dosemu boot error !

6. Adding a new device driver, need help

7. Hauppauge WinTV card question

8. Help needed on testing device drivers in solaris

9. need help accessing device i/o memory from device driver

10. New Sample Solaris 2 Device Drivers

11. Need Solaris device driver expert for short project

12. Need a MO platter device driver for Solaris 7.0