diff mbox

[Linaro-uefi] Platforms/ARM: move AArch64 platforms to generic ResetSystemRuntimeDxe

Message ID 20170703161701.27162-1-leif.lindholm@linaro.org
State Accepted
Commit bbdd9ce612e7cde01fab37217124df1135c856c2
Headers show

Commit Message

Leif Lindholm July 3, 2017, 4:17 p.m. UTC
For historic reasons, ArmVExpress.dsc.inc defaulted to the ArmVExpress
MMIO-based implementation of *Efi*ResetSystemLib - invoked via
EmbeddedPkg/ResetRuntimeDxe.
Since the majority of our platforms are now 64-bit and PSCI-based, flip
this logic to default to the ArmPkg ArmSmcPsciResetSystemLib
implementation of ResetSystemLib - with ARM-targets retaining the old
behaviour.

At the same time update FVP and Juno targets to use the new generic
ResetSystemRuntimeDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 Platforms/ARM/Juno/ArmJuno.dsc                     |  3 +--
 Platforms/ARM/Juno/ArmJuno.fdf                     |  2 +-
 Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc |  2 +-
 Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf |  2 +-
 Platforms/ARM/VExpress/ArmVExpress.dsc.inc         | 13 ++++++-------
 5 files changed, 10 insertions(+), 12 deletions(-)

Comments

Ard Biesheuvel July 3, 2017, 5:36 p.m. UTC | #1
On 3 July 2017 at 17:17, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> For historic reasons, ArmVExpress.dsc.inc defaulted to the ArmVExpress
> MMIO-based implementation of *Efi*ResetSystemLib - invoked via
> EmbeddedPkg/ResetRuntimeDxe.
> Since the majority of our platforms are now 64-bit and PSCI-based, flip
> this logic to default to the ArmPkg ArmSmcPsciResetSystemLib
> implementation of ResetSystemLib - with ARM-targets retaining the old
> behaviour.
>
> At the same time update FVP and Juno targets to use the new generic
> ResetSystemRuntimeDxe.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>

OK, so you are intentionally keeping the 32-bit platforms on the reset
runtime from EmbeddedPkg, and intend to address that later?

> ---
>  Platforms/ARM/Juno/ArmJuno.dsc                     |  3 +--
>  Platforms/ARM/Juno/ArmJuno.fdf                     |  2 +-
>  Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc |  2 +-
>  Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf |  2 +-
>  Platforms/ARM/VExpress/ArmVExpress.dsc.inc         | 13 ++++++-------
>  5 files changed, 10 insertions(+), 12 deletions(-)
>
> diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc
> index 4ff2246822..bbaaf42aa2 100644
> --- a/Platforms/ARM/Juno/ArmJuno.dsc
> +++ b/Platforms/ARM/Juno/ArmJuno.dsc
> @@ -41,7 +41,6 @@
>
>    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
>    NorFlashPlatformLib|ArmPlatformPkg/ArmJunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
> -  EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
>
>    TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
>    CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> @@ -236,7 +235,7 @@
>    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
>    MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> -  EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> +  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
>    EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
>    EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
>
> diff --git a/Platforms/ARM/Juno/ArmJuno.fdf b/Platforms/ARM/Juno/ArmJuno.fdf
> index 7de995a255..61d4f616f4 100644
> --- a/Platforms/ARM/Juno/ArmJuno.fdf
> +++ b/Platforms/ARM/Juno/ArmJuno.fdf
> @@ -97,7 +97,7 @@ FvNameGuid         = B73FE497-B92E-416e-8326-45AD0D270092
>    INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
>    INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
>    INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> -  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> +  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
>    INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
>    INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
>
> diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
> index 1e95971cdd..d194af5f91 100644
> --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
> +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
> @@ -240,7 +240,7 @@
>    }
>    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> -  EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> +  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
>    EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
>    EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
>
> diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
> index 39fa325163..906364723c 100644
> --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
> +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
> @@ -89,7 +89,7 @@ FvNameGuid         = 87940482-fc81-41c3-87e6-399cf85ac8a0
>    INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
>    INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
>    INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> -  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> +  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
>    INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
>    INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
>
> diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
> index 0bad7c963c..3f6e50573c 100644
> --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
> +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
> @@ -83,7 +83,7 @@
>    PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
>    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
>    NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
> -  EfiResetSystemLib|ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
> +  ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
>  !ifdef EDK2_ENABLE_PL111
>    # ARM PL111 Lcd Driver
>    LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
> @@ -247,15 +247,14 @@
>    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
>  !endif
>
> -[LibraryClasses.AARCH64.DXE_RUNTIME_DRIVER]
> +[LibraryClasses.ARM]
>    #
>    # PSCI support in EL3 may not be available if we are not running under a PSCI
> -  # compliant secure firmware, but since the default VExpress EfiResetSystemLib
> -  # cannot be supported at runtime (due to the fact that the syscfg MMIO registers
> -  # cannot be runtime remapped), it is our best bet to get ResetSystem functionality
> -  # on these platforms.
> +  # compliant secure firmware. Assume PSCI on AARCH64, and fall back to the
> +  # syscfg MMIO register implementation on ARM.
> +  # This will not work at actual runtime.
>    #
> -  EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
> +  EfiResetSystemLib|ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
>
>  [LibraryClasses.ARM, LibraryClasses.AARCH64]
>    #
> --
> 2.11.0
>
Leif Lindholm July 3, 2017, 6:49 p.m. UTC | #2
On Mon, Jul 03, 2017 at 06:36:14PM +0100, Ard Biesheuvel wrote:
> On 3 July 2017 at 17:17, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> > For historic reasons, ArmVExpress.dsc.inc defaulted to the ArmVExpress
> > MMIO-based implementation of *Efi*ResetSystemLib - invoked via
> > EmbeddedPkg/ResetRuntimeDxe.
> > Since the majority of our platforms are now 64-bit and PSCI-based, flip
> > this logic to default to the ArmPkg ArmSmcPsciResetSystemLib
> > implementation of ResetSystemLib - with ARM-targets retaining the old
> > behaviour.
> >
> > At the same time update FVP and Juno targets to use the new generic
> > ResetSystemRuntimeDxe.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> 
> OK, so you are intentionally keeping the 32-bit platforms on the reset
> runtime from EmbeddedPkg, and intend to address that later?

