intel / FdtBusPkg

Device Tree-based Platform Device Driver Development for Tiano UEFI
https://wiki.riseproject.dev/display/HOME/EDK2_00_03+-+FdtBusDxe+support
11 stars 1 forks source link

PciHostBridgeFdtDxe: factor out ECAM-specific portions into lib #103

Open andreiw opened 6 months ago

andreiw commented 6 months ago

Will be necessary to use this driver on non-ecam platforms. This basically should be an init/fini pair + function to read/write a config space register. Also add a VOID *Context to _PCI_ROOT_BRIDGE_INSTANCE so the lib can maintain extra state if needed.

All state manipulated by init/fini/cfg accessors should be pushed into a common struct, i.e.:

  UINT32                                              Segment;
  EFI_DT_REG                                          ConfigReg;
  UINT64                                              Attributes;
  UINT64                                              Supports;
  EFI_DT_RANGE                                        BusRange;
  EFI_DT_RANGE                                        IoRange;
  EFI_DT_RANGE                                        MemRange;
  EFI_DT_RANGE                                        PMemRange;
  EFI_DT_RANGE                                        MemAbove4GRange;
  EFI_DT_RANGE                                        PMemAbove4GRange;
  BOOLEAN                                             DmaAbove4G;
  BOOLEAN                                             NoExtendedConfigSpace;

Originally posted by @andreiw in https://github.com/intel/FdtBusPkg/issues/12#issuecomment-1962280347