[edk2] [PATCH] ArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware

2016-04-19 Thread Ard Biesheuvel
When combining UEFI firmware built from Tianocore with ARM Trusted
Firmware running in EL3, it is the responsibility of ATF that only
a single core enters the UEFI firmware in EL2, and the remaining cores
are released directly to the OS via PSCI SMC calls.

In this case, we don't need the MpCore flavor of PrePi or PrePeiCore,
but the UniCore flavor currently checks the CPU identification registers
directly, and refuses to proceed if the boot CPU is part of a MpCore
system.

So drop the ASSERT()'s that implement this check.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel 
---
 ArmPlatformPkg/PrePi/MainUniCore.c | 5 -
 ArmPlatformPkg/PrePi/PrePi.c   | 2 --
 2 files changed, 7 deletions(-)

diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c 
b/ArmPlatformPkg/PrePi/MainUniCore.c
index 49b02338ebc2..11b9f462bb48 100644
--- a/ArmPlatformPkg/PrePi/MainUniCore.c
+++ b/ArmPlatformPkg/PrePi/MainUniCore.c
@@ -21,11 +21,6 @@ PrimaryMain (
   IN  UINT64StartTimeStamp
   )
 {
-  DEBUG_CODE_BEGIN();
-// On MPCore system, PeiMpCore.inf should be used instead of PeiUniCore.inf
-ASSERT(ArmIsMpCore() == 0);
-  DEBUG_CODE_END();
-
   PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
 
   // We must never return
diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
index 8740b2a9e84d..36928c65a73b 100644
--- a/ArmPlatformPkg/PrePi/PrePi.c
+++ b/ArmPlatformPkg/PrePi/PrePi.c
@@ -183,8 +183,6 @@ CEntryPoint (
 {
   UINT64   StartTimeStamp;
 
-  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));
-
   // Initialize the platform specific controllers
   ArmPlatformInitialize (MpId);
 
-- 
2.5.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware

2016-04-28 Thread Ard Biesheuvel
On 19 April 2016 at 09:26, Ard Biesheuvel  wrote:
> When combining UEFI firmware built from Tianocore with ARM Trusted
> Firmware running in EL3, it is the responsibility of ATF that only
> a single core enters the UEFI firmware in EL2, and the remaining cores
> are released directly to the OS via PSCI SMC calls.
>
> In this case, we don't need the MpCore flavor of PrePi or PrePeiCore,
> but the UniCore flavor currently checks the CPU identification registers
> directly, and refuses to proceed if the boot CPU is part of a MpCore
> system.
>
> So drop the ASSERT()'s that implement this check.
>

We will need something like this for PrePeiCore so that we can move Husky to it

> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  ArmPlatformPkg/PrePi/MainUniCore.c | 5 -
>  ArmPlatformPkg/PrePi/PrePi.c   | 2 --
>  2 files changed, 7 deletions(-)
>
> diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c 
> b/ArmPlatformPkg/PrePi/MainUniCore.c
> index 49b02338ebc2..11b9f462bb48 100644
> --- a/ArmPlatformPkg/PrePi/MainUniCore.c
> +++ b/ArmPlatformPkg/PrePi/MainUniCore.c
> @@ -21,11 +21,6 @@ PrimaryMain (
>IN  UINT64StartTimeStamp
>)
>  {
> -  DEBUG_CODE_BEGIN();
> -// On MPCore system, PeiMpCore.inf should be used instead of 
> PeiUniCore.inf
> -ASSERT(ArmIsMpCore() == 0);
> -  DEBUG_CODE_END();
> -
>PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
>
>// We must never return
> diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
> index 8740b2a9e84d..36928c65a73b 100644
> --- a/ArmPlatformPkg/PrePi/PrePi.c
> +++ b/ArmPlatformPkg/PrePi/PrePi.c
> @@ -183,8 +183,6 @@ CEntryPoint (
>  {
>UINT64   StartTimeStamp;
>
> -  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));
> -
>// Initialize the platform specific controllers
>ArmPlatformInitialize (MpId);
>
> --
> 2.5.0
>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware

2016-04-28 Thread Leif Lindholm
On Thu, Apr 28, 2016 at 05:02:19PM +0200, Ard Biesheuvel wrote:
> On 19 April 2016 at 09:26, Ard Biesheuvel  wrote:
> > When combining UEFI firmware built from Tianocore with ARM Trusted
> > Firmware running in EL3, it is the responsibility of ATF that only
> > a single core enters the UEFI firmware in EL2, and the remaining cores
> > are released directly to the OS via PSCI SMC calls.
> >
> > In this case, we don't need the MpCore flavor of PrePi or PrePeiCore,
> > but the UniCore flavor currently checks the CPU identification registers
> > directly, and refuses to proceed if the boot CPU is part of a MpCore
> > system.
> >
> > So drop the ASSERT()'s that implement this check.
> >
> 
> We will need something like this for PrePeiCore so that we can move Husky to 
> it

Yeah, sorry - was getting stuck considering what to do at the MP side,
but that really is a completely separate thing.

Apart from the name no longer making sense:
Reviewed-by: Leif Lindholm 

> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Ard Biesheuvel 
> > ---
> >  ArmPlatformPkg/PrePi/MainUniCore.c | 5 -
> >  ArmPlatformPkg/PrePi/PrePi.c   | 2 --
> >  2 files changed, 7 deletions(-)
> >
> > diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c 
> > b/ArmPlatformPkg/PrePi/MainUniCore.c
> > index 49b02338ebc2..11b9f462bb48 100644
> > --- a/ArmPlatformPkg/PrePi/MainUniCore.c
> > +++ b/ArmPlatformPkg/PrePi/MainUniCore.c
> > @@ -21,11 +21,6 @@ PrimaryMain (
> >IN  UINT64StartTimeStamp
> >)
> >  {
> > -  DEBUG_CODE_BEGIN();
> > -// On MPCore system, PeiMpCore.inf should be used instead of 
> > PeiUniCore.inf
> > -ASSERT(ArmIsMpCore() == 0);
> > -  DEBUG_CODE_END();
> > -
> >PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
> >
> >// We must never return
> > diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
> > index 8740b2a9e84d..36928c65a73b 100644
> > --- a/ArmPlatformPkg/PrePi/PrePi.c
> > +++ b/ArmPlatformPkg/PrePi/PrePi.c
> > @@ -183,8 +183,6 @@ CEntryPoint (
> >  {
> >UINT64   StartTimeStamp;
> >
> > -  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));
> > -
> >// Initialize the platform specific controllers
> >ArmPlatformInitialize (MpId);
> >
> > --
> > 2.5.0
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ArmPlatformPkg/PrePi: allow unicore version to be used on MP hardware

2016-04-29 Thread Ard Biesheuvel
On 28 April 2016 at 17:29, Leif Lindholm  wrote:
> On Thu, Apr 28, 2016 at 05:02:19PM +0200, Ard Biesheuvel wrote:
>> On 19 April 2016 at 09:26, Ard Biesheuvel  wrote:
>> > When combining UEFI firmware built from Tianocore with ARM Trusted
>> > Firmware running in EL3, it is the responsibility of ATF that only
>> > a single core enters the UEFI firmware in EL2, and the remaining cores
>> > are released directly to the OS via PSCI SMC calls.
>> >
>> > In this case, we don't need the MpCore flavor of PrePi or PrePeiCore,
>> > but the UniCore flavor currently checks the CPU identification registers
>> > directly, and refuses to proceed if the boot CPU is part of a MpCore
>> > system.
>> >
>> > So drop the ASSERT()'s that implement this check.
>> >
>>
>> We will need something like this for PrePeiCore so that we can move Husky to 
>> it
>
> Yeah, sorry - was getting stuck considering what to do at the MP side,
> but that really is a completely separate thing.
>
> Apart from the name no longer making sense:
> Reviewed-by: Leif Lindholm 
>

Pushed as well

>> > Contributed-under: TianoCore Contribution Agreement 1.0
>> > Signed-off-by: Ard Biesheuvel 
>> > ---
>> >  ArmPlatformPkg/PrePi/MainUniCore.c | 5 -
>> >  ArmPlatformPkg/PrePi/PrePi.c   | 2 --
>> >  2 files changed, 7 deletions(-)
>> >
>> > diff --git a/ArmPlatformPkg/PrePi/MainUniCore.c 
>> > b/ArmPlatformPkg/PrePi/MainUniCore.c
>> > index 49b02338ebc2..11b9f462bb48 100644
>> > --- a/ArmPlatformPkg/PrePi/MainUniCore.c
>> > +++ b/ArmPlatformPkg/PrePi/MainUniCore.c
>> > @@ -21,11 +21,6 @@ PrimaryMain (
>> >IN  UINT64StartTimeStamp
>> >)
>> >  {
>> > -  DEBUG_CODE_BEGIN();
>> > -// On MPCore system, PeiMpCore.inf should be used instead of 
>> > PeiUniCore.inf
>> > -ASSERT(ArmIsMpCore() == 0);
>> > -  DEBUG_CODE_END();
>> > -
>> >PrePiMain (UefiMemoryBase, StacksBase, StartTimeStamp);
>> >
>> >// We must never return
>> > diff --git a/ArmPlatformPkg/PrePi/PrePi.c b/ArmPlatformPkg/PrePi/PrePi.c
>> > index 8740b2a9e84d..36928c65a73b 100644
>> > --- a/ArmPlatformPkg/PrePi/PrePi.c
>> > +++ b/ArmPlatformPkg/PrePi/PrePi.c
>> > @@ -183,8 +183,6 @@ CEntryPoint (
>> >  {
>> >UINT64   StartTimeStamp;
>> >
>> > -  ASSERT(!ArmIsMpCore() || (PcdGet32 (PcdCoreCount) > 1));
>> > -
>> >// Initialize the platform specific controllers
>> >ArmPlatformInitialize (MpId);
>> >
>> > --
>> > 2.5.0
>> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel