V6M6 Device Driver Installation

The procedures for installing device drivers under Solaris 2.x and SunOS 4.1.x are described in this document. The files for Solaris 2.x driver are in the directory, "pcisoldev". The files for the SunOS 4.1.x driver are in the "pcisundev" directory.

The following parameters are common for both systems:

Parameters defined in system configuration files:

Device name
Each board is named pciN, where N is an integer starting at zero. The actual device names for the board resources are based on this name as described in section 1.3. For Solaris 2.x installation the generic device name, CAC,pci, is also specified.

VME Address
This is the physical base address of the board as determined and configured during the hardware installation.

Interrupt Vector
This is a hexadecimal value between 0x00 and 0xFF. Most systems reserve a range of values for user-installed hardware. Each V6M6 and V9M12 board must have a unique interrupt vector. Consult the manuals for your host system to determine the range of valid values. Also review the parameters of other installed devices to determine any values that may already be in use.

Interrupt Level
This parameter determines which VME interrupt line is used by the board and the priority level at which the operating system services interrupts from the board.

The interrupt priority level can dramatically effect system performance. Lower interrupt level values correspond to higher priorities. The priority for VME9U12 and VME6U6 boards should not be set so high as to interfere with the peration of other devices such as disk drives or network interfaces. Consult the relevant sections of your system's manual to determine recommended settings.

The following parameters defined in the file, pcidrv_options.h. They are specified as C preprocessor macros and their values become hard coded in the device driver module.

VMEBREQ_SELECT
This macro specifies which of the four sets of VME bus request and grant lines is to be used by the V6M6 / V9M12 boards. Consult the manual for your host system to determine which bus request lines are recommended. Bus request 3 is commonly used, especially in systems that do not implement prioritized bus arbitration. The bus request parameter is specified in the file named pcidrv_options.h.

MASTER_ADDR_MOD
This macro specifies the address modifier used by the V6M6 / V9M12 boards when they are bus master. The default setting of 0x0D accesses the VME A32 address space.

PCIVME_DEFAULT_XLATE
This macro specifies the default address translation used by the V6M6 / V9M12 boards to convert a PCI Bus address to a VME bus address. The value is a 24-bit word containing the translation MASK in bits 0:11 and the translation BASE offset in bits 12:23. A PCI address is translated to the VME bus as:

VME_Addr[31:20] = ( PCI_Addr[31:20] & MASK ) | BASE
VME_Addr[19:2] = PCI_Addr[19:2]
VME_Addr[1:0] = 0

The address translation may be modified on a per-board basis using the PCI_VMEXLATE ioctl request.

PCIVME_DEFAULT_MODES
This macro specifies the default settings for various modes of the PCI / VME interface. Currently, four bits are significant:

Bit 0 enable PCI data parity checking when set
Bit 1 enable PCI address parity checking when set
Bit 2 enable the VME interface to accept PCI memory transactions as accesses to the VME bus
Bit 3 0 = VME Master Release-On-Request mode
1 = VME Master Release-When-Done mode

The PCI / VME interface modes may be modified on a per-board basis using the PCI_VMECONFIG ioctl request.

There are other, less important, macro parameter settings described in the pcidrv_options.h header file.

Solaris 2.x Driver Installation

The device driver and configuration files for Solaris 2.x are distributed in the $CAC/pci/pcisoldev directory. The files mentioned herein are in this directory. The installation commands should be run from within this directory.

Configuration Information

The distribution includes two configuration files which may need to be modified to describe the installation on your system. The pcidrv_vme.conf file should be used for systems in which the CPU is attached directory on the VMEbus. For Sbus systems using an Sbus-to-VME adapter from Solflower use the pcidrv_sfvme.conf file. These specify information about the V6M6 / V9M12 PCI boards to be installed in your system and contain the following entries for each board:

pcidrv_vme.conf pcidrv_sfvme.conf
name="CAC,pci" name="CAC,pci"
class="vme" parent="sfvme"
reg=0x4d,0x10200000,0x20000 reg=0x4d,0x10200000,0x20000
interrupts=3,0xD0 interrupts=3,0xD0

