Message ID | 20230302171450.1598576-2-martyn.welch@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:7b8e:b0:9f:8c76:fea4 with SMTP id j14csp5847458dyk; Thu, 2 Mar 2023 09:18:13 -0800 (PST) X-Google-Smtp-Source: AK7set8xrrZgK74reoLl1rapHlzrn4X1+vh0q5qApepuFC/MjwBH1Bn1Ucykdirt/YfgnTkF/tmI X-Received: by 2002:a05:6a21:3391:b0:cd:2952:7b69 with SMTP id yy17-20020a056a21339100b000cd29527b69mr14423781pzb.52.1677777493371; Thu, 02 Mar 2023 09:18:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677777493; cv=none; d=google.com; s=arc-20160816; b=ejBVOlPPYl6E37enPKsVBiLI3ph62+5nGWvCsXg4ACiEbQufP/DaiKo1VqtGPUm+cU cqgTQHjR2mAg0Do+E3GSvHkGs09FArQ2CV3BrXrQWjIJ8+bOZAaWdccP3OWkjjV+feUz j/ACqNeVGmK6Ho8/Eh1g76G+ofVNB0fMOxUw5E6SfLDY193zQuSurTu5zhQPc89BLQ7y NteJaAHRUxUecLpTkU7/ShJcT2zWNfwcbtqsTq65rOc/X80xeKQ6jYxTw4hDuGd/5xs/ R/HlDKSQCOEIv+bH2+oJeBUzpkzj02kAgJ91CyAerGqjlsvE3akzpdp+6X8Lbom9kIYg DVcA== 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=qfq0ryKe4TuBmyI47xk44hE9IYEKJzQJ5CyJnMfc/vc=; b=I5IKVhSVPRIhvr8d0XU0YLfCOEPAczTgadwzW//P/bLqDoqecW6534bjqkCFH1wpII qGmLNvXY1Rk/3RMuwjGQGWQOWKCioavVIocwBq6VqZD41Kiy/r3hzVEPU9jRVze6rXE9 VE6pjKy8VblXuoZs5nsouCjBm9CInng6Gw4YibiRLiuxaaz/Fght2lkwyR4+4Ep2KbCq a3wexdAL09ga0+LsROwfrSjNeE/qmKvWC1w3eJtU+O3KcQfuTaCN/KhAHdM2jHvNfj3I /RQUs8iieZJDp/s2c+K60MpoiWHNIXBSED7zER0NkkTl5ATQuKskRBbU4SF3RLD1BvyG /jxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=QSOcnzK1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a63fe0e000000b00502eaf31c6bsi14613974pgh.43.2023.03.02.09.17.35; Thu, 02 Mar 2023 09:18:13 -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=@collabora.com header.s=mail header.b=QSOcnzK1; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229652AbjCBRPF (ORCPT <rfc822;davidbtadokoro@gmail.com> + 99 others); Thu, 2 Mar 2023 12:15:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjCBRPE (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 2 Mar 2023 12:15:04 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F5171BAF8; Thu, 2 Mar 2023 09:15:02 -0800 (PST) Received: from pan.home (unknown [IPv6:2a00:23c6:c311:3401:45a5:b946:dcd1:2820]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: martyn) by madras.collabora.co.uk (Postfix) with ESMTPSA id 2C0D76602F64; Thu, 2 Mar 2023 17:15:01 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1677777301; bh=RNG9TxYgq1rGD4FA0vfFeHWWk45XOMtdPR8Y59j9uXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSOcnzK1EeLtERtS4F7yosVU3TFngBlmwAI1HAlEV+45yjmrdF8ZB16LEKSjqy+gq CXFkQ1xrLV8eTpBke4SMtMV8hl/+A296GCrxyfraWgB3RqMzzgomd+J5Kyxq6Iw5Ui Q/eGfVKbVISJzb1nCwAGr3DswdGUOf9mzaW+l064IhflsFTLfrSpaY6paLj8SSY/cn 3y3WtD98rZqj+gYglbnhE/d7GCQ6PmoveiKxqsTlUbR/a0vhJJh381e0xjPWn87hiN P9566FUoQoEtYkfhEYSRk0Eklwozb3amWG8Fsh0d7LrIXeWm/FIJ2cZZmqf6yMgLRq Rpr5BZcP/Qkog== From: Martyn Welch <martyn.welch@collabora.com> To: Bjorn Andersson <andersson@kernel.org>, Mathieu Poirier <mathieu.poirier@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Hari Nagalla <hnagalla@ti.com> Cc: kernel@collabora.com, Martyn Welch <martyn.welch@collabora.com>, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] dt-bindings: remoteproc: k3-m4f: Add bindings for K3 AM64x SoCs Date: Thu, 2 Mar 2023 17:14:48 +0000 Message-Id: <20230302171450.1598576-2-martyn.welch@collabora.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230302171450.1598576-1-martyn.welch@collabora.com> References: <20230302171450.1598576-1-martyn.welch@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759277212720244232?= X-GMAIL-MSGID: =?utf-8?q?1759277212720244232?= |
Series |
TI K3 M4F support on AM64x and AM62x SoCs
|
|
Commit Message
Martyn Welch
March 2, 2023, 5:14 p.m. UTC
From: Hari Nagalla <hnagalla@ti.com> K3 AM64x SoC has a Cortex M4F subsystem in the MCU voltage domain. The remote processor's life cycle management and IPC mechanisms are similar across the R5F and M4F cores from remote processor driver point of view. However, there are subtle differences in image loading and starting the M4F subsystems. The YAML binding document provides the various node properties to be configured by the consumers of the M4F subsystem. Signed-off-by: Hari Nagalla <hnagalla@ti.com> [Martyn Welch: Amended as per review comments and to pass DT tests] Signed-off-by: Martyn Welch <martyn.welch@collabora.com> --- Changes since v1: - Spelling corrections - Corrected to pass DT checks Changes since v2: - Missed spelling correction to commit message Note: The only review comment that I don't see directly addressed is the lack of description of `ti,sci`, `ti,sci-dev-id` and `ti,sci-proc-ids`. A reference has been added to `/schemas/arm/keystone/ti,k3-sci-common.yaml#` where they are described. I believe this is the correct approach, please advise if that is not the case. .../bindings/remoteproc/ti,k3-m4f-rproc.yaml | 158 ++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml
Comments
On 02/03/2023 18:14, Martyn Welch wrote: > From: Hari Nagalla <hnagalla@ti.com> Subject: drop second/last, redundant "bindings for". The "dt-bindings" prefix is already stating that these are bindings. > > K3 AM64x SoC has a Cortex M4F subsystem in the MCU voltage domain. > The remote processor's life cycle management and IPC mechanisms are > similar across the R5F and M4F cores from remote processor driver > point of view. However, there are subtle differences in image loading > and starting the M4F subsystems. > > The YAML binding document provides the various node properties to be > configured by the consumers of the M4F subsystem. > > Signed-off-by: Hari Nagalla <hnagalla@ti.com> > [Martyn Welch: Amended as per review comments and to pass DT tests] > Signed-off-by: Martyn Welch <martyn.welch@collabora.com> > --- > > Changes since v1: > - Spelling corrections > - Corrected to pass DT checks > > Changes since v2: > - Missed spelling correction to commit message > > Note: The only review comment that I don't see directly addressed is the > lack of description of `ti,sci`, `ti,sci-dev-id` and > `ti,sci-proc-ids`. A reference has been added to > `/schemas/arm/keystone/ti,k3-sci-common.yaml#` where they are > described. I believe this is the correct approach, please advise if > that is not the case. > > .../bindings/remoteproc/ti,k3-m4f-rproc.yaml | 158 ++++++++++++++++++ > 1 file changed, 158 insertions(+) > create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml > > diff --git a/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml > new file mode 100644 > index 000000000000..1b38df0be2e6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml > @@ -0,0 +1,158 @@ > +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/remoteproc/ti,k3-m4f-rproc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: TI K3 M4F processor subsystems > + > +maintainers: > + - Hari Nagalla <hnagalla@ti.com> > + > +description: | > + Some K3 family SoCs have Arm Cortex M4F cores. AM64x is a SoC in K3 > + family with a M4F core. Typically safety oriented applications may use > + the M4F core in isolation without an IPC. Where as some industrial and > + home automation applications, may use the M4F core as a remote processor > + with IPC communications. > + > +$ref: /schemas/arm/keystone/ti,k3-sci-common.yaml# > + > +properties: > + $nodename: > + pattern: "^m4fss(@.*)?" Drop. It's not a generic name. Also we do not enforce names in device schemas. > + > + compatible: > + enum: > + - ti,am64-m4fss > + > + power-domains: > + description: | > + Should contain a phandle to a PM domain provider node and an args > + specifier containing the M4FSS device id value. Drop description, especially that the args depend on provider, not consumer. > + maxItems: 1 > + > + "#address-cells": > + const: 2 > + > + "#size-cells": > + const: 2 > + > + reg: > + items: > + - description: Address and Size of the IRAM internal memory region Just "IRAM internal memory region" > + - description: Address and Size of the DRAM internal memory region > + > + reg-names: > + items: > + - const: iram > + - const: dram > + > + resets: > + description: | > + Should contain the phandle to the reset controller node managing the > + local resets for this device, and a reset specifier. Drop description. > + maxItems: 1 > + > + firmware-name: > + description: | > + Should contain the name of the default firmware image > + file located on the firmware search path This description is basically duplicating the name... say something useful or shorten it (e.g. "Should contain" is really redundant). You also need $ref because we do not have the type defined anywhere. > + > + mboxes: > + description: | > + OMAP Mailbox specifier denoting the sub-mailbox, to be used for OMAP? > + communication with the remote processor. This property should match > + with the sub-mailbox node used in the firmware image. > + maxItems: 1 > + > + memory-region: > + description: | > + phandle to the reserved memory nodes to be associated with the > + remoteproc device. There should be at least two reserved memory nodes > + defined. Don't repeat constraints in free form text. > The reserved memory nodes should be carveout nodes, and > + should be defined with a "no-map" property as per the bindings in > + Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml > + minItems: 2 > + maxItems: 8 > + items: > + - description: region used for dynamic DMA allocations like vrings and > + vring buffers > + - description: region reserved for firmware image sections > + additionalItems: true And what is the purpose of the rest of reserved nodes? > + > +required: > + - compatible > + - reg > + - reg-names > + - ti,sci > + - ti,sci-dev-id > + - ti,sci-proc-ids > + - resets > + - firmware-name > + - mboxes > + - memory-region > + > +unevaluatedProperties: false > + > +examples: > + - | > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <2>; > + > + mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 { > + compatible = "shared-dma-pool"; > + reg = <0x00 0x9cb00000 0x00 0x100000>; > + no-map; > + }; > + > + mcu_m4fss_memory_region: m4f-memory@9cc00000 { > + compatible = "shared-dma-pool"; > + reg = <0x00 0x9cc00000 0x00 0xe00000>; > + no-map; > + }; > + }; > + > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + > + mailbox0_cluster0: mailbox-0 { > + #mbox-cells = <1>; > + > + mbox_m4_0: mbox-m4-0 { > + ti,mbox-rx = <0 0 0>; > + ti,mbox-tx = <1 0 0>; > + }; > + }; Does not look related to this binding... or is it somehow very specific and needs showing? > + > + bus@f0000 { > + compatible = "simple-bus"; > + #address-cells = <2>; > + #size-cells = <2>; > + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; Why another bus? You already have soc in example, why more nodes? > + > + bus@4000000 { And one more bus? > + compatible = "simple-bus"; > + #address-cells = <2>; > + #size-cells = <2>; > + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; > + > + mcu_m4fss: m4fss@5000000 { Generic node name. Qualcomm uses remoteproc. > + compatible = "ti,am64-m4fss"; > + reg = <0x00 0x5000000 0x00 0x30000>, > + <0x00 0x5040000 0x00 0x10000>; > + reg-names = "iram", "dram"; > + ti,sci = <&dmsc>; > + ti,sci-dev-id = <9>; > + ti,sci-proc-ids = <0x18 0xff>; > + resets = <&k3_reset 9 1>; > + firmware-name = "am62-mcu-m4f0_0-fw"; > + mboxes = <&mailbox0_cluster0 &mbox_m4_0>; > + memory-region = <&mcu_m4fss_dma_memory_region>, > + <&mcu_m4fss_memory_region>; > + }; > + }; > + }; > + }; Best regards, Krzysztof
On Fri, 2023-03-03 at 09:06 +0100, Krzysztof Kozlowski wrote: > On 02/03/2023 18:14, Martyn Welch wrote: > > > + > > + mboxes: > > + description: | > > + OMAP Mailbox specifier denoting the sub-mailbox, to be used > > for > > OMAP? > This device uses a mailbox compatible with the OMAP Mailbox, as defined in Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml. I note that documents title reads "TI OMAP2+ and K3 Mailbox devices". I'll drop the "OMAP" here. > > + communication with the remote processor. This property > > should match > > + with the sub-mailbox node used in the firmware image. > > + maxItems: 1 > > + > > + memory-region: > > + description: | > > + phandle to the reserved memory nodes to be associated with > > the > > + remoteproc device. There should be at least two reserved > > memory nodes > > + defined. > > Don't repeat constraints in free form text. > > > The reserved memory nodes should be carveout nodes, and > > + should be defined with a "no-map" property as per the > > bindings in > > + Documentation/devicetree/bindings/reserved-memory/reserved- > > memory.yaml > > + minItems: 2 > > + maxItems: 8 > > + items: > > + - description: region used for dynamic DMA allocations like > > vrings and > > + vring buffers > > + - description: region reserved for firmware image sections > > + additionalItems: true > > And what is the purpose of the rest of reserved nodes? > Up to 8 regions can be specified with their purpose determined by the firmware running on the M4F core. The suggestion (and the implementation in the example firmware) is to use the first 2 regions as defined above for remoteproc with the others available to be used for other purposes if necessary. The address translation module used can cope with up to 8 regions. > Martyn
On 07/03/2023 19:26, Martyn Welch wrote: > On Fri, 2023-03-03 at 09:06 +0100, Krzysztof Kozlowski wrote: >> On 02/03/2023 18:14, Martyn Welch wrote: >> >>> + >>> + mboxes: >>> + description: | >>> + OMAP Mailbox specifier denoting the sub-mailbox, to be used >>> for >> >> OMAP? >> > > This device uses a mailbox compatible with the OMAP Mailbox, as defined > in Documentation/devicetree/bindings/mailbox/ti,omap-mailbox.yaml. > > I note that documents title reads "TI OMAP2+ and K3 Mailbox devices". > I'll drop the "OMAP" here. > >>> + communication with the remote processor. This property >>> should match >>> + with the sub-mailbox node used in the firmware image. >>> + maxItems: 1 >>> + >>> + memory-region: >>> + description: | >>> + phandle to the reserved memory nodes to be associated with >>> the >>> + remoteproc device. There should be at least two reserved >>> memory nodes >>> + defined. >> >> Don't repeat constraints in free form text. >> >>> The reserved memory nodes should be carveout nodes, and >>> + should be defined with a "no-map" property as per the >>> bindings in >>> + Documentation/devicetree/bindings/reserved-memory/reserved- >>> memory.yaml >>> + minItems: 2 >>> + maxItems: 8 >>> + items: >>> + - description: region used for dynamic DMA allocations like >>> vrings and >>> + vring buffers >>> + - description: region reserved for firmware image sections >>> + additionalItems: true >> >> And what is the purpose of the rest of reserved nodes? >> > > Up to 8 regions can be specified with their purpose determined by the > firmware running on the M4F core. The suggestion (and the > implementation in the example firmware) is to use the first 2 regions > as defined above for remoteproc with the others available to be used > for other purposes if necessary. The address translation module used > can cope with up to 8 regions. Then mention the rest is just dedicated to the firmware and it's purpose depends on the firmware. Best regards, Krzysztof
Hi Martyn, Due to the size of this patch my comments will likely span a few days. I will clearly let you know when I am done reviewing your submission. On Thu, Mar 02, 2023 at 05:14:48PM +0000, Martyn Welch wrote: > From: Hari Nagalla <hnagalla@ti.com> > > K3 AM64x SoC has a Cortex M4F subsystem in the MCU voltage domain. > The remote processor's life cycle management and IPC mechanisms are > similar across the R5F and M4F cores from remote processor driver > point of view. However, there are subtle differences in image loading > and starting the M4F subsystems. > > The YAML binding document provides the various node properties to be > configured by the consumers of the M4F subsystem. > > Signed-off-by: Hari Nagalla <hnagalla@ti.com> > [Martyn Welch: Amended as per review comments and to pass DT tests] This isn't needed. Since you are taking over this patchset it is expected you will make modifications. > Signed-off-by: Martyn Welch <martyn.welch@collabora.com> > --- > > Changes since v1: > - Spelling corrections > - Corrected to pass DT checks > > Changes since v2: > - Missed spelling correction to commit message > > Note: The only review comment that I don't see directly addressed is the > lack of description of `ti,sci`, `ti,sci-dev-id` and > `ti,sci-proc-ids`. A reference has been added to > `/schemas/arm/keystone/ti,k3-sci-common.yaml#` where they are > described. I believe this is the correct approach, please advise if > that is not the case. > > .../bindings/remoteproc/ti,k3-m4f-rproc.yaml | 158 ++++++++++++++++++ > 1 file changed, 158 insertions(+) > create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml > > diff --git a/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml > new file mode 100644 > index 000000000000..1b38df0be2e6 > --- /dev/null > +++ b/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml > @@ -0,0 +1,158 @@ > +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/remoteproc/ti,k3-m4f-rproc.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: TI K3 M4F processor subsystems > + > +maintainers: > + - Hari Nagalla <hnagalla@ti.com> > + Hari did not finish upstreaming this set. As such I doubt he intents to maintain it and I suppose it is the same for you since you didn't add your name either. You can add my name there. > +description: | > + Some K3 family SoCs have Arm Cortex M4F cores. AM64x is a SoC in K3 > + family with a M4F core. Typically safety oriented applications may use > + the M4F core in isolation without an IPC. Where as some industrial and > + home automation applications, may use the M4F core as a remote processor > + with IPC communications. > + > +$ref: /schemas/arm/keystone/ti,k3-sci-common.yaml# > + > +properties: > + $nodename: > + pattern: "^m4fss(@.*)?" > + > + compatible: > + enum: > + - ti,am64-m4fss > + > + power-domains: > + description: | > + Should contain a phandle to a PM domain provider node and an args > + specifier containing the M4FSS device id value. > + maxItems: 1 > + > + "#address-cells": > + const: 2 > + > + "#size-cells": > + const: 2 > + > + reg: > + items: > + - description: Address and Size of the IRAM internal memory region > + - description: Address and Size of the DRAM internal memory region > + > + reg-names: > + items: > + - const: iram > + - const: dram > + > + resets: > + description: | > + Should contain the phandle to the reset controller node managing the > + local resets for this device, and a reset specifier. > + maxItems: 1 > + > + firmware-name: > + description: | > + Should contain the name of the default firmware image > + file located on the firmware search path > + > + mboxes: > + description: | > + OMAP Mailbox specifier denoting the sub-mailbox, to be used for > + communication with the remote processor. This property should match > + with the sub-mailbox node used in the firmware image. > + maxItems: 1 > + > + memory-region: > + description: | > + phandle to the reserved memory nodes to be associated with the > + remoteproc device. There should be at least two reserved memory nodes > + defined. The reserved memory nodes should be carveout nodes, and > + should be defined with a "no-map" property as per the bindings in > + Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml > + minItems: 2 > + maxItems: 8 > + items: > + - description: region used for dynamic DMA allocations like vrings and > + vring buffers > + - description: region reserved for firmware image sections > + additionalItems: true > + > +required: > + - compatible > + - reg > + - reg-names > + - ti,sci > + - ti,sci-dev-id > + - ti,sci-proc-ids > + - resets > + - firmware-name > + - mboxes The 'mboxes' property is marked as required but the description section above clearly state the M4F can operate without IPC. > + - memory-region > + > +unevaluatedProperties: false > + > +examples: > + - | > + reserved-memory { > + #address-cells = <2>; > + #size-cells = <2>; > + > + mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 { > + compatible = "shared-dma-pool"; > + reg = <0x00 0x9cb00000 0x00 0x100000>; > + no-map; > + }; > + > + mcu_m4fss_memory_region: m4f-memory@9cc00000 { > + compatible = "shared-dma-pool"; > + reg = <0x00 0x9cc00000 0x00 0xe00000>; > + no-map; > + }; > + }; > + > + soc { > + #address-cells = <2>; > + #size-cells = <2>; > + > + mailbox0_cluster0: mailbox-0 { > + #mbox-cells = <1>; > + > + mbox_m4_0: mbox-m4-0 { > + ti,mbox-rx = <0 0 0>; > + ti,mbox-tx = <1 0 0>; > + }; > + }; > + > + bus@f0000 { > + compatible = "simple-bus"; > + #address-cells = <2>; > + #size-cells = <2>; > + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; > + > + bus@4000000 { > + compatible = "simple-bus"; > + #address-cells = <2>; > + #size-cells = <2>; > + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; > + > + mcu_m4fss: m4fss@5000000 { > + compatible = "ti,am64-m4fss"; > + reg = <0x00 0x5000000 0x00 0x30000>, > + <0x00 0x5040000 0x00 0x10000>; > + reg-names = "iram", "dram"; > + ti,sci = <&dmsc>; > + ti,sci-dev-id = <9>; > + ti,sci-proc-ids = <0x18 0xff>; > + resets = <&k3_reset 9 1>; > + firmware-name = "am62-mcu-m4f0_0-fw"; > + mboxes = <&mailbox0_cluster0 &mbox_m4_0>; This doesn't look right since mbox_m4_0 is defined within mailbox0_cluster0. > + memory-region = <&mcu_m4fss_dma_memory_region>, > + <&mcu_m4fss_memory_region>; > + }; > + }; > + }; > + }; > -- > 2.39.1 >
On 3/8/23 14:58, Mathieu Poirier wrote: >> +required: >> + - compatible >> + - reg >> + - reg-names >> + - ti,sci >> + - ti,sci-dev-id >> + - ti,sci-proc-ids >> + - resets >> + - firmware-name >> + - mboxes > The 'mboxes' property is marked as required but the description section above > clearly state the M4F can operate without IPC. > Well, when the M4F is used as a safety processor it is typically booted from SBL/u-boot and may isolate the MCU domain from main domain/A53 to function in higher safety level. In these scenarios there is no remote proc handling of M4F life cycle management (LCM) and IPC. But, on the other hand, when the M4F is used as a non safety processor its LCM is handled by remote proc(main domain) and mailboxes for IPC are required.
On Thu, Mar 09, 2023 at 05:18:01PM -0600, Hari Nagalla wrote: > On 3/8/23 14:58, Mathieu Poirier wrote: > > > +required: > > > + - compatible > > > + - reg > > > + - reg-names > > > + - ti,sci > > > + - ti,sci-dev-id > > > + - ti,sci-proc-ids > > > + - resets > > > + - firmware-name > > > + - mboxes > > The 'mboxes' property is marked as required but the description section above > > clearly state the M4F can operate without IPC. > > > Well, when the M4F is used as a safety processor it is typically booted from > SBL/u-boot and may isolate the MCU domain from main domain/A53 to function > in higher safety level. In these scenarios there is no remote proc handling > of M4F life cycle management (LCM) and IPC. But, on the other hand, when the > M4F is used as a non safety processor its LCM is handled by remote proc(main > domain) and mailboxes for IPC are required. Well, what you wrote above is pretty much explained verbatim in the "description" section of the bindings. Mailboxes are optional and as such should not be found under the "required" section.
On Fri, 2023-03-10 at 08:41 -0700, Mathieu Poirier wrote: > On Thu, Mar 09, 2023 at 05:18:01PM -0600, Hari Nagalla wrote: > > On 3/8/23 14:58, Mathieu Poirier wrote: > > > > +required: > > > > + - compatible > > > > + - reg > > > > + - reg-names > > > > + - ti,sci > > > > + - ti,sci-dev-id > > > > + - ti,sci-proc-ids > > > > + - resets > > > > + - firmware-name > > > > + - mboxes > > > The 'mboxes' property is marked as required but the description > > > section above > > > clearly state the M4F can operate without IPC. > > > > > Well, when the M4F is used as a safety processor it is typically > > booted from > > SBL/u-boot and may isolate the MCU domain from main domain/A53 to > > function > > in higher safety level. In these scenarios there is no remote proc > > handling > > of M4F life cycle management (LCM) and IPC. But, on the other hand, > > when the > > M4F is used as a non safety processor its LCM is handled by remote > > proc(main > > domain) and mailboxes for IPC are required. > > Well, what you wrote above is pretty much explained verbatim in the > "description" section of the bindings. Mailboxes are optional and as > such > should not be found under the "required" section. > Which means the memory regions are also optional as in the isolated case they're be no communications with the main domain. Martyn
On Wed, 2023-03-08 at 13:58 -0700, Mathieu Poirier wrote: > On Thu, Mar 02, 2023 at 05:14:48PM +0000, Martyn Welch wrote: > > > +examples: > > + - | > > + reserved-memory { > > + #address-cells = <2>; > > + #size-cells = <2>; > > + > > + mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 { > > + compatible = "shared-dma-pool"; > > + reg = <0x00 0x9cb00000 0x00 0x100000>; > > + no-map; > > + }; > > + > > + mcu_m4fss_memory_region: m4f-memory@9cc00000 { > > + compatible = "shared-dma-pool"; > > + reg = <0x00 0x9cc00000 0x00 0xe00000>; > > + no-map; > > + }; > > + }; > > + > > + soc { > > + #address-cells = <2>; > > + #size-cells = <2>; > > + > > + mailbox0_cluster0: mailbox-0 { > > + #mbox-cells = <1>; > > + > > + mbox_m4_0: mbox-m4-0 { > > + ti,mbox-rx = <0 0 0>; > > + ti,mbox-tx = <1 0 0>; > > + }; > > + }; > > + > > + bus@f0000 { > > + compatible = "simple-bus"; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 > > 0x01ff1400>; > > + > > + bus@4000000 { > > + compatible = "simple-bus"; > > + #address-cells = <2>; > > + #size-cells = <2>; > > + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 > > 0x01ff1400>; > > + > > + mcu_m4fss: m4fss@5000000 { > > + compatible = "ti,am64-m4fss"; > > + reg = <0x00 0x5000000 0x00 0x30000>, > > + <0x00 0x5040000 0x00 0x10000>; > > + reg-names = "iram", "dram"; > > + ti,sci = <&dmsc>; > > + ti,sci-dev-id = <9>; > > + ti,sci-proc-ids = <0x18 0xff>; > > + resets = <&k3_reset 9 1>; > > + firmware-name = "am62-mcu-m4f0_0-fw"; > > + mboxes = <&mailbox0_cluster0 &mbox_m4_0>; > > This doesn't look right since mbox_m4_0 is defined within > mailbox0_cluster0. > Looking at other users of the omap mailboxes (and not wanting to spend ages trawling back through the mailing list archives to try and work out why it's specified the way it is) it seems that this is the way that these mailboxes are specified. For instance in `arch/arm/boot/dts/omap4-l4.dtsi`, the mailbox is defined: mailbox: mailbox@0 { compatible = "ti,omap4-mailbox"; reg = <0x0 0x200>; interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>; #mbox-cells = <1>; ti,mbox-num-users = <3>; ti,mbox-num-fifos = <8>; mbox_ipu: mbox-ipu { ti,mbox-tx = <0 0 0>; ti,mbox-rx = <1 0 0>; }; mbox_dsp: mbox-dsp { ti,mbox-tx = <3 0 0>; ti,mbox-rx = <2 0 0>; }; }; It's users in `arch/arm/boot/dts/omap4.dtsi`: dsp: dsp { ... mboxes = <&mailbox &mbox_dsp>; ... }; ipu: ipu@55020000 { ... mboxes = <&mailbox &mbox_ipu>; ... }; > > + memory-region = > > <&mcu_m4fss_dma_memory_region>, > > + <&mcu_m4fss_memory_region>; > > + }; > > + }; > > + }; > > + }; > > -- > > 2.39.1 > >
diff --git a/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml b/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml new file mode 100644 index 000000000000..1b38df0be2e6 --- /dev/null +++ b/Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml @@ -0,0 +1,158 @@ +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/remoteproc/ti,k3-m4f-rproc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI K3 M4F processor subsystems + +maintainers: + - Hari Nagalla <hnagalla@ti.com> + +description: | + Some K3 family SoCs have Arm Cortex M4F cores. AM64x is a SoC in K3 + family with a M4F core. Typically safety oriented applications may use + the M4F core in isolation without an IPC. Where as some industrial and + home automation applications, may use the M4F core as a remote processor + with IPC communications. + +$ref: /schemas/arm/keystone/ti,k3-sci-common.yaml# + +properties: + $nodename: + pattern: "^m4fss(@.*)?" + + compatible: + enum: + - ti,am64-m4fss + + power-domains: + description: | + Should contain a phandle to a PM domain provider node and an args + specifier containing the M4FSS device id value. + maxItems: 1 + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + reg: + items: + - description: Address and Size of the IRAM internal memory region + - description: Address and Size of the DRAM internal memory region + + reg-names: + items: + - const: iram + - const: dram + + resets: + description: | + Should contain the phandle to the reset controller node managing the + local resets for this device, and a reset specifier. + maxItems: 1 + + firmware-name: + description: | + Should contain the name of the default firmware image + file located on the firmware search path + + mboxes: + description: | + OMAP Mailbox specifier denoting the sub-mailbox, to be used for + communication with the remote processor. This property should match + with the sub-mailbox node used in the firmware image. + maxItems: 1 + + memory-region: + description: | + phandle to the reserved memory nodes to be associated with the + remoteproc device. There should be at least two reserved memory nodes + defined. The reserved memory nodes should be carveout nodes, and + should be defined with a "no-map" property as per the bindings in + Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml + minItems: 2 + maxItems: 8 + items: + - description: region used for dynamic DMA allocations like vrings and + vring buffers + - description: region reserved for firmware image sections + additionalItems: true + +required: + - compatible + - reg + - reg-names + - ti,sci + - ti,sci-dev-id + - ti,sci-proc-ids + - resets + - firmware-name + - mboxes + - memory-region + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + + mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 { + compatible = "shared-dma-pool"; + reg = <0x00 0x9cb00000 0x00 0x100000>; + no-map; + }; + + mcu_m4fss_memory_region: m4f-memory@9cc00000 { + compatible = "shared-dma-pool"; + reg = <0x00 0x9cc00000 0x00 0xe00000>; + no-map; + }; + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + + mailbox0_cluster0: mailbox-0 { + #mbox-cells = <1>; + + mbox_m4_0: mbox-m4-0 { + ti,mbox-rx = <0 0 0>; + ti,mbox-tx = <1 0 0>; + }; + }; + + bus@f0000 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; + + bus@4000000 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>; + + mcu_m4fss: m4fss@5000000 { + compatible = "ti,am64-m4fss"; + reg = <0x00 0x5000000 0x00 0x30000>, + <0x00 0x5040000 0x00 0x10000>; + reg-names = "iram", "dram"; + ti,sci = <&dmsc>; + ti,sci-dev-id = <9>; + ti,sci-proc-ids = <0x18 0xff>; + resets = <&k3_reset 9 1>; + firmware-name = "am62-mcu-m4f0_0-fw"; + mboxes = <&mailbox0_cluster0 &mbox_m4_0>; + memory-region = <&mcu_m4fss_dma_memory_region>, + <&mcu_m4fss_memory_region>; + }; + }; + }; + };