[Skiboot] [RFC PATCH 4/7] VAS: Define vas_get_hvwc_mmio_bar interface

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Sat Nov 12 03:56:52 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>
---
 core/vas.c    |    9 +++++++++
 include/vas.h |    1 +
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/core/vas.c b/core/vas.c
index 47556a0..d3c35ca 100644
--- a/core/vas.c
+++ b/core/vas.c
@@ -29,6 +29,15 @@ static 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 uint64_t vas_get_hvwc_mmio_bar(const int chipid)
+{
+	if (!vas_initialized)
+		return 0ULL;
+
+	return get_hvwc_mmio_bar(chipid);
+}
+
 static 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 ab1064a..b38b1fd 100644
--- a/include/vas.h
+++ b/include/vas.h
@@ -34,6 +34,7 @@
  */
 
 extern void init_vas(void);
+extern __attrconst uint64_t vas_get_hvwc_mmio_bar(const int chipid);
 
 /*
  * HVWC and UWC BAR.
-- 
1.7.1



More information about the Skiboot mailing list