The items shown in boldface type are the values that are likely to require changing to match your system's configuration. All the parameters are specified on a single line for each board in the file. The order in which the lines appear determine how the device entries are numbered for each board - pci0, pci1, etc.

The second value of the "reg" field specifies the VME address for each board. This value must a) be modulo 0x20000, b) match its upper four digits with the address switch settings on the board and c) lie within the addressable A32 VME space of the host system.

The first value in the "interrupts" field specifies the interrupt level for interrupts generated from the board. The second value in the "interrupts" field specifies the board's interrupt vector.

Note: If you are updating an existing V6M6 installation the configuration information from /kernel/drv/pcidrv.conf should be copied into to appropriate configuration file before running the driver installation.

Installing the Driver

The device driver module, pcidrv, may be already compiled in the distribution using the default option settings in the file, pcidrv_options.h. However, there is no guarantee that the code was compiled for the proper platform architecture or operating system version on your system. To be sure the driver is initially rebuilt for your system, begin the installation by removing any existing compiled driver in the $CAC/pci/pcisoldev directory:

# make clean

If this installation is an update to a previously installed system, with no changes to be made to the configuration, it is only necessary to compile and install the new device driver code.

To do this run the command:

# make /kernel/drv/pcidrv

It may be necessary to specify the C compiler on your system. If so, use the command:

# make CC=compiler /kernel/drv/pcidrv

Where compiler is the name of the compiler program and any required arguments. For example:

# make CC=gcc /kernel/drv/pcidrv

For initial installations or when adding boards to the system, make appropriate changes to the appropriate configuration file. Once the appropriate configuration file has been modified the driver can be installed with the command:

# make install-vme
or
# make install-sfvme

depending on the system type (direct VME access or a Solflower Sbus-to-VME adapter). This will recompile the device driver module, if any changes have been made to the dspdrv_options.h file. It may be necessary to specify the C compiler on your system. If so, use the command:

# make CC=compiler install-vme
or
# make CC=compiler install-sfvme

Where compiler is the name of the compiler program and any required arguments.

The compiled driver module, pcidrv, and appropriate configuration file will be copied to the /kernel/drv directory. The configuration file will be named pcidrv.conf in the /kernel/drv directory.

The "make" command will update the file, /etc/devlinks.tab then attempt to add the driver to the system. This final action may fail if a previous V6M6/V9M12 driver is already installed. If the installation was performed only to update the driver module the errors can be ignored. However the new driver will not be installed until the system is rebooted.

Once the driver is installed and operational (possibly requiring system reboot) test the system by running the command:

# pciinit -rZ pci0

The names of additional boards may be appended to the command line to test other V6M6 / V9M12 boards in the system. Or all of the boards may be initialized with one command:

# pciinit -rZ all

The pciinit program must be run whenever the system is rebooted. Once the system has been tested it can be configured to automatically initialize the boards as part of the system boot process. Edit the file, pciinit.sh, replacing the directory name, "/usr/cac" with the name of the installation directory you have chosen. This name appears in three places near the end of the file. Then run the following command to install the file in the system's start-up directory.

# make install-rc



SunOS 4.1.x Driver Installation

With SunOS 4.1.x (Solaris 1.x) the V6M6 / V9M12 device drivers must be compiled in to the kernel. The basic instructions described here should be sufficient for veteran kernel builders. If you have never rebuilt the kernel before please refer to the Sun Microsystems System Administration Manual for information on building new kernels. If a SPARCstation 2 and Solflower Sbus to VME adapter is used, consult the Solflower documentation for additional kernel configuration information.

Note: Be sure to save a copy of the existing kernel, /vmunix, in case a problem arises with the new kernel.

The device driver installation procedure is listed below. If you are installing the V6M6 /V9M12 device driver for the first time, begin with step 1. When updating the device driver or adding new boards to the configuration, skip to step 5.

1. Create a symbolic link to the pcisundev directory in the Kernel system directory:

