From patchwork Fri Jan 20 22:46:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliot Berman X-Patchwork-Id: 46660 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp465069wrn; Fri, 20 Jan 2023 14:48:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXvLT3WUr+E83QITwBRlBnIE2oISKZv2XeGF6izJsSHylIZm2aIq6kP7Av9/qcavNfhky2mB X-Received: by 2002:a05:6a20:e186:b0:b8:76c7:bddc with SMTP id ks6-20020a056a20e18600b000b876c7bddcmr16812373pzb.28.1674254915977; Fri, 20 Jan 2023 14:48:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674254915; cv=none; d=google.com; s=arc-20160816; b=iZj4a0eEvELIvotuggDizYgXYMP0qaJkgFQcM8WzYd9q+opkv+vp0/3moeelJidVCA YmGQIeMfR2ZEfBu68VMXv/E4hNL0D99dZ1D78j9sEgtfmve7Z8ZG/qu5uLGd057RWV4F e65wJTftnWQBAYrUOG5kF5maA3ZNSanpHyOzQ6ujhDFENQJuYM1wWRv2h0AvPQEY/ae9 KzvLoxUjRZ1zFZ2WzVNG5Hz7V2qjm84kG6yg2PM+1UeIKR/ytDbFjOWzt7gZuXDVLbsn aWndqbnIR3akV+EKM+qmcO8l6dwkO0Ro9E64oMonqIYATdzmSWlwAUwzNMWmwYNVhill h2WQ== 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=Ij+kymD06vQBfS3DsyzOfY1gb7Js0y5d3S6gxBAzk88=; b=FdCTHdn10vUAG/mUI+U58hwetd6nwLGhNysVkdc9ck4fCJNGBkYjOma3Y/fF6E1KUU 5uK+1m1z/ZZ8e10Q87HnfIf4THT/LOp3FJ+lJTWg6MLSuFYhxrZoF1CHvb4bpvTYvTeB z2CUsJsy+z9pTWk+YEm1ybF45pnfHgtq4bSv5pgHvQXXLKtqI9j1eBflEDsOGnbK4hiY hzJIV0jUlSqPpBZeu/C9f0Cva+f/GOmr5oQxJXbEDlsdePs3PkLDC4Xy75crW7rYA5Co OPHc5jzYsAS7Nqlt0j23orNcSZ2qycJrCUBf2NgKLmYgGLr+Hz5sVX/jcgbTs3JxHsSc JR+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=AWJUkSum; 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 e63-20020a636942000000b004d23a59d6e9si5723355pgc.373.2023.01.20.14.48.24; Fri, 20 Jan 2023 14:48:35 -0800 (PST) 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=AWJUkSum; 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 S229888AbjATWr6 (ORCPT + 99 others); Fri, 20 Jan 2023 17:47:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229744AbjATWr4 (ORCPT ); Fri, 20 Jan 2023 17:47:56 -0500 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1BB2252BA; Fri, 20 Jan 2023 14:47:45 -0800 (PST) Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30KLpBxR001787; Fri, 20 Jan 2023 22:47:33 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=Ij+kymD06vQBfS3DsyzOfY1gb7Js0y5d3S6gxBAzk88=; b=AWJUkSum+vZ6ptmgZPnIIlS7VVcQ6Z9/LLSHfdgvIefD3hhjo2XkK5J9bf8oR/qe+hIY ye87kWD8cifgm8BDCnbe9tj80SZNoTjSzrm/VbgDsBFOLNKi1cGsadF/BxnmhwbqDSAV tDY8L5cYzeM/icALnuj4wx5RdKY/w+K6OTXJ6z+xbXyx/7UiyZHLf+EEBgqaALqrRAyG RtqyKUEJt4u5ePlVDFyLa3zE57RBcBWdyfN7UxpoD5+iQ9sJYPDvLzxMsB10Wz7x+TOb 0PyJkIIl2yFGl9c4Lt6+mPXDdIQLNVonXGkYGUgUwBxY2Xgh79k7kABbfNc/aiRHDAHC aQ== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3n75w3kmwf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 22:47:33 +0000 Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 30KMlV6C027129 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 22:47:31 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.36; Fri, 20 Jan 2023 14:47:30 -0800 From: Elliot Berman To: Bjorn Andersson , Alex Elder , Elliot Berman , Murali Nalajala , Rob Herring , "Krzysztof Kozlowski" CC: Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Dmitry Baryshkov , Arnd Bergmann , "Greg Kroah-Hartman" , Jonathan Corbet , Bagas Sanjaya , Catalin Marinas , Will Deacon , Marc Zyngier , Jassi Brar , Sudeep Holla , , , , , , "Rob Herring" Subject: [PATCH v9 02/27] dt-bindings: Add binding for gunyah hypervisor Date: Fri, 20 Jan 2023 14:46:01 -0800 Message-ID: <20230120224627.4053418-3-quic_eberman@quicinc.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230120224627.4053418-1-quic_eberman@quicinc.com> References: <20230120224627.4053418-1-quic_eberman@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: Pmo8o9kGMJDtmMZhWhQiic-rRd41HPnv X-Proofpoint-GUID: Pmo8o9kGMJDtmMZhWhQiic-rRd41HPnv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-20_11,2023-01-20_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 adultscore=0 clxscore=1011 mlxscore=0 spamscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301200218 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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?1755583522444728364?= X-GMAIL-MSGID: =?utf-8?q?1755583522444728364?= 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 --- .../bindings/firmware/gunyah-hypervisor.yaml | 82 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 83 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 000000000000..9fd1d254b156 --- /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: + - Murali Nalajala + - 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 */ + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 14fcfc7f91df..d9205cb9e988 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9046,6 +9046,7 @@ M: Elliot Berman M: Murali Nalajala L: linux-arm-msm@vger.kernel.org S: Supported +F: Documentation/devicetree/bindings/firmware/gunyah-hypervisor.yaml F: Documentation/virt/gunyah/ HABANALABS PCI DRIVER