TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmGicCParser.c File Reference

Go to the source code of this file.

Functions

STATIC EFI_STATUS EFIAPI CpuNodeParser (IN CONST VOID *Fdt, IN INT32 CpuNode, IN UINT32 GicVersion, IN UINT32 AddressCells, OUT CM_ARM_GICC_INFO *GicCInfo)
 
STATIC EFI_STATUS EFIAPI CpusNodeParser (IN CONST VOID *Fdt, IN INT32 CpusNode, IN UINT32 GicVersion, OUT CM_OBJ_DESCRIPTOR **NewGicCmObjDesc)
 
STATIC EFI_STATUS EFIAPI GicCIntcNodeParser (IN CONST VOID *Fdt, IN INT32 GicIntcNode, IN OUT CM_OBJ_DESCRIPTOR *GicCCmObjDesc)
 
STATIC EFI_STATUS EFIAPI GicCv2IntcNodeParser (IN CONST VOID *Fdt, IN INT32 Gicv2IntcNode, IN OUT CM_OBJ_DESCRIPTOR *GicCCmObjDesc)
 
STATIC EFI_STATUS EFIAPI GicCv3IntcNodeParser (IN CONST VOID *Fdt, IN INT32 Gicv3IntcNode, IN OUT CM_OBJ_DESCRIPTOR *GicCCmObjDesc)
 
STATIC EFI_STATUS EFIAPI GicCPmuNodeParser (IN CONST VOID *Fdt, IN INT32 GicIntcNode, IN OUT CM_OBJ_DESCRIPTOR *GicCCmObjDesc)
 
EFI_STATUS EFIAPI ArmGicCInfoParser (IN CONST FDT_HW_INFO_PARSER_HANDLE FdtParserHandle, IN INT32 FdtBranch)
 

Variables

STATIC CONST COMPATIBILITY_STR CpuCompatibleStr []
 
STATIC CONST COMPATIBILITY_INFO CpuCompatibleInfo
 
STATIC CONST COMPATIBILITY_STR PmuCompatibleStr []
 
CONST COMPATIBILITY_INFO PmuCompatibleInfo
 

Detailed Description

Arm Gic cpu parser.

Copyright (c) 2021 - 2022, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
  • 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
  • linux/Documentation/devicetree/bindings/arm/pmu.yaml

Definition in file ArmGicCParser.c.

Function Documentation

◆ ArmGicCInfoParser()

EFI_STATUS EFIAPI ArmGicCInfoParser ( IN CONST FDT_HW_INFO_PARSER_HANDLE  FdtParserHandle,
IN INT32  FdtBranch 
)

CM_ARM_GICC_INFO parser function.

