UEFI PCI Host Bridge Driver分析

来源:互联网 发布:space域名需要备案吗 编辑:程序博客网 时间:2024/06/10 09:20

最近一时兴起,想借助学习UEFI下的PCI bus driver,顺带学习下PCI busUEFIDriver Model的相关内容。准备写上几篇文章来详细的分析一下UEFIPCI驱动的实现。这里就以Open sourceEDKII code base为例,相关的代码可以从如下链接https://svn.code.sf.net/p/edk2/code/trunk/edk2获得。可以用SVN工具来下载所有的source code

 

首先PciHostBridgeDriverPcAtChipsetPkg\PciHostBridgeDxe

1.InitializePciHostBridge  function:

1.TheDriver Entry point for PciHostBridgeDriver in PciHostBridge.c file.

 

2.it Create instances for PciHostBridge based on the HOST_BRIDGE_NUMBER, also it create Root Bridges base on the input RootBridgeNumber, the platform owner knows how to setthese number, it decided by the hardware. Save the Root bridge toHostBridge->Head.

 

3.Themost important protocol installed in PCI host bridge is Pci Host BridgeResource Allocation Protocol (gEfiPciHostBridgeResourceAllocationProtocolGuid)

 

4.Thedevice path for PCI root bridge is mEfiPciRootBridgeDevicePath, it only has aACPI_DEVICE_PATH device path node.

 

2.In theNotifyPhase:

1.ForEfiPciHostBridgeBeginEnumeration case:

1.Resetthe Each Root Bridge , clean the RootBridgeInstance->ResAllocNode list,reset the HostBridgeInstance->ResourceSubmited andHostBridgeInstance->CanRestarted flag.

 

2.ForEfiPciHostBridgeBeginBusAllocation case:

Justset HostBridgeInstance->CanRestarted to FALSE.

 

3.ForGetNextRootBridge function:

1.Ifthe input RootBridgeHandle is NULL, just return the first handle inHostBridgeInstance->Head.

2.Ifthe input RootBridgeHandle is not NULL, just return the next member inHostBridgeInstance->Head, if already at the end, return NULL.

 

4.StartBusEnumerationFunction:

1.Justreturn the EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR structure base on the currentinfo.

 

未完待续...

原创粉丝点击