UEFI PCI Host Bridge Driver分析

最近一时兴起,想借助学习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 to HostBridge->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.

 

未完待续...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值