This parser expects FdtBranch to be the "\cpus" node node. At most one CmObj is created. The following structure is populated: typedef struct CmArmGicCInfo { UINT32 CPUInterfaceNumber; // {Populated} UINT32 AcpiProcessorUid; // {Populated} UINT32 Flags; // {Populated} UINT32 ParkingProtocolVersion; // {default = 0} UINT32 PerformanceInterruptGsiv; // {Populated} UINT64 ParkedAddress; // {default = 0} UINT64 PhysicalBaseAddress; // {Populated} UINT64 GICV; // {Populated} UINT64 GICH; // {Populated} UINT32 VGICMaintenanceInterrupt; // {Populated} UINT64 GICRBaseAddress; // {default = 0} UINT64 MPIDR; // {Populated} UINT8 ProcessorPowerEfficiencyClass; // {default = 0} UINT16 SpeOverflowInterrupt; // {default = 0} UINT32 ProximityDomain; // {default = 0} UINT32 ClockDomain; // {default = 0} UINT32 AffinityFlags; // {default = 0} } CM_ARM_GICC_INFO;

A parser parses a Device Tree to populate a specific CmObj type. None, one or many CmObj can be created by the parser. The created CmObj are then handed to the parser's caller through the HW_INFO_ADD_OBJECT interface. This can also be a dispatcher. I.e. a function that not parsing a Device Tree but calling other parsers.

Parameters
[in]FdtParserHandleA handle to the parser instance.
[in]FdtBranchWhen searching for DT node name, restrict the search to this Device Tree branch.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_NOT_FOUNDNot found.
EFI_UNSUPPORTEDUnsupported.

Definition at line 809 of file ArmGicCParser.c.

◆ CpuNodeParser()

STATIC EFI_STATUS EFIAPI CpuNodeParser ( IN CONST VOID *  Fdt,
IN INT32  CpuNode,
IN UINT32  GicVersion,
IN UINT32  AddressCells,
OUT CM_ARM_GICC_INFO GicCInfo 
)

Parse a "cpu" node.

Parameters
[in]FdtPointer to a Flattened Device Tree (Fdt).
[in]CpuNodeOffset of a cpu node.
[in]GicVersionVersion of the GIC.
[in]AddressCellsNumber of address cells used for the reg property.
[out]GicCInfoCM_ARM_GICC_INFO structure to populate.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_UNSUPPORTEDUnsupported.

Definition at line 72 of file ArmGicCParser.c.

◆ CpusNodeParser()

STATIC EFI_STATUS EFIAPI CpusNodeParser ( IN CONST VOID *  Fdt,
IN INT32  CpusNode,
IN UINT32  GicVersion,
OUT CM_OBJ_DESCRIPTOR **  NewGicCmObjDesc 
)

Parse a "cpus" node and its children "cpu" nodes.

Create as many CM_ARM_GICC_INFO structures as "cpu" nodes.

Parameters
[in]FdtPointer to a Flattened Device Tree (Fdt).
[in]CpusNodeOffset of a cpus node.
[in]GicVersionVersion of the GIC.
[out]NewGicCmObjDescIf success, CM_OBJ_DESCRIPTOR containing all the created CM_ARM_GICC_INFO.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_UNSUPPORTEDUnsupported.

Definition at line 166 of file ArmGicCParser.c.

◆ GicCIntcNodeParser()

STATIC EFI_STATUS EFIAPI GicCIntcNodeParser ( IN CONST VOID *  Fdt,
IN INT32  GicIntcNode,
IN OUT CM_OBJ_DESCRIPTOR GicCCmObjDesc 
)

Parse a Gic compatible interrupt-controller node, extracting GicC information generic to Gic v2 and v3.

This function modifies a CM_OBJ_DESCRIPTOR object. The following CM_ARM_GICC_INFO fields are patched:

  • VGICMaintenanceInterrupt;
  • Flags;
Parameters
[in]FdtPointer to a Flattened Device Tree (Fdt).
[in]GicIntcNodeOffset of a Gic compatible interrupt-controller node.
[in,out]GicCCmObjDescThe CM_ARM_GICC_INFO to patch.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 280 of file ArmGicCParser.c.

◆ GicCPmuNodeParser()

STATIC EFI_STATUS EFIAPI GicCPmuNodeParser ( IN CONST VOID *  Fdt,
IN INT32  GicIntcNode,
IN OUT CM_OBJ_DESCRIPTOR GicCCmObjDesc 
)

Parse a Pmu compatible node, extracting Pmu information.

This function modifies a CM_OBJ_DESCRIPTOR object. The following CM_ARM_GICC_INFO fields are patched:

  • PerformanceInterruptGsiv;
Parameters
[in]FdtPointer to a Flattened Device Tree (Fdt).
[in]GicIntcNodeOffset of a Gic compatible interrupt-controller node.
[in,out]GicCCmObjDescThe CM_ARM_GICC_INFO to patch.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 678 of file ArmGicCParser.c.

◆ GicCv2IntcNodeParser()

STATIC EFI_STATUS EFIAPI GicCv2IntcNodeParser ( IN CONST VOID *  Fdt,
IN INT32  Gicv2IntcNode,
IN OUT CM_OBJ_DESCRIPTOR GicCCmObjDesc 
)

Parse a Gic compatible interrupt-controller node, extracting GicCv2 information.

This function modifies a CM_OBJ_DESCRIPTOR object. The following CM_ARM_GICC_INFO fields are patched:

  • PhysicalAddress;
  • GICH;
  • GICV;
Parameters
[in]FdtPointer to a Flattened Device Tree (Fdt).
[in]Gicv2IntcNodeOffset of a Gicv2 compatible interrupt-controller node.
[in,out]GicCCmObjDescThe CM_ARM_GICC_INFO to patch.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 351 of file ArmGicCParser.c.

◆ GicCv3IntcNodeParser()

STATIC EFI_STATUS EFIAPI GicCv3IntcNodeParser ( IN CONST VOID *  Fdt,
IN INT32  Gicv3IntcNode,
IN OUT CM_OBJ_DESCRIPTOR GicCCmObjDesc 
)

Parse a Gic compatible interrupt-controller node, extracting GicCv3 information.

This function modifies a CM_OBJ_DESCRIPTOR object. The following CM_ARM_GICC_INFO fields are patched:

  • PhysicalAddress;
  • GICH;
  • GICV;
Parameters
[in]FdtPointer to a Flattened Device Tree (Fdt).
[in]Gicv3IntcNodeOffset of a Gicv3 compatible interrupt-controller node.
[in,out]GicCCmObjDescThe CM_ARM_GICC_INFO to patch.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_ABORTEDAn error occurred.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 488 of file ArmGicCParser.c.

Variable Documentation

◆ CpuCompatibleInfo

STATIC CONST COMPATIBILITY_INFO CpuCompatibleInfo
Initial value:
= {
}
STATIC CONST COMPATIBILITY_STR CpuCompatibleStr[]
Definition: ArmGicCParser.c:24
#define ARRAY_SIZE(Array)
Definition: Base.h:1393

COMPATIBILITY_INFO structure for CPU nodes.

Definition at line 35 of file ArmGicCParser.c.

◆ CpuCompatibleStr

STATIC CONST COMPATIBILITY_STR CpuCompatibleStr[]
Initial value:
= {
{ "arm,arm-v7" },
{ "arm,arm-v8" },
{ "arm,armv8" },
{ "arm,cortex-a15" },
{ "arm,cortex-a7" },
{ "arm,cortex-a57" }
}

List of "compatible" property values for CPU nodes.

Any other "compatible" value is not supported by this module.

Definition at line 24 of file ArmGicCParser.c.

◆ PmuCompatibleInfo

CONST COMPATIBILITY_INFO PmuCompatibleInfo
Initial value:
= {
}
STATIC CONST COMPATIBILITY_STR PmuCompatibleStr[]
Definition: ArmGicCParser.c:44

COMPATIBILITY_INFO structure for the PmuCompatibleStr.

Definition at line 50 of file ArmGicCParser.c.

◆ PmuCompatibleStr

STATIC CONST COMPATIBILITY_STR PmuCompatibleStr[]
Initial value:
= {
{ "arm,armv8-pmuv3" }
}

Pmu compatible strings.

Any other "compatible" value is not supported by this module.

Definition at line 44 of file ArmGicCParser.c.