beautypg.com

Intel Extensible Firmware Interface User Manual

Page 470

background image

Extensible Firmware Interface Specification

12-52

12/01/02

Version 1.10

A PCI Bus Driver must perform several steps to manage a PCI Host Bus Controller, as follows:
• Initialize the PCI Host Bus Controller.
• If the PCI buses have not been initialized by a previous agent, perform PCI Enumeration on all

the PCI Root Bridges that the PCI Host Bus Controller contains. This involves assigning a PCI
bus number, allocating PCI I/O resources, PCI Memory resources, and PCI Prefetchable
Memory resources.

• Discover all the PCI Controllers on all the PCI Root Bridges. If a PCI Controller is a PCI to

PCI Bridge, then the I/O, Memory, and Bus Master bits in the Control register of the PCI
Configuration Header should be placed in the enabled state. The PCI Bus Driver should not
modify the contents of the Control register for any other PCI Controllers. It is a PCI Device
Driver’s responsibility to enable the I/O, Memory, and Bus Master bits of the Control register
as required with a call to the

Attributes()

service when the PCI Device Driver is started.

A similar call to the

Attributes()

service should be made when the PCI Device Driver is

stopped to disable the I/O, Memory, and Bus Master bits of the Control register.

• Create a device handle for each PCI Controller found. If a request is being made to start only

one PCI Controller, then only create one device handle.

• Install a Device Path Protocol instance and a PCI I/O Protocol instance on the device handle

created for each PCI Controller.

• If the PCI Controller has a PCI Option ROM, then allocate a memory buffer that is the same

size as the PCI Option ROM, and copy the PCI Option ROM contents to the memory buffer.

• If the PCI Option ROM contains any EFI Drivers, then attach a Bus Specific Driver Override

Protocol to the device handle of the PCI Controller that is associated with the PCI Option
ROM.

The

Stop()

function tells the PCI Bus Driver to stop managing a PCI Host Bus Controller. The

Stop()

function can destroy one or more of the device handles that were created on a previous

call to

Start()

. If all of the child device handles have been destroyed, then

Stop()

will place

the PCI Host Bus Controller in a quiescent state. The functionality of

Stop()

mirrors

Start()

,

as follows:

1. Complete all outstanding transactions to the PCI Host Bus Controller.
2. If the PCI Host Bus Controller is being stopped, then place it in a quiescent state.
3. If one or more child handles are being destroyed, then:

a. Uninstall all the protocols from the device handles for the PCI Controllers found

in

Start()

.

b. Free any memory buffers allocated for PCI Option ROMs.
c. Destroy the device handles for the PCI controllers created in

Start()

.