diff mbox

[Linaro-uefi,v4,49/56] Hisilicon/SMBIOS: Update ProcessorID from MIDR

Message ID 1479544691-59575-50-git-send-email-heyi.guo@linaro.org
State Superseded
Headers show

Commit Message

gary guo Nov. 19, 2016, 8:38 a.m. UTC
There is no register restore processor id at
ARM Platform,we talked with ARM Charles and made a agreement
that we can use MIDR instead,maybe there will be a specific register
to read the processor id in future.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
---
 .../Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c  | 3 +++
 1 file changed, 3 insertions(+)

Comments

Leif Lindholm Nov. 29, 2016, 7:15 p.m. UTC | #1
On Sat, Nov 19, 2016 at 04:38:04PM +0800, Heyi Guo wrote:
> There is no register restore processor id at
> ARM Platform,we talked with ARM Charles and made a agreement
> that we can use MIDR instead,maybe there will be a specific register
> to read the processor id in future.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Heyi Guo <heyi.guo@linaro.org>

I think the language in the commit message could be improved, and I'd
appreciate a Reviewed-by: from Charles as well, but in general:

Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

> ---
>  .../Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c  | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> index 07dae5f..005d28f 100644
> --- a/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> +++ b/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
> @@ -490,6 +490,7 @@ AddSmbiosProcessorTypeTable (
>      CHAR16                      *CpuVersion;
>      STRING_REF                  TokenToUpdate;
>  
> +    UINT64                      *ProcessorId;
>      Type4Record         = NULL;
>      ProcessorManuStr    = NULL;
>      ProcessorVersionStr = NULL;
> @@ -614,6 +615,8 @@ AddSmbiosProcessorTypeTable (
>      Type4Record->ProcessorCharacteristics   = ProcessorCharacteristics.Data;
>  
>      Type4Record->ExternalClock              = (UINT16)(ArmReadCntFrq() / 1000 / 1000);
> +    ProcessorId = (UINT64 *)&(Type4Record->ProcessorId);
> +    *ProcessorId = ArmReadMidr();
>  
>      OptionalStrStart = (CHAR8 *) (Type4Record + 1);
>      UnicodeStrToAsciiStr (ProcessorSocketStr, OptionalStrStart);
> -- 
> 1.9.1
>
Charles Garcia-Tobin Dec. 1, 2016, 3:29 p.m. UTC | #2
Hi

Indeed this is what we agreed. Consider it:

Reviewed-by: Charles Garcia-Tobin <charles.garcia-tobin@arm.com>


Cheers

ARM Charles


On 29/11/2016, 19:15, "Leif Lindholm" <leif.lindholm@linaro.org> wrote:

    On Sat, Nov 19, 2016 at 04:38:04PM +0800, Heyi Guo wrote:
    > There is no register restore processor id at

    > ARM Platform,we talked with ARM Charles and made a agreement

    > that we can use MIDR instead,maybe there will be a specific register

    > to read the processor id in future.

    >

    > Contributed-under: TianoCore Contribution Agreement 1.0

    > Signed-off-by: Heyi Guo <heyi.guo@linaro.org>


    I think the language in the commit message could be improved, and I'd
    appreciate a Reviewed-by: from Charles as well, but in general:

    Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>


    > ---

    >  .../Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c  | 3 +++

    >  1 file changed, 3 insertions(+)

    >

    > diff --git a/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c

    > index 07dae5f..005d28f 100644

    > --- a/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c

    > +++ b/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c

    > @@ -490,6 +490,7 @@ AddSmbiosProcessorTypeTable (

    >      CHAR16                      *CpuVersion;

    >      STRING_REF                  TokenToUpdate;

    >

    > +    UINT64                      *ProcessorId;

    >      Type4Record         = NULL;

    >      ProcessorManuStr    = NULL;

    >      ProcessorVersionStr = NULL;

    > @@ -614,6 +615,8 @@ AddSmbiosProcessorTypeTable (

    >      Type4Record->ProcessorCharacteristics   = ProcessorCharacteristics.Data;

    >

    >      Type4Record->ExternalClock              = (UINT16)(ArmReadCntFrq() / 1000 / 1000);

    > +    ProcessorId = (UINT64 *)&(Type4Record->ProcessorId);

    > +    *ProcessorId = ArmReadMidr();

    >

    >      OptionalStrStart = (CHAR8 *) (Type4Record + 1);

    >      UnicodeStrToAsciiStr (ProcessorSocketStr, OptionalStrStart);

    > --

    > 1.9.1

    >



IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
diff mbox

Patch

diff --git a/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c b/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
index 07dae5f..005d28f 100644
--- a/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
+++ b/Chips/Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c
@@ -490,6 +490,7 @@  AddSmbiosProcessorTypeTable (
     CHAR16                      *CpuVersion;
     STRING_REF                  TokenToUpdate;
 
+    UINT64                      *ProcessorId;
     Type4Record         = NULL;
     ProcessorManuStr    = NULL;
     ProcessorVersionStr = NULL;
@@ -614,6 +615,8 @@  AddSmbiosProcessorTypeTable (
     Type4Record->ProcessorCharacteristics   = ProcessorCharacteristics.Data;
 
     Type4Record->ExternalClock              = (UINT16)(ArmReadCntFrq() / 1000 / 1000);
+    ProcessorId = (UINT64 *)&(Type4Record->ProcessorId);
+    *ProcessorId = ArmReadMidr();
 
     OptionalStrStart = (CHAR8 *) (Type4Record + 1);
     UnicodeStrToAsciiStr (ProcessorSocketStr, OptionalStrStart);