[v5,6/7] vas: Define vas_get_hvwc_mmio_bar interface

Submitted by Sukadev Bhattiprolu on Jan. 26, 2017, 1:32 a.m.

Details

Message ID 1485394353-30319-7-git-send-email-sukadev@linux.vnet.ibm.com
State Under Review
Headers show

Commit Message

Sukadev Bhattiprolu Jan. 26, 2017, 1:32 a.m.
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(+)

Patch hide | download patch | download mbox

diff --git a/core/vas.c b/core/vas.c
index 688fa0f..a86444e 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.