From patchwork Fri May 31 06:12:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 1108091 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45FZDx07mwz9s00 for ; Fri, 31 May 2019 16:25:05 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 45FZDw6QBZzDqYC for ; Fri, 31 May 2019 16:25:04 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=stewart@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 45FZ0L4zHxzDqYn for ; Fri, 31 May 2019 16:14:10 +1000 (AEST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4V658h5135306 for ; Fri, 31 May 2019 02:14:07 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0b-001b2d01.pphosted.com with ESMTP id 2stv224n58-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 May 2019 02:14:07 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 May 2019 07:14:06 +0100 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 31 May 2019 07:14:03 +0100 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4V6E25V30670956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 31 May 2019 06:14:03 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC5AE124055 for ; Fri, 31 May 2019 06:14:02 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 991BA124053 for ; Fri, 31 May 2019 06:14:02 +0000 (GMT) Received: from birb.localdomain (unknown [9.185.142.91]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP for ; Fri, 31 May 2019 06:14:02 +0000 (GMT) Received: by birb.localdomain (Postfix, from userid 1000) id D5D7E503F68; Fri, 31 May 2019 16:13:56 +1000 (AEST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Fri, 31 May 2019 16:12:28 +1000 X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190531061351.22973-1-stewart@linux.ibm.com> References: <20190531061351.22973-1-stewart@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 19053106-0072-0000-0000-00000435AFC2 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011189; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01211088; UDB=6.00636340; IPR=6.00992124; MB=3.00027126; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-31 06:14:04 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19053106-0073-0000-0000-00004C6D3D04 Message-Id: <20190531061351.22973-28-stewart@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-31_03:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905310040 Subject: [Skiboot] [PATCH 027/110] doc: prettify OPAL_PCI_SET_PHB_CAPI_MODE X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Signed-off-by: Stewart Smith --- .../opal-pci-set-phb-capi-mode-93.rst | 60 ++++++++++++------- 1 file changed, 37 insertions(+), 23 deletions(-) diff --git a/doc/opal-api/opal-pci-set-phb-capi-mode-93.rst b/doc/opal-api/opal-pci-set-phb-capi-mode-93.rst index 6a8d2be849d4..ffc4c6dc9fea 100644 --- a/doc/opal-api/opal-pci-set-phb-capi-mode-93.rst +++ b/doc/opal-api/opal-pci-set-phb-capi-mode-93.rst @@ -1,30 +1,47 @@ +.. _OPAL_PCI_SET_PHB_CAPI_MODE: + OPAL_PCI_SET_PHB_CAPI_MODE -=========================== +========================== + +.. code-block:: c + + #define OPAL_PCI_SET_PHB_CAPI_MODE 93 + + /* CAPI modes for PHB */ + enum { + OPAL_PHB_CAPI_MODE_PCIE = 0, + OPAL_PHB_CAPI_MODE_CAPI = 1, + OPAL_PHB_CAPI_MODE_SNOOP_OFF = 2, + OPAL_PHB_CAPI_MODE_SNOOP_ON = 3, + OPAL_PHB_CAPI_MODE_DMA = 4, + OPAL_PHB_CAPI_MODE_DMA_TVT1 = 5, + }; -Switch the CAPP attached to the given PHB in one of the supported CAPI modes + int64_t opal_pci_set_phb_capi_mode(uint64_t phb_id, uint64_t mode, uint64_t pe_number); + +Switch the CAPP attached to the given PHB in one of the supported CAPI modes. Parameters ---------- + ``uint64_t phb_id`` the ID of the PHB which identifies attached CAPP to perform mode switch on - ``uint64_t mode`` A mode id as described below - ``pe_number`` PE number for the initiating device Calling ------- -Switch CAPP attached to the given PHB in one of the following supported modes: +Switch CAPP attached to the given PHB in one of the following supported modes: :: -OPAL_PHB_CAPI_MODE_PCIE = 0 -OPAL_PHB_CAPI_MODE_CAPI = 1 -OPAL_PHB_CAPI_MODE_SNOOP_OFF = 2 -OPAL_PHB_CAPI_MODE_SNOOP_ON = 3 -OPAL_PHB_CAPI_MODE_DMA = 4 -OPAL_PHB_CAPI_MODE_DMA_TVT1 = 5 + OPAL_PHB_CAPI_MODE_PCIE = 0 + OPAL_PHB_CAPI_MODE_CAPI = 1 + OPAL_PHB_CAPI_MODE_SNOOP_OFF = 2 + OPAL_PHB_CAPI_MODE_SNOOP_ON = 3 + OPAL_PHB_CAPI_MODE_DMA = 4 + OPAL_PHB_CAPI_MODE_DMA_TVT1 = 5 Modes `OPAL_PHB_CAPI_MODE_PCIE` and `OPAL_PHB_CAPI_MODE_CAPI` are used to enable/disable CAPP attached to the PHB. @@ -42,8 +59,9 @@ requests maximum number of DMA read engines allocated to improve DMA read performance at cost of reduced bandwidth available to other traffic including CAPP-PSL transactions. -Notes: +Notes ----- + * If PHB is in PEC2 then requesting mode `OPAL_PHB_CAPI_MODE_DMA_TVT1` will allocate extra 16/8 dma read engines to the PHB depending on its stack (stack 0/ stack 1). This is needed to improve the Direct-GPU DMA read @@ -55,20 +73,16 @@ Notes: Return Codes ------------ -OPAL_SUCCESS - Switch to the requested capi mode performed successfully. -OPAL_PARAMETER +:ref:`OPAL_SUCCESS` + Switch to the requested capi mode performed successfully. +:ref:`OPAL_PARAMETER` The requested value of mode or phb_id parameter is not valid. - -OPAL_HARDWARE +:ref:`OPAL_HARDWARE` An error occurred while switching the CAPP to requested mode. - -OPAL_UNSUPPORTED +:ref:`OPAL_UNSUPPORTED` Switching to requested capi mode is not possible at the moment - -OPAL_RESOURCE +:ref:`OPAL_RESOURCE` CAPP ucode not available hence activating CAPP not supported. - -OPAL_BUSY +:ref:`OPAL_BUSY` CAPP is presently in recovery-mode and mode switch cannot be performed.