[Skiboot] [PATCH v3 3/6] VAS: Define vas_get_hvwc_mmio_bar interface

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Wed Nov 30 16:36:26 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(+)

diff --git a/core/vas.c b/core/vas.c
index 2b3d8dd..cf752ca 100644
--- a/core/vas.c
+++ b/core/vas.c
@@ -37,6 +37,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 6df58c8..3f43b42 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.
-- 
2.7.4



More information about the Skiboot mailing list