Hi Ray,

this is a nice patch; I have one cosmetic comment:

On 05/10/16 07:53, Ruiyu Ni wrote:
> Change PciHostBridgeDxe driver to not install the
> PciHostBridgeResourceAllocation protocol and let
> PciRootBridgeIo.Configuration() return the correct PCI resource
> assignment information when the ResourceAssigned is TRUE.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni <[email protected]>
> Cc: Jeff Fan <[email protected]>
> Cc: Laszlo Ersek <[email protected]>
> ---
>  .../Bus/Pci/PciHostBridgeDxe/PciHostBridge.c       | 92 +++++++++++++++------
>  .../Bus/Pci/PciHostBridgeDxe/PciRootBridge.h       |  4 +-
>  .../Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c     | 95 
> ++++++++++++++--------
>  3 files changed, 133 insertions(+), 58 deletions(-)

[snip]

> @@ -174,14 +178,41 @@ CreateRootBridge (
>    CopyMem (&RootBridge->PMemAbove4G, &Bridge->PMemAbove4G, sizeof 
> (PCI_ROOT_BRIDGE_APERTURE));
>  
>    for (Index = TypeIo; Index < TypeMax; Index++) {
> -    RootBridge->ResAllocNode[Index].Type   = Index;
> -    RootBridge->ResAllocNode[Index].Base   = 0;
> -    RootBridge->ResAllocNode[Index].Length = 0;
> -    RootBridge->ResAllocNode[Index].Status = ResNone;
> +    switch (Index) {
> +    case TypeBus:
> +      Aperture = &RootBridge->Bus;
> +      break;
> +    case TypeIo:
> +      Aperture = &RootBridge->Io;
> +      break;
> +    case TypeMem32:
> +      Aperture = &RootBridge->Mem;
> +      break;
> +    case TypeMem64:
> +      Aperture = &RootBridge->MemAbove4G;
> +      break;
> +    case TypePMem32:
> +      Aperture = &RootBridge->PMem;
> +      break;
> +    case TypePMem64:
> +      Aperture = &RootBridge->PMemAbove4G;
> +      break;
> +    default:

can you add an ASSERT (FALSE); here?

Reviewed-by: Laszlo Ersek <[email protected]>

Thanks!
Laszlo

> +      break;
> +    }
> +    RootBridge->ResAllocNode[Index].Type     = Index;
> +    if (Bridge->ResourceAssigned && (Aperture->Limit >= Aperture->Base)) {
> +      RootBridge->ResAllocNode[Index].Base   = Aperture->Base;
> +      RootBridge->ResAllocNode[Index].Length = Aperture->Limit - 
> Aperture->Base + 1;
> +      RootBridge->ResAllocNode[Index].Status = ResAllocated;
> +    } else {
> +      RootBridge->ResAllocNode[Index].Base   = 0;
> +      RootBridge->ResAllocNode[Index].Length = 0;
> +      RootBridge->ResAllocNode[Index].Status = ResNone;
> +    }
>    }
>  
>    RootBridge->RootBridgeIo.SegmentNumber  = Bridge->Segment;
> -  RootBridge->RootBridgeIo.ParentHandle   = HostBridgeHandle;
>    RootBridge->RootBridgeIo.PollMem        = RootBridgeIoPollMem;
>    RootBridge->RootBridgeIo.PollIo         = RootBridgeIoPollIo;
>    RootBridge->RootBridgeIo.Mem.Read       = RootBridgeIoMemRead;
> 

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to