[edk2-devel] [PATCH edk2-platforms 4/8] Silicon/NXP: LS1043A: Add SocGetSvr API

Wasim Khan posted 8 patches 4 years, 5 months ago
[edk2-devel] [PATCH edk2-platforms 4/8] Silicon/NXP: LS1043A: Add SocGetSvr API
Posted by Wasim Khan 4 years, 5 months ago
From: Wasim Khan <wasim.khan@nxp.com>

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

Signed-off-by: Wasim Khan <wasim.khan@nxp.com>
---
 Silicon/NXP/Include/Library/SocLib.h        |  7 +++++++
 Silicon/NXP/LS1043A/Library/SocLib/SocLib.c | 14 ++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/Silicon/NXP/Include/Library/SocLib.h b/Silicon/NXP/Include/Library/SocLib.h
index 7b25107e4746..b770671c1331 100644
--- a/Silicon/NXP/Include/Library/SocLib.h
+++ b/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__
diff --git a/Silicon/NXP/LS1043A/Library/SocLib/SocLib.c b/Silicon/NXP/LS1043A/Library/SocLib/SocLib.c
index 39fb4c14e0b9..3ebbf7df4476 100644
--- a/Silicon/NXP/LS1043A/Library/SocLib/SocLib.c
+++ b/Silicon/NXP/LS1043A/Library/SocLib/SocLib.c
@@ -64,6 +64,20 @@ SocGetClock (
 }
 
 /**
+  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
  **/
 VOID
-- 
2.7.4


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#61060): https://edk2.groups.io/g/devel/message/61060
Mute This Topic: https://groups.io/mt/74793017/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-