diff mbox

[Linaro-uefi,linaro-uefi,v7,24/38] Hisilicon/SMBIOS: Update ProcessorID from MIDR

Message ID 1481111375-71058-25-git-send-email-heyi.guo@linaro.org
State Accepted
Commit 9c79eeef9f7ac124176e1c104f80fc088b57b8db
Headers show

Commit Message

gary guo Dec. 7, 2016, 11:49 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>
Reviewed-by: Charles Garcia-Tobin <charles.garcia-tobin@arm.com>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
---
 .../Hisilicon/Drivers/Smbios/ProcessorSubClassDxe/ProcessorSubClass.c  | 3 +++
 1 file changed, 3 insertions(+)
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);