[Skiboot] [PATCH v5 6/7] vas: Define vas_get_hvwc_mmio_bar interface

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Thu Jan 26 12:32:32 AEDT 2017


The nest accelerator (NX) will need this interface to initialize its
UMAC MMIO BAR.

Signed-off-by: Sukadev Bhattiprolu <sukadev at 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 --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.
-- 
2.7.4



More information about the Skiboot mailing list