Browse Source

Silicon/NXP: LS1043A: Add SocGetSvr API

Add SocGetSvr API to get the System Version Register(SVR)

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Wasim Khan 4 years ago
parent
commit
68dd864ca1
2 changed files with 21 additions and 0 deletions
  1. 7 0
      Silicon/NXP/Include/Library/SocLib.h
  2. 14 0
      Silicon/NXP/LS1043A/Library/SocLib/SocLib.c

+ 7 - 0
Silicon/NXP/Include/Library/SocLib.h

@@ -49,4 +49,11 @@ SocInit (
   VOID
   );
 
+/**
+  Function to get System Version Register(SVR) of SoC
+**/
+UINT32
+SocGetSvr (
+  VOID
+  );
 #endif // SOC_LIB_H__

+ 14 - 0
Silicon/NXP/LS1043A/Library/SocLib/SocLib.c

@@ -63,6 +63,20 @@ SocGetClock (
   return ReturnValue;
 }
 
+/**
+  Function to get SoC's System Version Register(SVR)
+ **/
+UINT32
+SocGetSvr (
+  VOID
+  )
+{
+  LS1043A_DEVICE_CONFIG  *DeviceConfig;
+
+  DeviceConfig = (LS1043A_DEVICE_CONFIG  *)LS1043A_DCFG_ADDRESS;
+  return DcfgRead32 ((UINTN)&DeviceConfig->Svr);
+}
+
 /**
   Function to initialize SoC specific constructs
  **/