Correct.
Doing that at the same time felt ... messy.

/
    Leif

> > ---
> >  Platforms/ARM/Juno/ArmJuno.dsc                     |  3 +--
> >  Platforms/ARM/Juno/ArmJuno.fdf                     |  2 +-
> >  Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc |  2 +-
> >  Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf |  2 +-
> >  Platforms/ARM/VExpress/ArmVExpress.dsc.inc         | 13 ++++++-------
> >  5 files changed, 10 insertions(+), 12 deletions(-)
> >
> > diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc
> > index 4ff2246822..bbaaf42aa2 100644
> > --- a/Platforms/ARM/Juno/ArmJuno.dsc
> > +++ b/Platforms/ARM/Juno/ArmJuno.dsc
> > @@ -41,7 +41,6 @@
> >
> >    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
> >    NorFlashPlatformLib|ArmPlatformPkg/ArmJunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
> > -  EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
> >
> >    TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
> >    CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
> > @@ -236,7 +235,7 @@
> >    MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> >    MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> >    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> > -  EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> > +  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> >    EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> >    EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
> >
> > diff --git a/Platforms/ARM/Juno/ArmJuno.fdf b/Platforms/ARM/Juno/ArmJuno.fdf
> > index 7de995a255..61d4f616f4 100644
> > --- a/Platforms/ARM/Juno/ArmJuno.fdf
> > +++ b/Platforms/ARM/Juno/ArmJuno.fdf
> > @@ -97,7 +97,7 @@ FvNameGuid         = B73FE497-B92E-416e-8326-45AD0D270092
> >    INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
> >    INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
> >    INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> > -  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> > +  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> >    INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> >    INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
> >
> > diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
> > index 1e95971cdd..d194af5f91 100644
> > --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
> > +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
> > @@ -240,7 +240,7 @@
> >    }
> >    MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> >    MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> > -  EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> > +  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> >    EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> >    EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
> >
> > diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
> > index 39fa325163..906364723c 100644
> > --- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
> > +++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
> > @@ -89,7 +89,7 @@ FvNameGuid         = 87940482-fc81-41c3-87e6-399cf85ac8a0
> >    INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
> >    INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
> >    INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
> > -  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
> > +  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
> >    INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
> >    INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
> >
> > diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
> > index 0bad7c963c..3f6e50573c 100644
> > --- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
> > +++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
> > @@ -83,7 +83,7 @@
> >    PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
> >    ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
> >    NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
> > -  EfiResetSystemLib|ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
> > +  ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
> >  !ifdef EDK2_ENABLE_PL111
> >    # ARM PL111 Lcd Driver
> >    LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
> > @@ -247,15 +247,14 @@
> >    BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
> >  !endif
> >
> > -[LibraryClasses.AARCH64.DXE_RUNTIME_DRIVER]
> > +[LibraryClasses.ARM]
> >    #
> >    # PSCI support in EL3 may not be available if we are not running under a PSCI
> > -  # compliant secure firmware, but since the default VExpress EfiResetSystemLib
> > -  # cannot be supported at runtime (due to the fact that the syscfg MMIO registers
> > -  # cannot be runtime remapped), it is our best bet to get ResetSystem functionality
> > -  # on these platforms.
> > +  # compliant secure firmware. Assume PSCI on AARCH64, and fall back to the
> > +  # syscfg MMIO register implementation on ARM.
> > +  # This will not work at actual runtime.
> >    #
> > -  EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
> > +  EfiResetSystemLib|ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
> >
> >  [LibraryClasses.ARM, LibraryClasses.AARCH64]
> >    #
> > --
> > 2.11.0
> >
Ard Biesheuvel July 3, 2017, 9:19 p.m. UTC | #3
On 3 July 2017 at 19:49, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> On Mon, Jul 03, 2017 at 06:36:14PM +0100, Ard Biesheuvel wrote:
>> On 3 July 2017 at 17:17, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>> > For historic reasons, ArmVExpress.dsc.inc defaulted to the ArmVExpress
>> > MMIO-based implementation of *Efi*ResetSystemLib - invoked via
>> > EmbeddedPkg/ResetRuntimeDxe.
>> > Since the majority of our platforms are now 64-bit and PSCI-based, flip
>> > this logic to default to the ArmPkg ArmSmcPsciResetSystemLib
>> > implementation of ResetSystemLib - with ARM-targets retaining the old
>> > behaviour.
>> >
>> > At the same time update FVP and Juno targets to use the new generic
>> > ResetSystemRuntimeDxe.
>> >
>> > Contributed-under: TianoCore Contribution Agreement 1.0
>> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
>>
>> OK, so you are intentionally keeping the 32-bit platforms on the reset
>> runtime from EmbeddedPkg, and intend to address that later?
>
> Correct.
> Doing that at the same time felt ... messy.
>

