Reviewed-By: Olivier Martin <[email protected]>

> -----Original Message-----
> From: Ard Biesheuvel [mailto:[email protected]]
> Sent: 23 January 2015 15:03
> To: [email protected]; [email protected]; Olivier
> Martin; [email protected]; [email protected];
> [email protected]; [email protected];
> [email protected]; [email protected]; xen-
> [email protected]; [email protected]
> Cc: Ard Biesheuvel
> Subject: [PATCH v1 02/21] ArmVirtualizationPkg: add GICv3 detection to
> VirtFdtDxe
> 
> This adds support for detecting the presence of a GICv3 interrupt
> controller from the device tree, and recording its distributor
> base address in a PCD.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <[email protected]>
> ---
>  .../ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c      | 19
> +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git
> a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
> b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
> index 4e4f608923d3..8953f78f5fe4 100644
> --- a/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
> +++ b/ArmPlatformPkg/ArmVirtualizationPkg/VirtFdtDxe/VirtFdtDxe.c
> @@ -46,6 +46,7 @@ typedef enum {
>    PropertyTypeTimer,
>    PropertyTypePsci,
>    PropertyTypeFwCfg,
> +  PropertyTypeGicV3,
>  } PROPERTY_TYPE;
> 
>  typedef struct {
> @@ -62,6 +63,7 @@ STATIC CONST PROPERTY CompatibleProperties[] = {
>    { PropertyTypeTimer,   "arm,armv8-timer"     },
>    { PropertyTypePsci,    "arm,psci-0.2"        },
>    { PropertyTypeFwCfg,   "qemu,fw-cfg-mmio"    },
> +  { PropertyTypeGicV3,   "arm,gic-v3"          },
>    { PropertyTypeUnknown, ""                    }
>  };
> 
> @@ -256,6 +258,23 @@ InitializeVirtFdtDxe (
>        DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase,
> CpuBase));
>        break;
> 
> +    case PropertyTypeGicV3:
> +      //
> +      // The GIC v3 DT binding describes a series of at least 3
> physical base
> +      // addresses, but we are only interested in the first one, which
> is the
> +      // distributor interface. (We use the system register CPU
> interface, not
> +      // the MMIO one)
> +      //
> +      ASSERT (Len >= 16);
> +
> +      DistBase = fdt64_to_cpu (((UINT64 *)RegProp)[0]);
> +      ASSERT (DistBase < MAX_UINT32);
> +
> +      PcdSet32 (PcdGicDistributorBase, (UINT32)DistBase);
> +
> +      DEBUG ((EFI_D_INFO, "Found GIC v3 distributor @ 0x%Lx\n",
> DistBase));
> +      break;
> +
>      case PropertyTypeRtc:
>        ASSERT (Len == 16);
> 
> --
> 1.8.3.2
> 





------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to