# cd /usr/kvm/sys
# ln -s $CAC/pci/pcisundev pcidev

This creates a symbolic link to the PCI driver source code in the location searched by kernel build procedure. Future driver code updates will automatically be picked up by this link.

2. Edit the system device table C source file, conf.c, to include entry points for the driver.

# vi /usr/kvm/sys/sun/conf.c

The file, $CAC/pci/pcisundev/pci_conf.c, contains the two sections of code to be added to conf.c. The first section is declarations and macros starting with #include <pci.h>. These 13 lines should be added just before the declaration of the cdevsw array. The second section is five lines to be added to the end of the cdevsw array. Take note of the index associated with the new element - this is the major device number associated with the V6M6 / V9M12 boards. Modify the comment in the code, replacing "Maj Dev Num" with the index number for reference.

It is only necessary to add one entry to the "cdevsw" array. All of the boards (up to 14 per system) use the same major device number.

3. Change to the machine specific configuration directory.

# cd ../<arch>/conf

where <arch> is the directory specific to machine kernel architecture (and can be determined using the "arch" command).

4. Edit the file named files adding the following line at the end of the file to specify location of the device driver source software:

       pcidev/pcidrv.c optional pci device-driver

5. In the machine specific configuration directory, edit the site specific configuration file for your system. If you do not already have a kernel configuration file specific to your system:

# cp GENERIC <sys_name>

where <sys_name> is your system's kernel name.

Edit the configuration file:

# vi <sys_name>

For each V6M6 / V9M12 board installed in the system, add lines at the end of the configuration file in the following format:

      device pci0 at vme32d32 ? csr 0x10200000
            priority 3 vector pciintr 0xD0

The items shown in boldface type are the values that are likely to require changing to match your system's configuration. The number of the pci device will increment for each device line added. The value following "csr" specifies the VME address for each board. This value must a) be modulo 0x20000, b) match its upper four digits with the address switch settings on the board and c) lie within the addressable A32 VME space of the host system. The value following "priority" specifies the interrupt level for interrupts generated from the board. The value following "vector pciintr" specifies the board's interrupt vector.

Example configuration entries can be found in the file: $CAC/pci/pcisundev/pci_config_file

6. Run the system configuration program for the new or modified configuration file. For native VME systems:

# /etc/config <sys_name>\

For Solflower Sbus to VME adapter systems:

# sfconfig <sys_name>

7. Build a new kernel using the new configuration information.

# cd ../<sys_name>
# make

This will compile all the necessary system files, including the V6M6 / V9M12 device driver code (pcidrv.c) and create a new vmunix file in the current directory.

8. Install the new kernel.

# mv /vmunix /vmunix.old (to backup old kernel)
# mv vmunix /vmunix (to copy new kernel)

9. Create device node entries for the V6M6 / V9M12 boards.

# cd $CAC/pci/pcisundev
# makepcidev <major num> <num boards>

Replace <major num> with the major device number determined in step 2. If unsure, view the file, /usr/kvm/sys/sun/conf.c, and determine the index of the pci entry point structure in the "devsw" array. Replace <num boards> with the number of boards installed.

The makepcidev program will remove any existing pci entries in the /dev directory and recreate them using the major device number and number of boards specified.

10. Reboot the system to bring up the new kernel:

# /etc/fastboot

11. Test the system by running the command:

# pciinit -rZ pci0

The names of additional boards may be appended to the command line to test other V6M6 / V9M12 boards in the system. Or all of the boards may be initialized with one command:

# pciinit -rZ all

12. Edit the system start-up script:

The pciinit program must be run whenever the system is rebooted. Once the system has been tested it can be configured to automatically initialize the boards as part of the system boot process. Edit the file, /etc/rc.local, and add the following line:

/usr/cac/bin/pciinit -rZ -d /usr/cac all

Note that nvironment variables are not active in the start up script. The -d option tells pciinit where to look for the memory and processor initializer code that is run on the processor modules. Replace /usr/cac with the absolute pathname associated with the environment variable CAC defined during the installation.