[Skiboot] [PATCH 14/33] XIVE: Base XIVE support for OPAL XICS emulation calls

Stewart Smith stewart at linux.vnet.ibm.com
Wed Jul 6 17:48:17 AEST 2016


Benjamin Herrenschmidt <benh at kernel.crashing.org> writes:
> This provides basic initialization of the XIVE along with some OPAL calls
> to emulate an old-style XICS which will initially be used by Linux for
> backward compatibility.
>
> diff --git a/include/opal-api.h b/include/opal-api.h
> index 917d751..fa76b8d 100644
> --- a/include/opal-api.h
> +++ b/include/opal-api.h
> @@ -167,7 +167,11 @@
>  #define OPAL_PCI_GET_PRESENCE_STATE		119
>  #define OPAL_PCI_GET_POWER_STATE		120
>  #define OPAL_PCI_SET_POWER_STATE		121
> -#define OPAL_LAST				121
> +#define OPAL_INT_GET_XIRR			122
> +#define	OPAL_INT_SET_CPPR			123
> +#define OPAL_INT_EOI				124
> +#define OPAL_INT_SET_MFRR			125
> +#define OPAL_LAST				125

I've pulled in this section of opal-api.h into master now, along with
some skeleton docs. Below is what I pulled in as of 1bd1063a. So, this
should be good enough to go get kernel things merged, as the API looks
mostly sensible enough (well, making it look like PAPR is probably the right
thing).

[PATCH] Reserve OPAL API numbers for XICS emulation for XIVE

Additionally, we put in some skeleton docs for what's coming,
key points being that this is for P9 and above, relies on a device
being present in the device tree and is modelled on the PAPR calls.

Suggested-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Signed-off-by: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 doc/opal-api/opal-int-eoi-124.txt      | 15 +++++++++++++++
 doc/opal-api/opal-int-get-xirr-122.txt | 15 +++++++++++++++
 doc/opal-api/opal-int-set-cppr-123.txt | 16 ++++++++++++++++
 doc/opal-api/opal-int-set-mfrr-125.txt | 15 +++++++++++++++
 include/opal-api.h                     |  6 +++++-
 5 files changed, 66 insertions(+), 1 deletion(-)
 create mode 100644 doc/opal-api/opal-int-eoi-124.txt
 create mode 100644 doc/opal-api/opal-int-get-xirr-122.txt
 create mode 100644 doc/opal-api/opal-int-set-cppr-123.txt
 create mode 100644 doc/opal-api/opal-int-set-mfrr-125.txt

diff --git a/doc/opal-api/opal-int-eoi-124.txt b/doc/opal-api/opal-int-eoi-124.txt
new file mode 100644
index 0000000..9405018
--- /dev/null
+++ b/doc/opal-api/opal-int-eoi-124.txt
@@ -0,0 +1,15 @@
+OPAL_INT_EOI
+------------
+
+static int64_t opal_xive_eoi(uint32_t xirr)
+
+Not yet implemented.
+
+Modelled on the H_EOI PAPR call.
+
+For P9 and above systems where host doesn't know about interrupt controller.
+An OS can instead make OPAL calls for XICS emulation.
+
+For an OS to use this OPAL call, an "ibm,opal-intc" compatible device must
+exist in the device tree. If OPAL does not create such a device, the host
+OS MUST NOT use this call.
diff --git a/doc/opal-api/opal-int-get-xirr-122.txt b/doc/opal-api/opal-int-get-xirr-122.txt
new file mode 100644
index 0000000..efa86d5
--- /dev/null
+++ b/doc/opal-api/opal-int-get-xirr-122.txt
@@ -0,0 +1,15 @@
+OPAL_INT_GET_XIRR
+-----------------
+
+int64_t opal_xive_get_xirr(uint32_t *out_xirr, bool just_poll)
+
+Not yet implemented.
+
+Modelled on the PAPR call.
+
+For P9 and above systems where host doesn't know about interrupt controller.
+An OS can instead make OPAL calls for XICS emulation.
+
+For an OS to use this OPAL call, an "ibm,opal-intc" compatible device must
+exist in the device tree. If OPAL does not create such a device, the host
+OS MUST NOT use this call.
diff --git a/doc/opal-api/opal-int-set-cppr-123.txt b/doc/opal-api/opal-int-set-cppr-123.txt
new file mode 100644
index 0000000..b6858c9
--- /dev/null
+++ b/doc/opal-api/opal-int-set-cppr-123.txt
@@ -0,0 +1,16 @@
+OPAL_INT_SET_CPPR
+-----------------
+
+static int64_t opal_xive_set_cppr(uint8_t cppr)
+
+
+Not yet implemented.
+
+Modelled on the H_CPPR PAPR call.
+
+For P9 and above systems where host doesn't know about interrupt controller.
+An OS can instead make OPAL calls for XICS emulation.
+
+For an OS to use this OPAL call, an "ibm,opal-intc" compatible device must
+exist in the device tree. If OPAL does not create such a device, the host
+OS MUST NOT use this call.
diff --git a/doc/opal-api/opal-int-set-mfrr-125.txt b/doc/opal-api/opal-int-set-mfrr-125.txt
new file mode 100644
index 0000000..64a7506
--- /dev/null
+++ b/doc/opal-api/opal-int-set-mfrr-125.txt
@@ -0,0 +1,15 @@
+OPAL_INT_SET_MFRR
+-----------------
+
+static int64_t opal_xive_set_mfrr(uint32_t cpu, uint8_t mfrr)
+
+Not yet implemented.
+
+Modelled on the H_IPI PAPR call.
+
+For P9 and above systems where host doesn't know about interrupt controller.
+An OS can instead make OPAL calls for XICS emulation.
+
+For an OS to use this OPAL call, an "ibm,opal-intc" compatible device must
+exist in the device tree. If OPAL does not create such a device, the host
+OS MUST NOT use this call.
diff --git a/include/opal-api.h b/include/opal-api.h
index 917d751..84c6925 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -167,7 +167,11 @@
 #define OPAL_PCI_GET_PRESENCE_STATE		119
 #define OPAL_PCI_GET_POWER_STATE		120
 #define OPAL_PCI_SET_POWER_STATE		121
-#define OPAL_LAST				121
+#define OPAL_INT_GET_XIRR			122 /* Not yet implemented */
+#define OPAL_INT_SET_CPPR			123 /* Not yet implemented */
+#define OPAL_INT_EOI				124 /* Not yet implemented */
+#define OPAL_INT_SET_MFRR			125 /* Not yet implemented */
+#define OPAL_LAST				125
 
 /* Device tree flags */
 

-- 
Stewart Smith
OPAL Architect, IBM.



More information about the Skiboot mailing list