Fair enough

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Ryan Harkin July 4, 2017, 9:35 a.m. UTC | #4
On 3 July 2017 at 22:19, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> On 3 July 2017 at 19:49, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>> On Mon, Jul 03, 2017 at 06:36:14PM +0100, Ard Biesheuvel wrote:
>>> On 3 July 2017 at 17:17, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>>> > For historic reasons, ArmVExpress.dsc.inc defaulted to the ArmVExpress
>>> > MMIO-based implementation of *Efi*ResetSystemLib - invoked via
>>> > EmbeddedPkg/ResetRuntimeDxe.
>>> > Since the majority of our platforms are now 64-bit and PSCI-based, flip
>>> > this logic to default to the ArmPkg ArmSmcPsciResetSystemLib
>>> > implementation of ResetSystemLib - with ARM-targets retaining the old
>>> > behaviour.
>>> >
>>> > At the same time update FVP and Juno targets to use the new generic
>>> > ResetSystemRuntimeDxe.
>>> >
>>> > Contributed-under: TianoCore Contribution Agreement 1.0
>>> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
>>>
>>> OK, so you are intentionally keeping the 32-bit platforms on the reset
>>> runtime from EmbeddedPkg, and intend to address that later?
>>
>> Correct.
>> Doing that at the same time felt ... messy.
>>
>
> Fair enough
>
> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Fine with me too. I haven't tested it, but it looks safe enough.

Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>
Leif Lindholm July 4, 2017, 10:38 a.m. UTC | #5
On Tue, Jul 04, 2017 at 10:35:06AM +0100, Ryan Harkin wrote:
> On 3 July 2017 at 22:19, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> > On 3 July 2017 at 19:49, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> >> On Mon, Jul 03, 2017 at 06:36:14PM +0100, Ard Biesheuvel wrote:
> >>> On 3 July 2017 at 17:17, Leif Lindholm <leif.lindholm@linaro.org> wrote:
> >>> > For historic reasons, ArmVExpress.dsc.inc defaulted to the ArmVExpress
> >>> > MMIO-based implementation of *Efi*ResetSystemLib - invoked via
> >>> > EmbeddedPkg/ResetRuntimeDxe.
> >>> > Since the majority of our platforms are now 64-bit and PSCI-based, flip
> >>> > this logic to default to the ArmPkg ArmSmcPsciResetSystemLib
> >>> > implementation of ResetSystemLib - with ARM-targets retaining the old
> >>> > behaviour.
> >>> >
> >>> > At the same time update FVP and Juno targets to use the new generic
> >>> > ResetSystemRuntimeDxe.
> >>> >
> >>> > Contributed-under: TianoCore Contribution Agreement 1.0
> >>> > Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org>
> >>>
> >>> OK, so you are intentionally keeping the 32-bit platforms on the reset
> >>> runtime from EmbeddedPkg, and intend to address that later?
> >>
> >> Correct.
> >> Doing that at the same time felt ... messy.
> >>
> >
> > Fair enough
> >
> > Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> 
> Fine with me too. I haven't tested it, but it looks safe enough.
> 
> Reviewed-by: Ryan Harkin <ryan.harkin@linaro.org>

