Autoconfiguration is the process that determines what hardware actually exists during the current instance of the running kernel. Writing Device Drivers: Tutorial discusses the events that occur during device autoconfiguration and uses the TURBOchannel bus as an example. This chapter describes device configuration on the EISA bus, including the following topics:
Figure 6-1 shows that at least three different types of people are involved in delivering an EISA bus product:
The manufacturer of the EISA bus expansion board supplies the board and its configuration requirements in a configuration file. An EISA bus expansion board does not provide for onboard configuration space. An expansion board configuration file provides information on the resources and register values required to program the EISA bus expansion board. Some of the resources supplied in this file are the board ID, manufacturer of the board, the interrupt line, DMA channel, and board memory.
Do not confuse the expansion board configuration file with the Digital UNIX system configuration file, which is an ASCII text file that defines the hardware and software components of the system. Expansion board configuration files, unlike system configuration files, have CFG extensions.
The manufacturer distributes the expansion board configuration file on a diskette.
A system vendor builds the CPU on which the EISA bus connects. For example, as a system vendor Digital builds the Alpha CPUs and implements the software that allows an EISA bus device to connect to the CPU. The system vendor supplies the EISA Configuration Utility (ECU) and device configuration file for its system.
A device configuration file provides information on the resources required to program the EISA bus device. Some of the resources supplied in this file are DMA channel, interrupt channel, and memory space information. Do not confuse the device configuration file with the Digital UNIX system configuration file, which is an ASCII text file that defines the hardware and software components of the system. Device configuration files, unlike system configuration files, have CFG extensions.
The ECU reads the expansion board and device configuration files and, for each option in the system, generates a conflict-free configuration. The ECU runs on top of the firmware, not the operating system.
After generating a conflict-free configuration, the ECU writes it to nonvolatile random-access memory (NVRAM) for future use by the firmware and Digital UNIX.
A customer purchases the EISA expansion board from the board manufacturer, the CPU from a system vendor like Digital, and the associated peripheral devices from a system vendor like Digital. The system vendor might also provide the device driver for the peripheral device. The customer loads the diskette containing the expansion board configuration file, device configuration file, and ECU, then runs the ECU.
The ECU powers up the CPU, and the firmware compares the options present on the system with the configuration information stored in NVRAM. If the information does not match, the powerup is discontinued, and the user is instructed to run the ECU. If the information matches, the powerup continues. The firmware uses the configuration information in NVRAM to configure and initialize each option on the system. After initializing an option, the firmware enables the option through the EISA bus control register.
A customer must run the ECU any time a new EISA expansion board is added to the system.
The following tasks are associated with device autoconfiguration for EISA bus devices:
The EISA expansion board manufacturer creates an expansion board configuration file that contains such resources as the board ID, manufacturer identification, the interrupt line, DMA channel, and board memory. Chapter 9 describes how to write a configuration file. The board manufacturer copies the expansion board configuration file to a diskette.
The system vendor creates a device configuration file that contains such device resources as the DMA channel, interrupt channel, and memory space. Chapter 9 describes how to write a configuration file. The system vendor copies the configuration file to a diskette (either the diskette that contains the expansion board configuration file or a separate diskette).
The system vendor also supplies the ECU. The Extended Industry Standard Architecture Revision 3.10 specification provides guidelines on how to write the ECU.
The customer runs the EISA Configuration Utility (ECU) whenever the configuration changes. The ECU reads the board configuration file and device configuration file for each device in the system and assigns resources based on the information in the device configuration file. The ECU resolves any conflicts and saves the configuration information in nonvolatile random-access memory (NVRAM).
When the customer boots the CPU, the EISA bus configuration code reads the configuration information from NVRAM and does the following for each device in the configuration:
In summary, for the EISA bus configuration code to call the driver's xxprobe interface, the following must occur:
You support ISA bus devices in the same manner as EISA bus devices. With few exceptions, there is no distinction between an EISA bus device and an ISA bus device. Like EISA bus devices, ISA bus devices require a device configuration file. However, because the ECU cannot detect the presence of an ISA card, you must manually inform the ECU of the card's presence and point it to the correct device configuration file. To accomplish this, use the following steps:
For ISA bus devices, specify the 3-character manufacturer code as ISA. Choose the 3-character hexadecimal product identifier carefully to avoid conflict with other ISA bus devices. The following is an example device ID:
ISA5001
The device ID is used in the EISA device configuration file and in the /etc/sysconfigtab entry.
The ECU uses the ID to generate the device configuration file name. It places an exclamation point (!) before the ID name and appends a file extension of .CFG. If it cannot find a file with that name, it replaces the exclamation point with the letter a and tries again. If it still cannot find the file, it prompts the user to insert a diskette with the file on it.
You can use the !ISA0000.CFG generic file along with other !ISAxxx.CFG and !EISAxxx.CFG files provided on the EISA system configuration diskette as examples when creating your EISA device configuration file.
Do not install the board before running the ECU.
The ISA bus support code relies on data stored by the console's isacfg utility command for configuration information. You enter the device's resource requirements along with a handle through the isacfg command. The handle is the key to matching the resource information to the driver. The handle can be a maximum of 15 characters.