From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0F8AC11F68 for ; Tue, 13 Jul 2021 10:50:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B823361249 for ; Tue, 13 Jul 2021 10:50:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235697AbhGMKxk (ORCPT ); Tue, 13 Jul 2021 06:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235496AbhGMKxj (ORCPT ); Tue, 13 Jul 2021 06:53:39 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 518E1C0613E9 for ; Tue, 13 Jul 2021 03:50:50 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id b5-20020a17090a9905b029016fc06f6c5bso1831852pjp.5 for ; Tue, 13 Jul 2021 03:50:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VovCFljnf1vTBUJ7EdFbbYpvvdVza8LaWe5CrOJSY7g=; b=POuW7HR8+JRq0XcNb2gwX87+Cdjg734uF/GDz9PpL8tv7tfi4R7JI4s3lyzjd2HTky etuO4Xl+zc7ofYqTlHgCoeEuDnEJAUvuD59GNUTQJofDM4e9n8MVO2Udb5UWRTw9AQWE QgYDoVAvfyhm1eK6OHAJen6/cxYL6xox1/+zVUMCQQ4rD83iGXwWdj5AMUl6DhxxS3b5 8TVnfRubFFifGeIY6CRsrgy4lJeF25GP00i+yiscR/aM4wYTi2rRgT3SzaGeuxkZ2aBY HGFkrDpEonK2gGrgOrQIJvCVmsz2HQbt5ijEbpE3Z0DmCaTBIxFT788zMADnVE8F4MQM Gk5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VovCFljnf1vTBUJ7EdFbbYpvvdVza8LaWe5CrOJSY7g=; b=euu+E2/zLAwMfB44YazCC4OKYpeNQ5HEwWV3RSca6Zv7o45mXp6SOay/OWvjRTuVDX IUUww6yx4EThSfHHmr8+PsC0Zcv42XxSlg0PqcM3BVPT8RmXqc3C4WTFTIKT6TXKHBxC i/h6+MVm8pjkZ+XgwU+0aZ+a4OFoacWRYgi1eVuXtw03fHa0ovvVpK1xy36ee6ImE7QJ eCEjXQd0/LZ8EyRWi5Vg4VD1fKMYSi62M5rWLqqlCXGLC693yqE8JwNufmg9lCL6OJLk aFmbbGvuj7G3tnT3ahoctNWzrYRWWcvTOJs2GI1VYx+f1u4845wdjeKpuKr/DdvHpH4q BeBA== X-Gm-Message-State: AOAM532Ly1zIy3jLdSHRuQyjaAPW4s4WHSQGy+E0lNq5RcZhzEAed3ye 7LNfhQPBhYI89yw5B/CVhtaUuA== X-Google-Smtp-Source: ABdhPJxfSRrVqHX7TowizBcJeXp3Vooup9t0ZmJr+Y2H9dkwyZZxmOQynaJr596l4TvHmyCKKrHzzg== X-Received: by 2002:a17:903:184:b029:12b:3b0f:a7a3 with SMTP id z4-20020a1709030184b029012b3b0fa7a3mr472500plg.24.1626173449854; Tue, 13 Jul 2021 03:50:49 -0700 (PDT) Received: from localhost ([106.201.108.2]) by smtp.gmail.com with ESMTPSA id h11sm5086664pjv.57.2021.07.13.03.50.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 03:50:49 -0700 (PDT) From: Viresh Kumar To: Jason Wang , "Michael S. Tsirkin" , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker Cc: Viresh Kumar , Vincent Guittot , Bill Mills , =?UTF-8?q?Alex=20Benn=C3=A9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH 1/5] dt-bindings: virtio: mmio: Add support for device subnode Date: Tue, 13 Jul 2021 16:20:30 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Allow virtio,mmio nodes to contain device specific subnodes. Since each virtio,mmio node can represent a single virtio device, each virtio node is allowed to contain a maximum of one device specific subnode. The device subnode must have the "reg" property, and its value must match the virtio device ID used by the virtio mmio node. A phandle to this device subnode can then be used by the users of the virtio device. Also add a symbolic link to uapi/linux/virtio_ids.h in order to use the definitions here. Signed-off-by: Viresh Kumar --- .../devicetree/bindings/virtio/mmio.yaml | 41 +++++++++++++++++++ include/dt-bindings/virtio/virtio_ids.h | 1 + 2 files changed, 42 insertions(+) create mode 120000 include/dt-bindings/virtio/virtio_ids.h diff --git a/Documentation/devicetree/bindings/virtio/mmio.yaml b/Documentation/devicetree/bindings/virtio/mmio.yaml index d46597028cf1..e5f9fe6ecb5e 100644 --- a/Documentation/devicetree/bindings/virtio/mmio.yaml +++ b/Documentation/devicetree/bindings/virtio/mmio.yaml @@ -31,6 +31,31 @@ title: virtio memory mapped devices description: Required for devices making accesses thru an IOMMU. maxItems: 1 + "#address-cells": + const: 1 + description: + The cell is the device ID if a device subnode is used. + + "#size-cells": + const: 0 + +patternProperties: + '^[a-z0-9]+-virtio@[0-9]+$': + type: object + description: | + Exactly one node describing the virtio device. The name of the node isn't + significant but its phandle can be used to by an user of the virtio + device. + + properties: + reg: + description: + Must contain the Virtio ID of the device. + $ref: /schemas/types.yaml#/definitions/uint32 + + required: + - reg + required: - compatible - reg @@ -57,4 +82,20 @@ additionalProperties: false #iommu-cells = <1>; }; + - | + #include + + virtio@3200 { + compatible = "virtio,mmio"; + reg = <0x3200 0x100>; + interrupts = <43>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c-virtio@0 { + reg = ; + }; + }; + ... diff --git a/include/dt-bindings/virtio/virtio_ids.h b/include/dt-bindings/virtio/virtio_ids.h new file mode 120000 index 000000000000..6e59ba332216 --- /dev/null +++ b/include/dt-bindings/virtio/virtio_ids.h @@ -0,0 +1 @@ +../../uapi/linux/virtio_ids.h \ No newline at end of file -- 2.31.1.272.g89b43f80a514