Thanks guys.
Pushed as bbdd9ce612.

/
    Leif
diff mbox

Patch

diff --git a/Platforms/ARM/Juno/ArmJuno.dsc b/Platforms/ARM/Juno/ArmJuno.dsc
index 4ff2246822..bbaaf42aa2 100644
--- a/Platforms/ARM/Juno/ArmJuno.dsc
+++ b/Platforms/ARM/Juno/ArmJuno.dsc
@@ -41,7 +41,6 @@ 
 
   ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
   NorFlashPlatformLib|ArmPlatformPkg/ArmJunoPkg/Library/NorFlashJunoLib/NorFlashJunoLib.inf
-  EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
 
   TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
   CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
@@ -236,7 +235,7 @@ 
   MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
   MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-  EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
+  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
 
diff --git a/Platforms/ARM/Juno/ArmJuno.fdf b/Platforms/ARM/Juno/ArmJuno.fdf
index 7de995a255..61d4f616f4 100644
--- a/Platforms/ARM/Juno/ArmJuno.fdf
+++ b/Platforms/ARM/Juno/ArmJuno.fdf
@@ -97,7 +97,7 @@  FvNameGuid         = B73FE497-B92E-416e-8326-45AD0D270092
   INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
   INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
   INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
+  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
   INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
 
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
index 1e95971cdd..d194af5f91 100644
--- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
+++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.dsc
@@ -240,7 +240,7 @@ 
   }
   MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-  EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
+  MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
   EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
 
diff --git a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
index 39fa325163..906364723c 100644
--- a/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
+++ b/Platforms/ARM/VExpress/ArmVExpress-FVP-AArch64.fdf
@@ -89,7 +89,7 @@  FvNameGuid         = 87940482-fc81-41c3-87e6-399cf85ac8a0
   INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
   INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
   INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
-  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
+  INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf
   INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
   INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
 
diff --git a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
index 0bad7c963c..3f6e50573c 100644
--- a/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
+++ b/Platforms/ARM/VExpress/ArmVExpress.dsc.inc
@@ -83,7 +83,7 @@ 
   PlatformPeiLib|ArmPlatformPkg/PlatformPei/PlatformPeiLib.inf
   ArmPlatformSysConfigLib|ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressSysConfigLib/ArmVExpressSysConfigLib.inf
   NorFlashPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/NorFlashArmVExpressLib/NorFlashArmVExpressLib.inf
-  EfiResetSystemLib|ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
+  ResetSystemLib|ArmPkg/Library/ArmSmcPsciResetSystemLib/ArmSmcPsciResetSystemLib.inf
 !ifdef EDK2_ENABLE_PL111
   # ARM PL111 Lcd Driver
   LcdPlatformLib|ArmPlatformPkg/ArmVExpressPkg/Library/PL111LcdArmVExpressLib/PL111LcdArmVExpressLib.inf
@@ -247,15 +247,14 @@ 
   BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf
 !endif
 
-[LibraryClasses.AARCH64.DXE_RUNTIME_DRIVER]
+[LibraryClasses.ARM]
   #
   # PSCI support in EL3 may not be available if we are not running under a PSCI
-  # compliant secure firmware, but since the default VExpress EfiResetSystemLib
-  # cannot be supported at runtime (due to the fact that the syscfg MMIO registers
-  # cannot be runtime remapped), it is our best bet to get ResetSystem functionality
-  # on these platforms.
+  # compliant secure firmware. Assume PSCI on AARCH64, and fall back to the
+  # syscfg MMIO register implementation on ARM.
+  # This will not work at actual runtime.
   #
-  EfiResetSystemLib|ArmPkg/Library/ArmPsciResetSystemLib/ArmPsciResetSystemLib.inf
+  EfiResetSystemLib|ArmPlatformPkg/ArmVExpressPkg/Library/ResetSystemLib/ResetSystemLib.inf
 
 [LibraryClasses.ARM, LibraryClasses.AARCH64]
   #