On 26 July 2015 at 11:40, Ard Biesheuvel <[email protected]> wrote:
> In order to allow a ArmGicArchLib to be implemented that returns
> the supported GIC revision based on the device tree, add handling
> to VirtFdtDxe to record the GIC revision at DT parsing time.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel <[email protected]>
> Reviewed-by: Laszlo Ersek <[email protected]>
> ---
>  ArmVirtPkg/ArmVirtPkg.dec            | 7 ++++++-
>  ArmVirtPkg/ArmVirtQemu.dsc           | 1 +
>  ArmVirtPkg/ArmVirtXen.dsc            | 1 +
>  ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c   | 2 ++
>  ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf | 1 +
>  5 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec
> index 9833c5aa688f..249278853ef0 100644
> --- a/ArmVirtPkg/ArmVirtPkg.dec
> +++ b/ArmVirtPkg/ArmVirtPkg.dec
> @@ -68,6 +68,11 @@ [PcdsDynamic, PcdsFixedAtBuild]
>    gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0|UINT64|0x00000004
>    gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0|UINT64|0x00000005
>
> +  #
> +  # Supported GIC revision (2, 3, ...)
> +  #
> +  gArmVirtTokenSpaceGuid.PcdArmGicRevision|0x0|UINT32|0x00000006
> +
>  [PcdsFeatureFlag]
>    #
>    # "Map PCI MMIO as Cached"
> @@ -91,4 +96,4 @@ [PcdsFeatureFlag]
>    #
>    # The default is to turn off the kludge; DSC's can selectively enable it.
>    #
> -  gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|FALSE|BOOLEAN|0x00000006
> +  gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|FALSE|BOOLEAN|0x00000007

Minor 'oops' here: 0x7 has been assigned in the mean time, and I
failed to do a build test after rebasing.
I will fix it up before committing, but not send a v3 just for this,
unless anyone objects.

-- 
Ard.


> diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc
> index a2a82a4dba8c..c199cac72cfd 100644
> --- a/ArmVirtPkg/ArmVirtQemu.dsc
> +++ b/ArmVirtPkg/ArmVirtQemu.dsc
> @@ -205,6 +205,7 @@ [PcdsDynamicDefault.common]
>    gArmTokenSpaceGuid.PcdGicDistributorBase|0x0
>    gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x0
>    gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x0
> +  gArmVirtTokenSpaceGuid.PcdArmGicRevision|0x0
>
>    ## PL031 RealTimeClock
>    gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0
> diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc
> index 3a53debedd2c..b4007ff3c6a4 100644
> --- a/ArmVirtPkg/ArmVirtXen.dsc
> +++ b/ArmVirtPkg/ArmVirtXen.dsc
> @@ -127,6 +127,7 @@ [PcdsDynamicDefault.common]
>    gArmTokenSpaceGuid.PcdGicDistributorBase|0x0
>    gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x0
>    gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x0
> +  gArmVirtTokenSpaceGuid.PcdArmGicRevision|0x0
>
>    ## PL031 RealTimeClock
>    gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0
> diff --git a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c 
> b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c
> index c9a181a871b8..73db63078ffb 100644
> --- a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c
> +++ b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.c
> @@ -441,6 +441,7 @@ InitializeVirtFdtDxe (
>
>        PcdSet32 (PcdGicDistributorBase, (UINT32)DistBase);
>        PcdSet32 (PcdGicInterruptInterfaceBase, (UINT32)CpuBase);
> +      PcdSet32 (PcdArmGicRevision, 2);
>
>        DEBUG ((EFI_D_INFO, "Found GIC @ 0x%Lx/0x%Lx\n", DistBase, CpuBase));
>        break;
> @@ -470,6 +471,7 @@ InitializeVirtFdtDxe (
>
>        PcdSet32 (PcdGicDistributorBase, (UINT32)DistBase);
>        PcdSet32 (PcdGicRedistributorsBase, (UINT32)RedistBase);
> +      PcdSet32 (PcdArmGicRevision, 3);
>
>        DEBUG ((EFI_D_INFO, "Found GIC v3 (re)distributor @ 0x%Lx (0x%Lx)\n",
>          DistBase, RedistBase));
> diff --git a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf 
> b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
> index 3477db039f93..657b4e88019d 100644
> --- a/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
> +++ b/ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
> @@ -53,6 +53,7 @@ [Pcd]
>    gArmVirtTokenSpaceGuid.PcdArmPsciMethod
>    gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress
>    gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress
> +  gArmVirtTokenSpaceGuid.PcdArmGicRevision
>    gArmTokenSpaceGuid.PcdGicDistributorBase
>    gArmTokenSpaceGuid.PcdGicRedistributorsBase
>    gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase
> --
> 1.9.1
>
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to