From patchwork Mon Dec 19 22:58:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elliot Berman X-Patchwork-Id: 34804 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2660420wrn; Mon, 19 Dec 2022 15:01:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXv6kUZoc9iBfB7qJ2hDDqzTHZIKg0IGcHrjSmRpt6L3zBDySGtrNwn+lCyWccvITi/1jwZW X-Received: by 2002:a05:6a20:4904:b0:9d:efbe:2063 with SMTP id ft4-20020a056a20490400b0009defbe2063mr12450021pzb.25.1671490888116; Mon, 19 Dec 2022 15:01:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671490888; cv=none; d=google.com; s=arc-20160816; b=nMIkiIy7nfljdZ9USYivNdRePRAu983pQy6oYzCoGjF1z+tv+PptTMGNvZKzltwHnB FJTykwRZIoODfqYDOSEq2PCxApRbSTzL4487HaN7g3mvP0xTDSTv85RRb4rt/yW/c2yt Z+QAjpPYhdc5aUX1hfokRbLyOLWqwdxN3PxobS3mr7Xo/eD1M7RLK/7E14juVwoQDyJ5 I2JtgoQe5/9jF0xnOWH/Y9WTvq76/wbBapLwt1iL/TkV9aBh6nLTgFXNvTjn+p7L/tFL 4ilmVkOpdbYQjA6eLquI4qZUrZzF+LQhqPtsDzQSNIzcXGs/J/phdGQqYK3FtnsDrmN+ kl8w== 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=6IVtig+wbjMvPvMCEJfIk5SwsmOUgU0dSh0c/RdhBEA=; b=lqSpDdQk7fdn7u/hiX1ftXeunWFF2X99zC0YTiSZ5G/+GLCDES7y4v8sq17N9zWL// NIPltNxU9zWNERy5GVbHJwSQp3zq1AZQ8uXk9imOn7XK+m9oxKiFBGwZjYJoj4zincu+ M8l/69Td5sOjVgB+yzTFchgbg2kf66GWeGQftZvzI8i0BYUPERkfwhcWFtFUczf7pQ4t 3k5KfwKinzud7E6vHQrK5OqM7M/FZG0nBCI0MDuI9j6GFSkH/3m+ZpPkBIq7JF8dZcU0 qKRXEYaAhzuLkJ9NVXTfxwnK86b4gG9ov6iMVfAZYdJFwGmmbOQkvRbotBWFY+JKMgjL nxGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=UuXFXoyh; 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 bc22-20020a656d96000000b00477ca5b55fcsi12375113pgb.721.2022.12.19.15.01.14; Mon, 19 Dec 2022 15:01:28 -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=qcdkim header.b=UuXFXoyh; 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 S231401AbiLSXA1 (ORCPT + 99 others); Mon, 19 Dec 2022 18:00:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232710AbiLSXAU (ORCPT ); Mon, 19 Dec 2022 18:00:20 -0500 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B5014D2B; Mon, 19 Dec 2022 15:00:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1671490817; x=1703026817; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6IVtig+wbjMvPvMCEJfIk5SwsmOUgU0dSh0c/RdhBEA=; b=UuXFXoyhKGhtHkZ0vBLEBbJUV3xxbmd7yftqVABpDe+r9upaHougE8+/ /yG8BBHtTaZSCgor+PuTwwD8sJXClqr0NOjt8StAehEMxtlWBtXlF8zEI x9AWe3BrlbWXVhYNuU7wt+f+7TrbYWnYM7x8aN4tKqaanUIZmTYHWDCs3 4=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 19 Dec 2022 15:00:17 -0800 X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 15:00:17 -0800 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; Mon, 19 Dec 2022 15:00:16 -0800 From: Elliot Berman To: Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Elliot Berman , Murali Nalajala CC: Trilok Soni , Srivatsa Vaddagiri , Carl van Schaik , Prakruthi Deepak Heragu , Arnd Bergmann , Greg Kroah-Hartman , "Jonathan Corbet" , Bagas Sanjaya , "Catalin Marinas" , Will Deacon , Jassi Brar , Sudeep Holla , Mark Rutland , Lorenzo Pieralisi , "Dmitry Baryshkov" , , , , , , , Rob Herring Subject: [PATCH v8 02/28] dt-bindings: Add binding for gunyah hypervisor Date: Mon, 19 Dec 2022 14:58:23 -0800 Message-ID: <20221219225850.2397345-3-quic_eberman@quicinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221219225850.2397345-1-quic_eberman@quicinc.com> References: <20221219225850.2397345-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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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?1752685229539201615?= X-GMAIL-MSGID: =?utf-8?q?1752685229539201615?= 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 1dd8f58d6e01..f32320a9efa4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8939,6 +8939,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