From patchwork Fri May 31 06:12:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 1108130 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (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 45FZQM2XNxz9s00 for ; Fri, 31 May 2019 16:33:15 +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 45FZQM0lRmzDqhb for ; Fri, 31 May 2019 16:33:15 +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.156.1; 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 (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 45FZ0P0JhJzDqZN for ; Fri, 31 May 2019 16:14:12 +1000 (AEST) Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4V64MAr078773 for ; Fri, 31 May 2019 02:14:09 -0400 Received: from e17.ny.us.ibm.com (e17.ny.us.ibm.com [129.33.205.207]) by mx0a-001b2d01.pphosted.com with ESMTP id 2stv42d082-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 May 2019 02:14:09 -0400 Received: from localhost by e17.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 May 2019 07:14:08 +0100 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e17.ny.us.ibm.com (146.89.104.204) 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:05 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4V6E4lG39387472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 31 May 2019 06:14:04 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B0E0B205F for ; Fri, 31 May 2019 06:14:04 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E530BB2064 for ; Fri, 31 May 2019 06:14:03 +0000 (GMT) Received: from birb.localdomain (unknown [9.185.142.91]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP for ; Fri, 31 May 2019 06:14:03 +0000 (GMT) Received: by birb.localdomain (Postfix, from userid 1000) id 5FDDE503F9F; Fri, 31 May 2019 16:13:57 +1000 (AEST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Fri, 31 May 2019 16:12:55 +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-0040-0000-0000-000004F6E3D2 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.00636341; IPR=6.00992124; MB=3.00027126; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-31 06:14:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19053106-0041-0000-0000-00000902FEA1 Message-Id: <20190531061351.22973-55-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=908 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905310040 Subject: [Skiboot] [PATCH 054/110] doc: flesh out and prettify OPAL_LPC_(READ|WRITE) 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 --- doc/opal-api/opal-lpc-read-write-67-68.rst | 92 +++++++++++++++------- 1 file changed, 62 insertions(+), 30 deletions(-) diff --git a/doc/opal-api/opal-lpc-read-write-67-68.rst b/doc/opal-api/opal-lpc-read-write-67-68.rst index 784147459e08..52d377892330 100644 --- a/doc/opal-api/opal-lpc-read-write-67-68.rst +++ b/doc/opal-api/opal-lpc-read-write-67-68.rst @@ -1,11 +1,30 @@ +.. _OPAL_LPC_READ: + OPAL_LPC_READ ============= -:: - This function related to Low Pin Count (LPC) bus. This function reads the - data from IDSEL register for ``chip_id``, which has LPC information. - From ``addr`` for ``addr_type`` with read size ``sz`` bytes in to a - variable named ``data``. +.. code-block:: c + + #define OPAL_LPC_READ 67 + + /* + * Address cycle types for LPC accesses. These also correspond + * to the content of the first cell of the "reg" property for + * device nodes on the LPC bus + */ + enum OpalLPCAddressType { + OPAL_LPC_MEM = 0, + OPAL_LPC_IO = 1, + OPAL_LPC_FW = 2, + }; + + int64_t opal_lpc_read(uint32_t chip_id, enum OpalLPCAddressType addr_type, + uint32_t addr, uint32_t *data, uint32_t sz); + +This function related to Low Pin Count (LPC) bus. This function reads the +data from IDSEL register for ``chip_id``, which has LPC information. +From ``addr`` for ``addr_type`` with read size ``sz`` bytes in to a +variable named ``data``. Parameters ---------- @@ -13,40 +32,56 @@ Parameters ``chip_id`` The ``chip_id`` parameter contains value of the chip number identified at boot time. - ``addr_type`` The ``addr_type`` is one of the LPC supported address types. - Supported address types are - - LPC memory, - LPC IO and - LPC firmware. + Supported address types are: + + - LPC memory, + - LPC IO and + - LPC firmware. ``addr`` The ``addr`` from which the data has to be read. - ``data`` The ``data`` will be used to store the read data. - ``sz`` How many ``sz`` bytes to be read in to ``data``. Return Codes ------------ -``OPAL_PARAMETER`` +:ref:`OPAL_PARAMETER` Indicates either ``chip_id`` not found or ``chip_id`` doesn’t contain LPC information. - -``OPAL_SUCCESS`` +:ref:`OPAL_SUCCESS` Indicates Success! +.. _OPAL_LPC_WRITE: + OPAL_LPC_WRITE ============== -:: - This function related to Low Pin Count (LPC) bus. This function writes the - ``data`` in to ECCB register for ``chip_id``, which has LPC information. - From ``addr`` for ``addr_type`` with write size ``sz`` bytes. +.. code-block:: c + + #define OPAL_LPC_WRITE 68 + + /* + * Address cycle types for LPC accesses. These also correspond + * to the content of the first cell of the "reg" property for + * device nodes on the LPC bus + */ + enum OpalLPCAddressType { + OPAL_LPC_MEM = 0, + OPAL_LPC_IO = 1, + OPAL_LPC_FW = 2, + }; + + int64_t opal_lpc_write(uint32_t chip_id, enum OpalLPCAddressType addr_type, + uint32_t addr, uint32_t data, uint32_t sz); + +This function related to Low Pin Count (LPC) bus. This function writes the +``data`` in to ECCB register for ``chip_id``, which has LPC information. +From ``addr`` for ``addr_type`` with write size ``sz`` bytes. Parameters ---------- @@ -54,29 +89,26 @@ Parameters ``chip_id`` The ``chip_id`` parameter contains value of the chip number identified at boot time. - ``addr_type`` The ``addr_type`` is one of the address types LPC supported. - Supported address types are - - LPC memory, - LPC IO and - LPC firmware. + Supported address types are: + + - LPC memory, + - LPC IO and + - LPC firmware. ``addr`` The ``addr`` to where the ``data`` need to be written. - ``data`` The ``data`` for writing. - ``sz`` How many ``sz`` bytes to write. Return Codes ------------ -``OPAL_PARAMETER`` +:ref:`OPAL_PARAMETER` Indicates either ``chip_id`` not found or ``chip_id`` doesn’t contain LPC information. - -``OPAL_SUCCESS`` - Indicates Success! +:ref:`OPAL_SUCCESS` + Indicates Success!