linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alastair D'Silva" <alastair@au1.ibm.com>
To: alastair@d-silva.org
Cc: "Benjamin Herrenschmidt" <benh@kernel.crashing.org>,
	"Paul Mackerras" <paulus@samba.org>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	"Frederic Barrat" <fbarrat@linux.ibm.com>,
	"Andrew Donnellan" <ajd@linux.ibm.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Mahesh Salgaonkar" <mahesh@linux.vnet.ibm.com>,
	"Allison Randal" <allison@lohutok.net>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Vaibhav Jain" <vaibhav@linux.ibm.com>,
	"Anju T Sudhakar" <anju@linux.vnet.ibm.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"David Gibson" <david@gibson.dropbear.id.au>,
	"Masahiro Yamada" <yamada.masahiro@socionext.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Alexey Kardashevskiy" <aik@ozlabs.ru>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/5] powerpc: Add OPAL calls for LPC memory alloc/release
Date: Tue, 17 Sep 2019 11:42:57 +1000	[thread overview]
Message-ID: <20190917014307.30485-2-alastair@au1.ibm.com> (raw)
In-Reply-To: <20190917014307.30485-1-alastair@au1.ibm.com>

From: Alastair D'Silva <alastair@d-silva.org>

Add OPAL calls for LPC memory alloc/release

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
---
 arch/powerpc/include/asm/opal-api.h        | 4 +++-
 arch/powerpc/include/asm/opal.h            | 3 +++
 arch/powerpc/platforms/powernv/opal-call.c | 2 ++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
index 383242eb0dea..c58161cd7cfb 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -208,7 +208,9 @@
 #define OPAL_HANDLE_HMI2			166
 #define	OPAL_NX_COPROC_INIT			167
 #define OPAL_XIVE_GET_VP_STATE			170
-#define OPAL_LAST				170
+#define OPAL_NPU_MEM_ALLOC			171
+#define OPAL_NPU_MEM_RELEASE			172
+#define OPAL_LAST				172
 
 #define QUIESCE_HOLD			1 /* Spin all calls at entry */
 #define QUIESCE_REJECT			2 /* Fail all calls with OPAL_BUSY */
diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
index 57bd029c715e..8c957a003be4 100644
--- a/arch/powerpc/include/asm/opal.h
+++ b/arch/powerpc/include/asm/opal.h
@@ -39,6 +39,9 @@ int64_t opal_npu_spa_clear_cache(uint64_t phb_id, uint32_t bdfn,
 				uint64_t PE_handle);
 int64_t opal_npu_tl_set(uint64_t phb_id, uint32_t bdfn, long cap,
 			uint64_t rate_phys, uint32_t size);
+int64_t opal_npu_mem_alloc(uint64_t phb_id, uint32_t bdfn,
+			uint64_t size, uint64_t *bar);
+int64_t opal_npu_mem_release(uint64_t phb_id, uint32_t bdfn);
 int64_t opal_console_write(int64_t term_number, __be64 *length,
 			   const uint8_t *buffer);
 int64_t opal_console_read(int64_t term_number, __be64 *length,
diff --git a/arch/powerpc/platforms/powernv/opal-call.c b/arch/powerpc/platforms/powernv/opal-call.c
index 29ca523c1c79..09a280446507 100644
--- a/arch/powerpc/platforms/powernv/opal-call.c
+++ b/arch/powerpc/platforms/powernv/opal-call.c
@@ -287,3 +287,5 @@ OPAL_CALL(opal_pci_set_pbcq_tunnel_bar,		OPAL_PCI_SET_PBCQ_TUNNEL_BAR);
 OPAL_CALL(opal_sensor_read_u64,			OPAL_SENSOR_READ_U64);
 OPAL_CALL(opal_sensor_group_enable,		OPAL_SENSOR_GROUP_ENABLE);
 OPAL_CALL(opal_nx_coproc_init,			OPAL_NX_COPROC_INIT);
+OPAL_CALL(opal_npu_mem_alloc,			OPAL_NPU_MEM_ALLOC);
+OPAL_CALL(opal_npu_mem_release,			OPAL_NPU_MEM_RELEASE);
-- 
2.21.0


  reply	other threads:[~2019-09-17  1:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17  1:42 [PATCH 0/5] ocxl: Allow external drivers to access LPC memory Alastair D'Silva
2019-09-17  1:42 ` Alastair D'Silva [this message]
2019-09-25 11:41   ` [PATCH 1/5] powerpc: Add OPAL calls for LPC memory alloc/release Andrew Donnellan
2019-09-17  1:42 ` [PATCH 2/5] powerpc: Map & release OpenCAPI LPC memory Alastair D'Silva
2019-09-17  4:22   ` kbuild test robot
2019-09-18 14:03   ` Frederic Barrat
2019-09-19  0:58     ` Alastair D'Silva
2019-09-19  8:38       ` Frederic Barrat
2019-09-17  1:42 ` [PATCH 3/5] ocxl: Tally up the LPC memory on a link & allow it to be mapped Alastair D'Silva
2019-09-18 14:02   ` Frederic Barrat
2019-09-19  4:55     ` Alastair D'Silva
2019-09-19  8:41       ` Frederic Barrat
2019-09-17  1:43 ` [PATCH 4/5] ocxl: Add functions to map/unmap LPC memory Alastair D'Silva
2019-09-17  7:36   ` Christoph Hellwig
2019-09-18 14:03   ` Frederic Barrat
2019-09-19  1:19     ` Alastair D'Silva
2019-09-19  1:24   ` Alastair D'Silva
2019-09-23 11:39   ` Frederic Barrat
2019-09-26  2:59     ` Alastair D'Silva
2019-09-17  1:43 ` [PATCH 5/5] ocxl: Provide additional metadata to userspace Alastair D'Silva
2019-09-17  6:35   ` Alastair D'Silva
2019-09-17 11:30   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190917014307.30485-2-alastair@au1.ibm.com \
    --to=alastair@au1.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=ajd@linux.ibm.com \
    --cc=alastair@d-silva.org \
    --cc=allison@lohutok.net \
    --cc=anju@linux.vnet.ibm.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=clg@kaod.org \
    --cc=david@gibson.dropbear.id.au \
    --cc=fbarrat@linux.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mahesh@linux.vnet.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=paulus@samba.org \
    --cc=tglx@linutronix.de \
    --cc=vaibhav@linux.ibm.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).