[Skiboot] [PATCH v6 8/9] vas: Define vas_get_wcbs_bar interface

Sukadev Bhattiprolu sukadev at linux.vnet.ibm.com
Thu May 25 15:02:15 AEST 2017


Implement the function vas_get_wcbs_bar() that returns the Window
Context Backing store address register. NX driver uses this function
to initialize its UMAC Send WC register.

Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
 core/vas.c    | 15 +++++++++++++++
 include/vas.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/core/vas.c b/core/vas.c
index cd7c580..777af5d 100644
--- a/core/vas.c
+++ b/core/vas.c
@@ -82,6 +82,21 @@ __attrconst inline uint64_t vas_get_hvwc_mmio_bar(const int chipid)
 	return addr;
 }
 
+/* Interface for NX - make sure VAS is fully initialized first */
+__attrconst uint64_t vas_get_wcbs_bar(int chipid)
+{
+	struct proc_chip *chip;
+
+	if (!vas_initialized)
+		return 0ULL;
+
+	chip = get_chip(chipid);
+	if (!chip)
+		return 0ULL;
+
+	return chip->vas->wcbs;
+}
+
 static int init_north_ctl(struct proc_chip *chip)
 {
 	uint64_t val = 0ULL;
diff --git a/include/vas.h b/include/vas.h
index c382585..da19645 100644
--- a/include/vas.h
+++ b/include/vas.h
@@ -38,6 +38,7 @@
 
 extern void vas_init(void);
 extern __attrconst uint64_t vas_get_hvwc_mmio_bar(const int chipid);
+extern __attrconst uint64_t vas_get_wcbs_bar(int chipid);
 
 /*
  * HVWC and UWC BAR.
-- 
2.7.4



More information about the Skiboot mailing list