From patchwork Fri May 31 06:12:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stewart Smith X-Patchwork-Id: 1108100 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 45FZHC46wVz9s00 for ; Fri, 31 May 2019 16:27:03 +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 45FZHC2t1KzDqcP for ; Fri, 31 May 2019 16:27:03 +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 45FZ0M676NzDqXX for ; Fri, 31 May 2019 16:14:11 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4V643Gr060081 for ; Fri, 31 May 2019 02:14:08 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0a-001b2d01.pphosted.com with ESMTP id 2stx4v99xu-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 e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 May 2019 07:14:07 +0100 Received: from b03cxnp08028.gho.boulder.ibm.com (9.17.130.20) by e35.co.us.ibm.com (192.168.1.135) 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 b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4V6E4c121955040 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 31 May 2019 06:14:04 GMT Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F1321136051 for ; Fri, 31 May 2019 06:14:03 +0000 (GMT) Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8DAB413604F for ; Fri, 31 May 2019 06:14:03 +0000 (GMT) Received: from birb.localdomain (unknown [9.185.142.91]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP for ; Fri, 31 May 2019 06:14:03 +0000 (GMT) Received: by birb.localdomain (Postfix, from userid 1000) id 43A52503F8F; Fri, 31 May 2019 16:13:57 +1000 (AEST) From: Stewart Smith To: skiboot@lists.ozlabs.org Date: Fri, 31 May 2019 16:12:49 +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-0012-0000-0000-0000173DDCFA 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:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19053106-0013-0000-0000-00005778F806 Message-Id: <20190531061351.22973-49-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=627 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905310040 Subject: [Skiboot] [PATCH 048/110] doc: Extend OPAL_LEDS_[GET|SET]_INDICATOR 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" There are some useful comments from the FSP code that help explain how these calls work. Signed-off-by: Stewart Smith --- doc/opal-api/opal-led-get-set-114-115.rst | 74 ++++++++++++++++++++++- 1 file changed, 73 insertions(+), 1 deletion(-) diff --git a/doc/opal-api/opal-led-get-set-114-115.rst b/doc/opal-api/opal-led-get-set-114-115.rst index c0d874ea636d..0de7c4c0020c 100644 --- a/doc/opal-api/opal-led-get-set-114-115.rst +++ b/doc/opal-api/opal-led-get-set-114-115.rst @@ -50,12 +50,84 @@ Note: There are two OPAL calls relating to LED operations. +.. _OPAL_LEDS_GET_INDICATOR: + OPAL_LEDS_GET_INDICATOR ----------------------- + +.. code-block:: c + + #define OPAL_LEDS_GET_INDICATOR 114 + + int64_t opal_leds_get_indicator(char *loc_code, u64 *led_mask, + u64 *led_value, u64 *max_led_type); + Returns LED state for the given location code. +``loc_code`` + Location code of the LEDs. +``led_mask`` + LED types whose status is available (return by OPAL) +``led_value`` + Status of the available LED types (return by OPAL) +``max_led_type`` + Maximum number of supported LED types (Host/OPAL) + +The host will pass the location code of the LED types (loc_code) and +maximum number of LED types it understands (max_led_type). OPAL will +update the 'led_mask' with set bits pointing to LED types whose status +is available and updates the 'led_value' with actual status. OPAL checks +the 'max_led_type' to understand whether the host is newer or older +compared to itself. In the case where the OPAL is newer compared +to host (OPAL's max_led_type > host's max_led_type), it will update +led_mask and led_value according to max_led_type requested by the host. +When the host is newer compared to the OPAL (host's max_led_type > +OPAL's max_led_type), OPAL updates 'max_led_type' to the maximum +number of LED type it understands and updates 'led_mask', 'led_value' +based on that maximum value of LED types. + +Currently this is only implemented on FSP basde machines, see +hw/fsp/fsp-leds.c for more deatails. + +.. _OPAL_LEDS_SET_INDICATOR: + OPAL_LEDS_SET_INDICATOR ----------------------- + +.. code-block:: c + + #define OPAL_LEDS_SET_INDICATOR 115 + + int64_t opal_leds_set_indicator(uint64_t async_token, + char *loc_code, const u64 led_mask, + const u64 led_value, u64 *max_led_type); + Sets LED state for the given location code. -See hw/fsp/fsp-leds.c for more deatails. +``loc_code`` + Location code of the LEDs to be set. +``led_mask`` + LED types whose status will be updated +``led_value`` + Requested status of various LED types. +``max_led_type`` + Maximum number of supported LED types. If OPAL supports fewer LED types + than requested, it will set ``max_led_type`` to the maximum it does support. + +The host will pass the location code of the LED types, mask, value +and maximum number of LED types it understands. OPAL will update +LED status for all the LED types mentioned in the mask with their +value mentioned. OPAL checks the 'max_led_type' to understand +whether the host is newer or older compared to itself. In case where +the OPAL is newer compared to the host (OPAL's max_led_type > + host's max_led_type), it updates LED status based on max_led_type +requested from the host. When the host is newer compared to the OPAL +(host's max_led_type > OPAL's max_led_type), OPAL updates +'max_led_type' to the maximum number of LED type it understands and +then it updates LED status based on that updated maximum value of LED +types. Host needs to check the returned updated value of max_led_type +to figure out which part of it's request got served and which ones got +ignored. + +Currently this is only implemented on FSP basde machines, see +hw/fsp/fsp-leds.c for more deatails.