[Skiboot] [RFC PATCH 5/7] VAS: Define vas_get_wcbs_bar interface
Sukadev Bhattiprolu
sukadev at linux.vnet.ibm.com
Sat Nov 12 03:56:53 AEDT 2016
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.
Rather than caching the allocated WCBS buffer in memmory, we read it
back from the WC register we wrote it to.
Signed-off-by: Sukadev Bhattiprolu <sukadev at linux.vnet.ibm.com>
---
core/vas.c | 21 +++++++++++++++++++++
include/vas.h | 1 +
2 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/core/vas.c b/core/vas.c
index d3c35ca..a4c5948 100644
--- a/core/vas.c
+++ b/core/vas.c
@@ -59,6 +59,27 @@ static inline int vas_scom_read(struct proc_chip *chip, uint64_t reg,
return xscom_read(chip->id, compute_vas_scom_addr(reg), val);
}
+/* Interface for NX - make sure VAS is fully initialized first */
+__attrconst uint64_t vas_get_wcbs_bar(int chipid)
+{
+ struct proc_chip *chip;
+ uint64_t wcbs;
+ int rc;
+
+ if (!vas_initialized)
+ return 0ULL;
+
+ chip = get_chip(chipid);
+ if (!chip)
+ return 0ULL;
+
+ rc = vas_scom_read(chip, VAS_WCBS_BAR, &wcbs);
+ if (rc)
+ return 0ULL;
+
+ return 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 b38b1fd..1398db3 100644
--- a/include/vas.h
+++ b/include/vas.h
@@ -35,6 +35,7 @@
extern void init_vas(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.
--
1.7.1
More information about the Skiboot
mailing list