TianoCore EDK2 master
Loading...
Searching...
No Matches
PciBus.c File Reference
#include "PciBus.h"

Go to the source code of this file.

Functions

EFI_STATUS EFIAPI PciBusEntryPoint (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI PciBusDriverBindingSupported (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI PciBusDriverBindingStart (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
 
EFI_STATUS EFIAPI PciBusDriverBindingStop (IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
 

Variables

EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding
 
EFI_HANDLE gPciHostBrigeHandles [PCI_MAX_HOST_BRIDGE_NUM]
 
EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOLgIncompatiblePciDeviceSupport = NULL
 
UINTN gPciHostBridgeNumber = 0
 
BOOLEAN gFullEnumeration = TRUE
 
UINT64 gAllOne = 0xFFFFFFFFFFFFFFFFULL
 
UINT64 gAllZero = 0
 
EFI_PCI_PLATFORM_PROTOCOLgPciPlatformProtocol
 
EFI_PCI_OVERRIDE_PROTOCOLgPciOverrideProtocol
 
EDKII_IOMMU_PROTOCOLmIoMmuProtocol
 
EDKII_DEVICE_SECURITY_PROTOCOLmDeviceSecurityProtocol
 
GLOBAL_REMOVE_IF_UNREFERENCED EFI_PCI_HOTPLUG_REQUEST_PROTOCOL mPciHotPlugRequest
 

Detailed Description

Driver Binding functions for PCI Bus module.

Single PCI bus driver instance will manager all PCI Root Bridges in one EFI based firmware, since all PCI Root Bridges' resources need to be managed together. Supported() function will try to get PCI Root Bridge IO Protocol. Start() function will get PCI Host Bridge Resource Allocation Protocol to manage all PCI Root Bridges. So it means platform needs install PCI Root Bridge IO protocol for each PCI Root Bus and install PCI Host Bridge Resource Allocation Protocol.

Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PciBus.c.

Function Documentation

◆ PciBusDriverBindingStart()

EFI_STATUS EFIAPI PciBusDriverBindingStart ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Start this driver on ControllerHandle and enumerate Pci bus and start all device under PCI bus.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to bind driver to.
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver is added to ControllerHandle.
EFI_ALREADY_STARTEDThis driver is already running on ControllerHandle.
otherThis driver does not support this device.

Definition at line 232 of file PciBus.c.

◆ PciBusDriverBindingStop()

EFI_STATUS EFIAPI PciBusDriverBindingStop ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN UINTN  NumberOfChildren,
IN EFI_HANDLE ChildHandleBuffer 
)

Stop this driver on ControllerHandle. Support stopping any child handles created by this driver.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to stop driver on.
NumberOfChildrenNumber of Handles in ChildHandleBuffer. If number of children is zero stop the entire bus driver.
ChildHandleBufferList of Child Handles to Stop.
Return values
EFI_SUCCESSThis driver is removed ControllerHandle.
otherThis driver was not removed from this device.

Definition at line 402 of file PciBus.c.

◆ PciBusDriverBindingSupported()

EFI_STATUS EFIAPI PciBusDriverBindingSupported ( IN EFI_DRIVER_BINDING_PROTOCOL This,
IN EFI_HANDLE  Controller,
IN EFI_DEVICE_PATH_PROTOCOL RemainingDevicePath 
)

Test to see if this driver supports ControllerHandle. Any ControllerHandle than contains a gEfiPciRootBridgeIoProtocolGuid protocol can be supported.

Parameters
ThisProtocol instance pointer.
ControllerHandle of device to test.
RemainingDevicePathOptional parameter use to pick a specific child device to start.
Return values
EFI_SUCCESSThis driver supports this device.
EFI_ALREADY_STARTEDThis driver is already running on this device.
otherThis driver does not support this device.

Definition at line 121 of file PciBus.c.

◆ PciBusEntryPoint()

EFI_STATUS EFIAPI PciBusEntryPoint ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

The Entry Point for PCI Bus module. The user code starts with this function.

Installs driver module protocols and. Creates virtual device handles for ConIn, ConOut, and StdErr. Installs Simple Text In protocol, Simple Text In Ex protocol, Simple Pointer protocol, Absolute Pointer protocol on those virtual handlers. Installs Graphics Output protocol and/or UGA Draw protocol if needed.

Parameters
[in]ImageHandleThe firmware allocated handle for the EFI image.
[in]SystemTableA pointer to the EFI System Table.
Return values
EFI_SUCCESSThe entry point is executed successfully.
otherSome error occurred when executing this entry point.

Definition at line 63 of file PciBus.c.

Variable Documentation

◆ gAllOne

UINT64 gAllOne = 0xFFFFFFFFFFFFFFFFULL

Definition at line 34 of file PciBus.c.

◆ gAllZero

UINT64 gAllZero = 0

Definition at line 35 of file PciBus.c.

◆ gFullEnumeration

BOOLEAN gFullEnumeration = TRUE

Definition at line 33 of file PciBus.c.

◆ gIncompatiblePciDeviceSupport

EFI_INCOMPATIBLE_PCI_DEVICE_SUPPORT_PROTOCOL* gIncompatiblePciDeviceSupport = NULL

Definition at line 31 of file PciBus.c.

◆ gPciBusDriverBinding

EFI_DRIVER_BINDING_PROTOCOL gPciBusDriverBinding
Initial value:
= {
0xa,
}
#define NULL
Definition: Base.h:319
EFI_STATUS EFIAPI PciBusDriverBindingStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: PciBus.c:232
EFI_STATUS EFIAPI PciBusDriverBindingSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
Definition: PciBus.c:121
EFI_STATUS EFIAPI PciBusDriverBindingStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE Controller, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
Definition: PciBus.c:402

Definition at line 21 of file PciBus.c.

◆ gPciHostBridgeNumber

UINTN gPciHostBridgeNumber = 0

Definition at line 32 of file PciBus.c.

◆ gPciHostBrigeHandles

EFI_HANDLE gPciHostBrigeHandles[PCI_MAX_HOST_BRIDGE_NUM]

Definition at line 30 of file PciBus.c.

◆ gPciOverrideProtocol

EFI_PCI_OVERRIDE_PROTOCOL* gPciOverrideProtocol

Definition at line 38 of file PciBus.c.

◆ gPciPlatformProtocol

EFI_PCI_PLATFORM_PROTOCOL* gPciPlatformProtocol

Definition at line 37 of file PciBus.c.

◆ mDeviceSecurityProtocol

EDKII_DEVICE_SECURITY_PROTOCOL* mDeviceSecurityProtocol

Definition at line 40 of file PciBus.c.

◆ mIoMmuProtocol

EDKII_IOMMU_PROTOCOL* mIoMmuProtocol

Definition at line 39 of file PciBus.c.

◆ mPciHotPlugRequest

Initial value:
= {
}
EFI_STATUS EFIAPI PciHotPlugRequestNotify(IN EFI_PCI_HOTPLUG_REQUEST_PROTOCOL *This, IN EFI_PCI_HOTPLUG_OPERATION Operation, IN EFI_HANDLE Controller, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL, IN OUT UINT8 *NumberOfChildren, IN OUT EFI_HANDLE *ChildHandleBuffer)

Definition at line 42 of file PciBus.c.