From patchwork Sat Aug 29 17:09:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 248708 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp2036449ilg; Sat, 29 Aug 2020 10:09:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkGvYs0BhicosdVL0rEriVPluCBmI8cJNX0nx2VZMrxmzd8q+5Y8Z8ZkI2qpuB739EFeWZ X-Received: by 2002:aa7:dd11:: with SMTP id i17mr4059419edv.170.1598720976563; Sat, 29 Aug 2020 10:09:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598720976; cv=none; d=google.com; s=arc-20160816; b=DrrCeh8e6s7t87WxJvfYpAdW2lVc9CaQNXYNghDPZjCCubVbg26RWrbuSKuZmBNKio XJa7iTprtTpkVXtYVreHrMaBI91urY5rEIeJPPNhgQcMQy/LFYWPOeHeNE4k6vmTnhO6 4+jmc2jH6TNw+NCLQzy1nvOTQOALXazPiS9BTWBzrJDLBYxhlT91fKUOLx1WRPwzCs+A BEGsJGhZ5YwGXzOTw9uaUk+WYuDB/fE3A5DB00TtZo3LfnlbZQhxcB4OfpxNrSKYF0y8 7teXhuURARC6N58CJwC6eG9vvYEqQWxYRNSVtcfwrT7yPR/Gt9IKzbqwyVX4OVNueyo4 ZI+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=SCAwU78C+CrukEtYgxn77tLE6Dzyck96+x616GNUj5o=; b=PlGevA1G2gC407kvW0nqflZgEedal6p0AxZYvCqeorAu73V3ZA2+nJN47fxWBrGiPT 8D9nZid4yG4YJd5sMo/dRZfu95UcK7v9b4dPEmg8D9Es2gFNLFXqwY+6u9z6d5fEkJJz MOAxW0RWyjuleOxKYgFEd2BljfRW6o3M5mKYxzA1w1z2C1KYOy9ag8snzP2KLED6/PDK PQ7rB2C3EtheY/OiaFHEmaSl4sfLNNElqID1NwPvZXgODPFXlUiQyRaCh+pZg2o6wM24 M6wLiyMS81E24BWiPcukQdvtMlZObDLzC3xZOGS8iwCQbfFn8jkHigM8+pjtX8G+6M7z Vmwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d22si1952640edz.234.2020.08.29.10.09.36; Sat, 29 Aug 2020 10:09:36 -0700 (PDT) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728470AbgH2RJf (ORCPT + 6 others); Sat, 29 Aug 2020 13:09:35 -0400 Received: from foss.arm.com ([217.140.110.172]:45040 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728412AbgH2RJf (ORCPT ); Sat, 29 Aug 2020 13:09:35 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 56C2E113E; Sat, 29 Aug 2020 10:09:34 -0700 (PDT) Received: from usa.arm.com (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 57A6D3F71F; Sat, 29 Aug 2020 10:09:33 -0700 (PDT) From: Sudeep Holla To: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Cc: Sudeep Holla , kernel-team@android.com, Will Deacon , tsoni@quicinc.com, pratikp@quicinc.com Subject: [PATCH 2/9] dt-bindings: Arm: Extend FF-A binding to support in-kernel usage of partitions Date: Sat, 29 Aug 2020 18:09:16 +0100 Message-Id: <20200829170923.29949-3-sudeep.holla@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200829170923.29949-1-sudeep.holla@arm.com> References: <20200829170923.29949-1-sudeep.holla@arm.com> Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Since the FF-A v1.0 specification doesn't list the UUID of all the partitions in the discovery API, we need to specify the UUID of the partitions that need to be accessed by drivers within the kernel. This extends the binding to provide the list of partitions that kernel drivers may need to access and are not part of the partitions managed by the hypervisor. Signed-off-by: Sudeep Holla --- .../devicetree/bindings/arm/arm,ffa.yaml | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) Hi, I am sure this is incomplete, but I couldn't figure out how to make all the child properties optional if it is not managed by hypervisor. Moreover, if we don't like the idea of adding UUID of all the partitions that in-kernel drivers may need to communicate to, one alternative I can think of is to allow the creation of FFA device from the FFA driver itself. Regards, Sudeep -- 2.17.1 diff --git a/Documentation/devicetree/bindings/arm/arm,ffa.yaml b/Documentation/devicetree/bindings/arm/arm,ffa.yaml index 668a5995fcab..d5c6d71c99de 100644 --- a/Documentation/devicetree/bindings/arm/arm,ffa.yaml +++ b/Documentation/devicetree/bindings/arm/arm,ffa.yaml @@ -23,11 +23,12 @@ description: | properties: $nodename: - const: ffa_hyp + pattern: "^(ffa|ffa_hyp)$" compatible: oneOf: - const: arm,ffa-1.0-hypervisor + - const: arm,ffa-1.0 memory-region: $ref: '/schemas/types.yaml#/definitions/phandle' @@ -83,10 +84,26 @@ description: | [3] Documentation/devicetree/bindings/reserved-memory/arm,ffa-memory.yaml +required: + - compatible + +allOf: + - if: + properties: + compatible: + contains: + const: arm,ffa-1.0-hypervisor + then: + required: + - memory-region + additionalProperties: false examples: - - | + - |+ + + // Case 1: Partitions managed by hypervisor + ffa_hyp { compatible = "arm,ffa-1.0-hypervisor"; memory-region = <&ffa_hyp_reserved>; @@ -100,3 +117,16 @@ additionalProperties: false memory-region = <&ffa_reserved0 &ffa_reserved1>; }; }; + + - |+ + + // Case 2: Partitions needing in-kernel usage + + ffa { + compatible = "arm,ffa-1.0"; + + ffa_partition1 { + compatible = "arm,ffa-1.0-partition"; + uuid = "589fc454-4502-4e66-9347-97b61e27cf73"; + }; + };