[Skiboot] [PATCH v4 3/5] VAS: Define vas_get_hvwc_mmio_bar interface

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Wed Dec 14 08:55:02 AEDT 2016


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 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.
-- 
2.7.4



More information about the Skiboot mailing list