mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
To: Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: gregkh@linuxfoundation.org, alastair@au1.ibm.com, arnd@arndb.de
Subject: Re: [PATCH 03/13] powerpc/powernv: Add opal calls for opencapi
Date: Tue, 19 Dec 2017 11:47:21 +1100	[thread overview]
Message-ID: <d12638e1-3860-1540-4397-8a0fa5cc758d@au1.ibm.com> (raw)
In-Reply-To: <f2189f8a9c578e5515472b0f44e5469ce36f9e5f.1513608243.git.fbarrat@linux.vnet.ibm.com>

On 19/12/17 02:21, Frederic Barrat wrote:
> Add opal calls to interact with the NPU:
> 
> OPAL_NPU_SPA_SETUP: set the Shared Process Area (SPA)
> The SPA is a table containing one entry (Process Element) per memory
> context which can be accessed by the opencapi device.
> 
> OPAL_NPU_SPA_CLEAR_CACHE: clear the context cache
> The NPU keeps a cache of recently accessed memory contexts. When a
> Process Element is removed from the SPA, the cache for the link must
> be cleared.
> 
> OPAL_NPU_TL_SET: configure the Transaction Layer
> The Transaction Layer specification defines several templates for
> messages to be exchanged on the link. During link setup, the host and
> device must negotiate what templates are supported on both sides and
> at what rates those messages can be sent.
> 
> 
> Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>

Corresponding skiboot patch: https://patchwork.ozlabs.org/patch/849830/

Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> ---
>   arch/powerpc/include/asm/opal-api.h            | 5 ++++-
>   arch/powerpc/include/asm/opal.h                | 6 ++++++
>   arch/powerpc/platforms/powernv/opal-wrappers.S | 3 +++
>   3 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
> index 233c7504b1f2..24c73f5575ee 100644
> --- a/arch/powerpc/include/asm/opal-api.h
> +++ b/arch/powerpc/include/asm/opal-api.h
> @@ -201,7 +201,10 @@
>   #define OPAL_SET_POWER_SHIFT_RATIO		155
>   #define OPAL_SENSOR_GROUP_CLEAR			156
>   #define OPAL_PCI_SET_P2P			157
> -#define OPAL_LAST				157
> +#define OPAL_NPU_SPA_SETUP			159
> +#define OPAL_NPU_SPA_CLEAR_CACHE		160
> +#define OPAL_NPU_TL_SET				161
> +#define OPAL_LAST				161
>   
>   /* Device tree flags */
>   
> diff --git a/arch/powerpc/include/asm/opal.h b/arch/powerpc/include/asm/opal.h
> index 0c545f7fc77b..12e70fb58700 100644
> --- a/arch/powerpc/include/asm/opal.h
> +++ b/arch/powerpc/include/asm/opal.h
> @@ -34,6 +34,12 @@ int64_t opal_npu_init_context(uint64_t phb_id, int pasid, uint64_t msr,
>   			uint64_t bdf);
>   int64_t opal_npu_map_lpar(uint64_t phb_id, uint64_t bdf, uint64_t lparid,
>   			uint64_t lpcr);
> +int64_t opal_npu_spa_setup(uint64_t phb_id, uint32_t bdfn,
> +			uint64_t addr, uint64_t PE_mask);
> +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);

The function prototype on the skiboot side has slightly different 
parameter names: long capabilities, uint32_t rate_sz.

>   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-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
> index 6f4b00a2ac46..1b2936ba6040 100644
> --- a/arch/powerpc/platforms/powernv/opal-wrappers.S
> +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
> @@ -320,3 +320,6 @@ OPAL_CALL(opal_set_powercap,			OPAL_SET_POWERCAP);
>   OPAL_CALL(opal_get_power_shift_ratio,		OPAL_GET_POWER_SHIFT_RATIO);
>   OPAL_CALL(opal_set_power_shift_ratio,		OPAL_SET_POWER_SHIFT_RATIO);
>   OPAL_CALL(opal_sensor_group_clear,		OPAL_SENSOR_GROUP_CLEAR);
> +OPAL_CALL(opal_npu_spa_setup,			OPAL_NPU_SPA_SETUP);
> +OPAL_CALL(opal_npu_spa_clear_cache,		OPAL_NPU_SPA_CLEAR_CACHE);
> +OPAL_CALL(opal_npu_tl_set,			OPAL_NPU_TL_SET);
> 

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com  IBM Australia Limited

  reply	other threads:[~2017-12-19  0:47 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-18 15:21 [PATCH 00/13] New driver to support OpenCAPI devices on POWER9 Frederic Barrat
2017-12-18 15:21 ` [PATCH 01/13] powerpc/powernv: Introduce new PHB type for opencapi links Frederic Barrat
2018-01-03  3:53   ` Andrew Donnellan
2017-12-18 15:21 ` [PATCH 02/13] powerpc/powernv: Set correct configuration space size for opencapi devices Frederic Barrat
2017-12-19  1:14   ` Andrew Donnellan
2018-01-20  9:52   ` Michael Ellerman
2018-01-22  5:07     ` Andrew Donnellan
2017-12-18 15:21 ` [PATCH 03/13] powerpc/powernv: Add opal calls for opencapi Frederic Barrat
2017-12-19  0:47   ` Andrew Donnellan [this message]
2017-12-18 15:21 ` [PATCH 04/13] powerpc/powernv: Add platform-specific services " Frederic Barrat
2018-01-03  7:31   ` Andrew Donnellan
2017-12-18 15:21 ` [PATCH 05/13] powerpc/powernv: Capture actag information for the device Frederic Barrat
2017-12-18 15:21 ` [PATCH 06/13] ocxl: Driver code for 'generic' opencapi devices Frederic Barrat
2018-01-03  7:30   ` Andrew Donnellan
2017-12-18 15:21 ` [PATCH 07/13] ocxl: Add AFU interrupt support Frederic Barrat
2017-12-19  4:05   ` Benjamin Herrenschmidt
2018-01-23 17:10     ` Cédric Le Goater
2017-12-18 15:21 ` [PATCH 08/13] ocxl: Add a kernel API for other opencapi drivers Frederic Barrat
2017-12-18 15:21 ` [PATCH 09/13] ocxl: Add trace points Frederic Barrat
2017-12-18 16:48   ` Philippe Ombredanne
2017-12-20 12:01     ` Frederic Barrat
2017-12-18 15:21 ` [PATCH 10/13] ocxl: Add Makefile and Kconfig Frederic Barrat
2018-01-03  5:48   ` Andrew Donnellan
2018-01-09 15:45     ` Frederic Barrat
2018-01-09 23:21       ` Michael Ellerman
2018-01-10 19:17         ` Frederic Barrat
2017-12-18 15:21 ` [PATCH 11/13] cxl: Remove support for "Processing accelerators" class Frederic Barrat
2017-12-18 23:47   ` Andrew Donnellan
2017-12-18 15:21 ` [PATCH 12/13] ocxl: Documentation Frederic Barrat
2017-12-18 15:21 ` [PATCH 13/13] ocxl: add MAINTAINERS entry Frederic Barrat
2017-12-18 16:04   ` Joe Perches
2017-12-19 14:39     ` Frederic Barrat
2017-12-19  0:22 ` [PATCH 00/13] New driver to support OpenCAPI devices on POWER9 Andrew Donnellan

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=d12638e1-3860-1540-4397-8a0fa5cc758d@au1.ibm.com \
    --to=andrew.donnellan@au1.ibm.com \
    --cc=alastair@au1.ibm.com \
    --cc=arnd@arndb.de \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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

all inboxes | Powered by JetHome®