diff mbox

[v4,3/5] VAS: Define vas_get_hvwc_mmio_bar interface

Message ID 1481666104-17832-4-git-send-email-sukadev@linux.vnet.ibm.com
State Superseded
Headers show

Commit Message

Sukadev Bhattiprolu Dec. 13, 2016, 9:55 p.m. UTC
The nest accelerator (NX) will need this interface to initialize its
UMAC MMIO BAR.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
Changelog[v4]:
	[Balbir Singh] Make the new interface inline.
---
 core/vas.c    | 9 +++++++++
 include/vas.h | 1 +
 2 files changed, 10 insertions(+)
diff mbox

Patch

diff --git a/core/vas.c b/core/vas.c
index cde1658..b9077ec 100644
--- a/core/vas.c
+++ b/core/vas.c
@@ -33,6 +33,15 @@  static inline uint64_t get_hvwc_mmio_bar(const int chipid)
 	return VAS_HVWC_MMIO_BAR_BASE + chipid * VAS_HVWC_MMIO_BAR_SIZE;
 }
 
+/* Interface for NX - make sure VAS is fully initialized first */
+__attrconst inline uint64_t vas_get_hvwc_mmio_bar(const int chipid)
+{
+	if (!vas_initialized)
+		return 0ULL;
+
+	return get_hvwc_mmio_bar(chipid);
+}
+
 static inline uint64_t get_uwc_mmio_bar(int chipid)
 {
 	return VAS_UWC_MMIO_BAR_BASE + chipid * VAS_UWC_MMIO_BAR_SIZE;
diff --git a/include/vas.h b/include/vas.h
index 56e8a13..904c663 100644
--- a/include/vas.h
+++ b/include/vas.h
@@ -37,6 +37,7 @@ 
  */
 
 extern void vas_init(void);
+extern __attrconst uint64_t vas_get_hvwc_mmio_bar(const int chipid);
 
 /*
  * HVWC and UWC BAR.