1. Dec 24, 2021
  2. Dec 23, 2021
  3. Dec 22, 2021
  4. Dec 20, 2021
  5. Dec 18, 2021
  6. Dec 17, 2021
  7. Dec 16, 2021
  8. Dec 15, 2021
    • Wei6 Xu's avatar
      StandaloneMmPkg/FvLib: Support large file with EFI_FFS_FILE_HEADER2. · f14fff51
      Wei6 Xu authored
      REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3769
      
      
      
      Current FvLib will hit parse issue when encountering LARGE file, then
      ignore latter ffs/section, thus causing required drivers not being
      dispatched. Therefore, need to add support for EFI_FFS_FILE_HEADER2
      and EFI_COMMON_SECTION_HEADER2 in FvLib to fix this issue.
      
      Signed-off-by: default avatarWei6 Xu <wei6.xu@intel.com>
      Reviewed-by: default avatarLiming Gao <gaoliming@byosoft.com.cn>
      f14fff51
    • Pierre Gondois's avatar
      DynamicTablesPkg: Add DynamicPlatRepo library · 38f6d78c
      Pierre Gondois authored
      
      
      The DynamicPlatRepo library allows to handle dynamically created
      CmObj. The dynamic platform repository can be in the following states:
      1 - Non-initialised
      2 - Transient:
          Possibility to add CmObj to the platform, but not to query them.
      3 - Finalised:
          Possibility to query CmObj, but not to add new.
      
      A token is allocated to each CmObj added to the dynamic platform
      repository (except for reference tokens CmObj). This allows to retrieve
      dynamic CmObjs among all CmObj (static CmObj for instance).
      
      This patch add the inf file of the module and the main module
      functionnalities and update the dsc file of the package.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      38f6d78c
    • Pierre Gondois's avatar
      DynamicTablesPkg: DynamicPlatRepo: Add TokenMapper · 5fe5b6f9
      Pierre Gondois authored
      
      
      The DynamicPlatRepo library allows to handle dynamically created
      CmObj. The dynamic platform repository can be in the following states:
      1 - Non-initialised
      2 - Transient:
          Possibility to add CmObj to the platform, but not to query them.
      3 - Finalised:
          Possibility to query CmObj, but not to add new.
      
      A token is allocated to each CmObj added to the dynamic platform
      repository (except for reference tokens CmObj). This allows to retrieve
      dynamic CmObjs among all CmObj (static CmObj for instance).
      
      This patch add the TokenMapper files, allowing to retrieve a CmObj
      from a token/CmObjId couple.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      5fe5b6f9
    • Pierre Gondois's avatar
      DynamicTablesPkg: DynamicPlatRepo: Add TokenFixer · 740e3bb6
      Pierre Gondois authored
      
      
      The DynamicPlatRepo library allows to handle dynamically created
      CmObj. The dynamic platform repository can be in the following states:
      1 - Non-initialised
      2 - Transient:
          Possibility to add CmObj to the platform, but not to query them.
      3 - Finalised:
          Possibility to query CmObj, but not to add new.
      
      A token is allocated to each CmObj added to the dynamic platform
      repository (except for reference tokens CmObj). This allows to retrieve
      dynamic CmObjs among all CmObj (static CmObj for instance).
      
      This patch add the TokenFixer files, allowing to update the
      self-token some CmObj have.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      740e3bb6
    • Pierre Gondois's avatar
      DynamicTablesPkg: DynamicPlatRepo: Add TokenGenerator · 2e2db65e
      Pierre Gondois authored
      
      
      The DynamicPlatRepo library allows to handle dynamically created
      CmObj. The dynamic platform repository can be in the following states:
      1 - Non-initialised
      2 - Transient:
          Possibility to add CmObj to the platform, but not to query them.
      3 - Finalised:
          Possibility to query CmObj, but not to add new.
      
      A token is allocated to each CmObj added to the dynamic platform
      repository (except for reference tokens CmObj). This allows to retrieve
      dynamic CmObjs among all CmObj (static CmObj for instance).
      
      This patch add the TokenGenerator files.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      2e2db65e
    • Pierre Gondois's avatar
      DynamicTablesPkg: Definition for DynamicPlatRepoLib interface · b2d0ed20
      Pierre Gondois authored
      
      
      The DynamicPlatRepoLib library allows to handle dynamically created
      CmObj. The dynamic platform repository can be in the following states:
      1 - Non-initialised
      2 - Transient:
          Possibility to add CmObj to the platform, but not to query them.
      3 - Finalised:
          Possibility to query CmObj, but not to add new.
      
      A token is allocated to each CmObj added to the dynamic platform
      repository (except for reference tokens CmObj). This allows to
      retrieve dynamic CmObjs among all CmObj (static CmObj for instance).
      
      This patch defines the library interface of the DynamicPlatRepo.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      b2d0ed20
    • Pierre Gondois's avatar
      DynamicTablesPkg: Handle 16550_WITH_GAS id · 9006967c
      Pierre Gondois authored
      
      
      Handle the EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_16550_WITH_GAS
      id when generating an AML description of a serial port. The same
      _HID/_CID as the EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_FULL_16550
      are generated.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      9006967c
    • Pierre Gondois's avatar
      DynamicTablesPkg: Add FdtHwInfoParser library · deb01dfd
      Pierre Gondois authored
      Hardware information parser is an optional module defined
      by the Dynamic Tables Framework. It can either parse an
      XML, a Device Tree or a Json file containing the platform
      hardware information to populate the platform information
      repository.
      
      FdtHwInfoParser library is an instance of a HwInfoParser
      that parses a Device Tree and populates the Configuration
      Manager Platform information repository.
      
      FdtHwInfoParser library is aimed at providing a solution
      for generating ACPI tables for Guest Partitions launched
      by virtual machine managers (VMMs). One such use case is
      Kvmtool where the Device Tree for the Guest is passed on
      to the firmware by Kvmtool. The Configuration Manager for
      Kvmtool firmware shall invoke the FdtHwInfoParser to parse
      the Device Tree to populate the hardware information in
      the Platform Info Repository. The Kvmtool Configuration
      Manager can the process this information to generate the
      required ACPI tables for the Guest VM.
      
      This approach also scales well if the number of CPUs or
      if the hardware configuration of the Guest partition is
      varied.
      
      FdtHwInfoParser thereby introduces 'Dynamic Tables for
      Virtual Machines'.
      
      Ref:https://bugzilla.tianocore.org/show_bug.cgi?id=3741
      
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      deb01dfd
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add PCI config parser · c67bf628
      Pierre Gondois authored
      
      
      On platforms that implement PCIe, the PCIe configuration space
      information must be described to a standards-based operating
      system in the Memory mapped configuration space base address
      Description (MCFG) table.
      
      The PCIe information is described in the platform Device Tree,
      the bindings for which can be found at:
      - linux/Documentation/devicetree/bindings/pci/
        host-generic-pci.yaml
      
      The FdtHwInfoParser implements a PCI configuration space Parser
      that parses the platform Device Tree to create
      CM_ARM_PCI_CONFIG_SPACE_INFO objects which are encapsulated in a
      Configuration Manager descriptor object and added to the platform
      information repository.
      
      The platform Configuration Manager can then utilise this
      information when generating the MCFG table.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      c67bf628
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add GIC dispatcher · 26bf034a
      Pierre Gondois authored
      
      
      The GIC Dispatcher is the top-level component that is responsible
      for invoking the respective parsers for GICC, GICD, GIC MSI Frame,
      GIC ITS and the GICR.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      26bf034a
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add GICR parser · 7b6c8b30
      Pierre Gondois authored
      
      
      The GIC Redistributor (GICR) structure is part of the Multiple
      APIC Description Table (MADT) that enables the discovery of
      GIC Redistributor base addresses by providing the Physical Base
      Address of a page range containing the GIC Redistributors. More
      than one GICR Structure may be presented in the MADT. The GICR
      structures should only be used when describing GIC version 3 or
      higher.
      
      The GIC Redistributor information is described in the platform
      Device Tree, the bindings for which can be found at:
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic-v3.yaml
      
      The FdtHwInfoParser implements a GIC Redistributor Parser that
      parses the platform Device Tree to create CM_ARM_GIC_REDIST_INFO
      objects which are encapsulated in a Configuration Manager
      descriptor object and added to the platform information
      repository.
      
      The platform Configuration Manager can then utilise this
      information when generating the MADT table.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      7b6c8b30
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add ITS parser · d250d408
      Pierre Gondois authored
      
      
      Arm GIC v3/v4 optionally includes support for GIC Interrupt
      Translation Service (ITS). The GIC ITS Structure is part of
      the Multiple APIC Description Table (MADT) that describes
      the GIC Interrupt Translation service to the OS.
      
      The GIC Interrupt Translation Service information is described
      in the platform Device Tree, the bindings for which can be
      found at:
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic-v3.yaml
      
      The FdtHwInfoParser implements a GIC ITS Parser that parses the
      platform Device Tree to create CM_ARM_GIC_ITS_INFO objects which
      are encapsulated in a Configuration Manager descriptor object and
      added to the platform information repository.
      
      The platform Configuration Manager can then utilise this information
      when generating the MADT table.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      d250d408
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add MSI Frame parser · b04cf355
      Pierre Gondois authored
      
      
      Arm GIC version 2 systems that support Message Signalled Interrupts
      implement GICv2m MSI frame(s). Each GICv2m MSI frame consists of a
      4k page which includes registers to generate message signalled
      interrupts to an associated GIC distributor. The frame also includes
      registers to discover the set of distributor lines which may be
      signalled by MSIs from that frame. A system may have multiple MSI
      frames, and separate frames may be defined for secure and non-secure
      access.
      
      A MSI Frame structure is part of the Multiple APIC Description Table
      (MADT) and must only be used to describe non-secure MSI frames.
      
      The MSI Frame information is described in the platform Device Tree,
      the bindings for which can be found at:
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic.yaml
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic-v3.yaml
      
      The FdtHwInfoParser implements a MSI Frame Parser that parses
      the platform Device Tree to create CM_ARM_GIC_MSI_FRAME_INFO
      objects which are encapsulated in a Configuration Manager
      descriptor object and added to the platform information
      repository.
      
      The platform Configuration Manager can then utilise this
      information when generating the MADT table.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      b04cf355
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add GICD parser · 0fa12177
      Pierre Gondois authored
      
      
      On ARM-based systems the Generic Interrupt Controller (GIC)
      manages interrupts on the system. Each interrupt is identified
      in the GIC by an interrupt identifier (INTID). ACPI GSIVs map
      one to one to GIC INTIDs for peripheral interrupts, whether
      shared (SPI) or private (PPI). The GIC distributor provides
      the routing configuration for the interrupts.
      
      The GIC Distributor (GICD) structure is part of the Multiple
      APIC Description Table (MADT) that describes the GIC
      distributor to the OS. The MADT table is a mandatory table
      required for booting a standards-based operating system.
      
      The GIC Distributor information is described in the platform
      Device Tree, the bindings for which can be found at:
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic.yaml
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic-v3.yaml
      
      The FdtHwInfoParser implements a GIC Distributor Parser that
      parses the platform Device Tree to create CM_ARM_GICD_INFO
      object which is encapsulated in a Configuration Manager
      descriptor object and added to the platform information
      repository.
      
      The platform Configuration Manager can then utilise this
      information when generating the MADT table.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      0fa12177
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add GICC parser · e366a41e
      Pierre Gondois authored
      
      
      The GIC CPU Interface (GICC) structure is part of the Multiple
      APIC Description Table (MADT) that describes the interrupt model
      for the platform. The MADT table is a mandatory table required
      for booting a standards-based operating system.
      
      Arm requires the GIC interrupt model, in which the logical
      processors are required to have a Processor Device object in
      the DSDT, and must convey each processor's GIC information to
      the OS using the GICC structure.
      
      The CPU and GIC information is described in the platform Device
      Tree, the bindings for which can be found at:
       - linux/Documentation/devicetree/bindings/arm/cpus.yaml
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic.yaml
       - linux/Documentation/devicetree/bindings/interrupt-controller/
         arm,gic-v3.yaml
      
      The FdtHwInfoParser implements a GIC CPU Interface Parser that
      parses the platform Device Tree to create CM_ARM_GICC_INFO
      objects which are encapsulated in a Configuration Manager
      descriptor object and added to the platform information
      repository.
      
      The platform Configuration Manager can then utilise this
      information when generating the MADT and the SSDT CPU
      information tables.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      e366a41e
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add Serial port parser · 51941f75
      Pierre Gondois authored
      
      
      The Microsoft Debug Port Table 2 (DBG2), the Serial Port Console
      Redirector (SPCR) table are mandatory tables required for booting
      a standards-based operating system. The DBG2 table is used by the
      OS debugger while the SPCR table is used to configure the serial
      terminal. Additionally, the serial ports available on a platform
      for generic use also need to be described in DSDT/SSDT for an OS
      to be able to use the serial ports.
      
      The Arm Base System Architecture 1.0 specification a lists of
      supported serial port hardware for Arm Platforms. This list
      includes the following serial port UARTs:
       - SBSA/Generic UART
       - a fully 16550 compatible UART.
      Along, with these the PL011 UART is the most commonly used serial
      port hardware on Arm platforms.
      
      The serial port hardware information is described in the platform
      Device Tree, the bindings for which can be found at:
       - linux/Documentation/devicetree/bindings/serial/serial.yaml
       - linux/Documentation/devicetree/bindings/serial/8250.txt
       - linux/Documentation/devicetree/bindings/serial/arm_sbsa_uart.txt
       - linux/Documentation/devicetree/bindings/serial/pl011.yaml
      
      The FdtHwInfoParser implements a Serial Port Parser that parses
      the platform Device Tree to create CM_ARM_SERIAL_PORT_INFO objects
      with the following IDs:
       - EArmObjSerialConsolePortInfo (for use by SPCR)
       - EArmObjSerialDebugPortInfo (for use by DBG2)
       - EArmObjSerialPortInfo (for use as generic Serial Ports)
      
      The Serial Port for use by SPCR is selected by parsing the Device
      Tree for the '/chosen' node with the 'stdout-path' property. The
      next Serial Port is selected for use as the Debug Serial Port and
      the remaining serial ports are used as generic serial ports.
      
      The CM_ARM_SERIAL_PORT_INFO objects are encapsulated in Configuration
      Manager descriptor objects with the respective IDs and are added to
      the platform information repository.
      
      The platform Configuration Manager can then utilise this information
      when generating the DBG2, SPCR and the SSDT serial port tables.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      51941f75
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Generic Timer Parser · 3ebe1ff5
      Pierre Gondois authored
      
      
      The Generic Timer Description Table (GTDT) is a mandatory table
      required for booting a standards-based operating system. It
      provides an OSPM with information about a system's Generic Timer
      configuration. The Generic Timer (GT) is a standard timer interface
      implemented on ARM processor-based systems. The GTDT provides OSPM
      with information about a system's GT interrupt configurations, for
      both per-processor timers, and platform (memory-mapped) timers.
      
      The Generic Timer information is described in the platform Device
      Tree. The Device Tree bindings for the Generic timers can be found
      at:
       - linux/Documentation/devicetree/bindings/timer/arm,arch_timer.yaml
      
      The FdtHwInfoParser implements a Generic Timer Parser that parses
      the platform Device Tree to create a CM_ARM_GENERIC_TIMER_INFO
      object. The CM_ARM_GENERIC_TIMER_INFO object is encapsulated in a
      Configuration Manager descriptor object and added to the platform
      information repository.
      
      The platform Configuration Manager can then utilise this information
      when generating the GTDT table.
      
      Note: The Generic Timer Parser currently does not support parsing
      of memory-mapped platform timers.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      3ebe1ff5
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add Boot Arch parser · 8d2691c3
      Pierre Gondois authored
      
      
      The Fixed ACPI Description Table (FADT) is a mandatory table
      required for booting a standards-based operating system. The
      FADT table has an 'ARM Boot Architecture Flags' field that is
      used by an OS at boot time to determine the code path during
      boot. This field is used to specify if the platform complies
      with the PSCI specification. It is also used to describe the
      conduit (SMC/HVC) to be used for PSCI.
      
      The PSCI compliance information for a platform is described
      in the platform Device Tree, the bindings for which can be
      found at:
       - linux/Documentation/devicetree/bindings/arm/psci.yaml
      
      The FdtHwInfoParser implements a Boot Arch Parser that parses
      the platform Device Tree to create a CM_ARM_BOOT_ARCH_INFO
      object. The CM_ARM_BOOT_ARCH_INFO object is encapsulated in
      a Configuration Manager descriptor object and added to the
      platform information repository.
      
      The platform Configuration Manager can then utilise this
      information when generating the FADT table.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      8d2691c3
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: Add FDT utility functions · 5d8b5d17
      Pierre Gondois authored
      
      
      The FdtHwInfoParser parses a platform Device Tree and populates
      the Platform Information repository with Configuration Manager
      objects.
      
      Therefore, add a set of helper functions to simplify parsing of
      the platform Device Tree.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      5d8b5d17
    • Pierre Gondois's avatar
      DynamicTablesPkg: FdtHwInfoParser: CM Object descriptor helper · d59c5a20
      Pierre Gondois authored
      
      
      FdtHwInfoParserLib is an instance of the HwInfoParser. The
      FdtHwInfoParser parses a platform Device Tree and populates
      the Platform Information repository with Configuration
      Manager objects that describe the platform hardware.
      These Configuration Manager objects are encapsulated in
      Configuration Manager Object Descriptors.
      
      Therefore, add helper functions to create and free the
      Configuration Manager Object descriptors.
      
      Signed-off-by: default avatarPierre Gondois <Pierre.Gondois@arm.com>
      Reviewed-by: default avatarSami Mujawar <sami.mujawar@arm.com>
      d59c5a20