From patchwork Tue Jun 13 17:20:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliot Berman X-Patchwork-Id: 107473 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp711737vqr; Tue, 13 Jun 2023 10:24:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4bd2IXAIfsbVgsh1mfxJymodOKvw6wqvZPiwbOmXGVuAv0xGfXaRWg3ulZYR9uwSpGwBv2 X-Received: by 2002:a17:907:9710:b0:96f:a8c2:77ad with SMTP id jg16-20020a170907971000b0096fa8c277admr14500433ejc.63.1686677066023; Tue, 13 Jun 2023 10:24:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686677066; cv=none; d=google.com; s=arc-20160816; b=WIrxX67PAbOgX6kPkAqgvuVZIWE0DzoV9vl146pEKRCM7LhUr+TIagk9tvFdrAlWSK 2mNDIEW8rs6p5PnrpUfTLE8yAiXA2j+g6bS/0DnzNiPWox5LytRmcbZFJvzwo+YijtVy ZLJ2L4ag7cTE/5l0P4aD3ExvmWyuOGAmNnvLKFunLH97rlV2L4BN7kpYYcjbk7vIEaAW eOeaXQy703l2gmL4SXd8HxOTBG5uY4szRFfhNv5+UDlqzLA5xAe7JY1+Ri3znOZH0Sp2 HMabjatcFjHegP0OhVELCOVhorMaYwScJiye857Zr1photHF0mbDlpthxNfBc8iF5QQ6 sDxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PdECZRliiH8YtM8MM+yqmGlCI15fGQHGxP7gej4lxNI=; b=SRAbswN697QiEDaJ+FH0XYdWegkmZsNtEEBFZLLxzWKQHjhYa2qaSoaErEML7ZbHtF Yc+Bf29t8DyAiap7H8egzxWIVL+4TRBvPdtceD5YWo/jTQF5jw1V0GtIBmY2osJ5s+ra 3ympSI+2iCMDkXmMNVg44nk9MaPcupklpF9C7UXy4mCGLRYiru50BvcGXeQuj8ckTAeQ E6Gavx+ulvzO6R5/qnPeIUDYWqamPiZofW6HL00qg5ex4+/HSjWk11sS3lxgPi7QFXJh CH1rRlueOuM5+bB0m/QjV5tSPNsLcZPppqj03VPt4pLVdwhTzThSzO/lvbVMJQBdM8LW rwvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZwigXcY2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rv26-20020a17090710da00b00965ffb6e3d0si6955221ejb.94.2023.06.13.10.24.00; Tue, 13 Jun 2023 10:24:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ZwigXcY2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239319AbjFMRWe (ORCPT + 99 others); Tue, 13 Jun 2023 13:22:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238972AbjFMRWO (ORCPT ); Tue, 13 Jun 2023 13:22:14 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B67C619BC; Tue, 13 Jun 2023 10:21:55 -0700 (PDT) Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35DEK2d9013277; Tue, 13 Jun 2023 17:21:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=PdECZRliiH8YtM8MM+yqmGlCI15fGQHGxP7gej4lxNI=; b=ZwigXcY2pHqhNR5Y4s505Dx/4Jycdg/1pPBtwVbCYR3EKXtOKvjOLrVuZ/bdy3gaYec9 +GgtrT2Ij21iF8XpIXLPAtiTjuhIGh/DpxYlB66NTAHKAG2R310LU9FJvxSDA0CbL+3g V8/8brDs1UcTmtkOrie8YCKqnl2Tpe0eaGBcDTY/zHD/mwUv0u9thlmv6unL5P2aC3R8 h8++U/sT4t/vZGt98Enx8xoUR/SJqIgTAthOExAYVvnbQdhR+q3qIMMh0lWbuxZAQyGM UoeiMgPd0/P7d3K3GeYkAjrDRPj9jrYFvETuNl4gFSXlF8dbBYZOQ76TGLNVHwf0Gp8K 8g== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3r6amhj9dt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 17:21:20 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 35DHLKRa005347 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 13 Jun 2023 17:21:20 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.42; Tue, 13 Jun 2023 10:21:19 -0700 From: Elliot Berman To: Alex Elder , Srinivas Kandagatla , Elliot Berman , Prakruthi Deepak Heragu , Rob Herring , Krzysztof Kozlowski , Conor Dooley CC: Murali Nalajala , Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Dmitry Baryshkov , Bjorn Andersson , "Konrad Dybcio" , Arnd Bergmann , "Greg Kroah-Hartman" , Jonathan Corbet , Bagas Sanjaya , Will Deacon , "Andy Gross" , Catalin Marinas , "Jassi Brar" , , , , , , "Rob Herring" Subject: [PATCH v14 02/25] dt-bindings: Add binding for gunyah hypervisor Date: Tue, 13 Jun 2023 10:20:30 -0700 Message-ID: <20230613172054.3959700-3-quic_eberman@quicinc.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230613172054.3959700-1-quic_eberman@quicinc.com> References: <20230613172054.3959700-1-quic_eberman@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: RYglC-7spcDC-rv9qZRukDK3LKawB9IP X-Proofpoint-GUID: RYglC-7spcDC-rv9qZRukDK3LKawB9IP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-06-13_20,2023-06-12_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 impostorscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306130153 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE,T_SPF_TEMPERROR,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768609091007595178?= X-GMAIL-MSGID: =?utf-8?q?1768609091007595178?= When Linux is booted as a guest under the Gunyah hypervisor, the Gunyah Resource Manager applies a devicetree overlay describing the virtual platform configuration of the guest VM, such as the message queue capability IDs for communicating with the Resource Manager. This information is not otherwise discoverable by a VM: the Gunyah hypervisor core does not provide a direct interface to discover capability IDs nor a way to communicate with RM without having already known the corresponding message queue capability ID. Add the DT bindings that Gunyah adheres for the hypervisor node and message queues. Reviewed-by: Rob Herring Signed-off-by: Elliot Berman Reviewed-by: Alex Elder --- .../bindings/firmware/gunyah-hypervisor.yaml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml diff --git a/Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml b/Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml new file mode 100644 index 0000000000000..3fc0b043ac3cf --- /dev/null +++ b/Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/firmware/gunyah-hypervisor.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Gunyah Hypervisor + +maintainers: + - Prakruthi Deepak Heragu + - Elliot Berman + +description: |+ + Gunyah virtual machines use this information to determine the capability IDs + of the message queues used to communicate with the Gunyah Resource Manager. + See also: https://github.com/quic/gunyah-resource-manager/blob/develop/src/vm_creation/dto_construct.c + +properties: + compatible: + const: gunyah-hypervisor + + "#address-cells": + description: Number of cells needed to represent 64-bit capability IDs. + const: 2 + + "#size-cells": + description: must be 0, because capability IDs are not memory address + ranges and do not have a size. + const: 0 + +patternProperties: + "^gunyah-resource-mgr(@.*)?": + type: object + description: + Resource Manager node which is required to communicate to Resource + Manager VM using Gunyah Message Queues. + + properties: + compatible: + const: gunyah-resource-manager + + reg: + items: + - description: Gunyah capability ID of the TX message queue + - description: Gunyah capability ID of the RX message queue + + interrupts: + items: + - description: Interrupt for the TX message queue + - description: Interrupt for the RX message queue + + additionalProperties: false + + required: + - compatible + - reg + - interrupts + +additionalProperties: false + +required: + - compatible + - "#address-cells" + - "#size-cells" + +examples: + - | + #include + + hypervisor { + #address-cells = <2>; + #size-cells = <0>; + compatible = "gunyah-hypervisor"; + + gunyah-resource-mgr@0 { + compatible = "gunyah-resource-manager"; + interrupts = , /* TX full IRQ */ + ; /* RX empty IRQ */ + reg = <0x00000000 0x00000000>, <0x00000000 0x00000001>; + /* TX, RX cap ids */ + }; + };