Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1191051ybd; Wed, 26 Jun 2019 12:55:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg8uccejJBnpxLfn2lbmc3URlr5PY+rYE8k81Bki3i6GKWEnXVMalBijjKmT+Jea2/aiCw X-Received: by 2002:a17:902:2926:: with SMTP id g35mr7450156plb.269.1561578939669; Wed, 26 Jun 2019 12:55:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561578939; cv=none; d=google.com; s=arc-20160816; b=oJgz2p5mcN4eRcT1kbqzfZGCQBjgrJhUEfNER6x/p30flRHmZrxHlgO2/jkV2+EKgD 0s1quocwiDJY1hon7sFeEm4SqiSAeD8sJt+lFaUQiqmL4llHHAgX77puohIf1IOPmb45 uJdNoJAZUC5LbsS1OeFm9MpUU6ozftTNHgUGdHMU+ShqJj/WPjmdZy7XsUnR91YXomLd a9BMXIa6j9EQoj3KmXHq3koRLDRciXJh/UbTorglxI+89WTGTyy+05fXu1EmKmCNBKzF rD+wenuwxlpR/ID/ZiHgw+rYQ4ltlYumtiEXNXlxdewHDHpwx5nCfILR3oN7HidoMu3r wiRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UOrxYNKBEIodo14aOxVepox58QF+OcFwCebXOg4TV0w=; b=OmVZnws2W2y0L6wW61rbVvziGKiiXlfULYD81HVQG+2c8aM4R5WpcqDTBRR4baZ6Bb z97MXGy16+hpw5GEOW0ljzic1cYKuXx02TonPEjPmgHZKcKglj6P1mi6oPe8C0oKFkkx aqu4ueq4Vs38fx524MecyBdFEoUyw2JIOJNE8MkMnoz1t6ifZd4+StN32vPOSEyMbcH6 e7PJb/qfyMpxH8Ni8AoI76azeJna2q7BgFQtaICeNnSd2NeqtcieNnAMJduzUt4fQ6nk eDXI45AjeF8dncvHRUPvsbcgrU4rRkbv7gNNRt4/vsQJntJdCE7TM6iS5/X/vhn31vXY cglQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bmq634H6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a144si11658pfd.72.2019.06.26.12.55.22; Wed, 26 Jun 2019 12:55:39 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bmq634H6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726379AbfFZTy4 (ORCPT + 99 others); Wed, 26 Jun 2019 15:54:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:35284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726239AbfFZTy4 (ORCPT ); Wed, 26 Jun 2019 15:54:56 -0400 Received: from mail-qt1-f182.google.com (mail-qt1-f182.google.com [209.85.160.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4ADD521743; Wed, 26 Jun 2019 19:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561578894; bh=KcD7c6hKQWEu008qT9k7dg3vhdqwpsDp6Y4IxD3yQtY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Bmq634H6AuhkvTnl8ByQlWQL/et5bCg6GiQTU5Wxxehw+bAuRb3PkWlvdgnru+wCQ 2PQRhYhjDO3qBaziCHuszbI+M2cOK/wL4p1Xc9eMDvtykqpH0hKsutQSyEzWLPlWnY zufBuEQ9BqcgM/yNiD7c1mDEb0uCBK/Gy4rSXdO8= Received: by mail-qt1-f182.google.com with SMTP id h21so3743858qtn.13; Wed, 26 Jun 2019 12:54:54 -0700 (PDT) X-Gm-Message-State: APjAAAWEmaXPrBAYkBIDnLXJx61Xg27o2oO0me0vBE9W0HCQej/v9t23 79fp8GIN90OO9Hcy0SGCXEyL5/iz+V/u0wjvog== X-Received: by 2002:a0c:baa1:: with SMTP id x33mr4102705qvf.200.1561578893478; Wed, 26 Jun 2019 12:54:53 -0700 (PDT) MIME-Version: 1.0 References: <20190614081650.11880-1-daniel.baluta@nxp.com> <20190614081650.11880-3-daniel.baluta@nxp.com> In-Reply-To: From: Rob Herring Date: Wed, 26 Jun 2019 13:54:40 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] dt-bindings: arm: fsl: Add DSP IPC binding support To: Daniel Baluta Cc: Daniel Baluta , Shawn Guo , Sascha Hauer , "S.j. Wang" , Fabio Estevam , NXP Linux Team , Dong Aisheng , Anson Huang , "linux-kernel@vger.kernel.org" , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , Mark Rutland , Devicetree List , Oleksij Rempel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 26, 2019 at 8:49 AM Daniel Baluta wrote: > > Hi Rob, > > This is my first time documenting the bindings using the > new yaml format so thanks for your patience and explanations! > > On Fri, Jun 14, 2019 at 5:53 PM Rob Herring wrote: > > > > On Fri, Jun 14, 2019 at 2:15 AM wrote: > > > > > > From: Daniel Baluta > > > > > > DSP IPC is the layer that allows the Host CPU to communicate > > > with DSP firmware. > > > DSP is part of some i.MX8 boards (e.g i.MX8QM, i.MX8QXP) > > > > > > Signed-off-by: Daniel Baluta > > > --- > > > .../bindings/arm/freescale/fsl,dsp.yaml | 43 +++++++++++++++++++ > > > > bindings/dsp/... > > Fair enough. Will fix in v2. > > > > > > 1 file changed, 43 insertions(+) > > > create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,dsp.yaml > > > > > > diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,dsp.yaml b/Documentation/devicetree/bindings/arm/freescale/fsl,dsp.yaml > > > new file mode 100644 > > > index 000000000000..16d9df1d397b > > > --- /dev/null > > > +++ b/Documentation/devicetree/bindings/arm/freescale/fsl,dsp.yaml > > > @@ -0,0 +1,43 @@ > > > +# SPDX-License-Identifier: GPL-2.0 > > > > The preference is to dual license new bindings: GPL-2.0 OR BSD-2-Clause > > > > > +%YAML 1.2 > > > +--- > > > +$id: http://devicetree.org/schemas/arm/freescale/fsl,dsp.yaml# > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > + > > > +title: NXP i.MX IPC DSP driver > > > > This isn't a driver. > > I see. This node is actually the representation of DSP IPC so not a driver. > > > > > + > > > +maintainers: > > > + - Daniel Baluta > > > + > > > +description: | > > > + IPC communication layer between Host CPU and DSP on NXP i.MX8 platforms > > > + > > > +properties: > > > + compatible: > > > + enum: > > > + - fsl,imx-dsp > > > > You can have a fallback, but it needs SoC specific compatible(s). > Agree. Will fix in v2. > > > > > > + > > > + mboxes: > > > + description: > > > + List of phandle of 2 MU channels for TXDB, 2 MU channels for RXDB > > > + (see mailbox/fsl,mu.txt) > > > + maxItems: 1 > > > > Should be 4? > > Actually is just a list with 1 item. I think is the terminology: > > You can have an example here of the mboxes defined for SCU. > https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/freescale/imx8qxp.dtsi#L123 mboxes = <&lsio_mu1 0 0 &lsio_mu1 0 1 &lsio_mu1 0 2 &lsio_mu1 0 3 &lsio_mu1 1 0 &lsio_mu1 1 1 &lsio_mu1 1 2 &lsio_mu1 1 3 &lsio_mu1 3 3>; Logically, this is 9 entries and each entry is 3 cells ( or phandle plus 2 cells). More below... > > > + > > > + mbox-names Also, missing a ':' here. This won't build. Make sure you build this (make dt_binding_check). See Documentation/devicetree/writing-schemas.md. > > > + description: > > > + Mailboxes names > > > + allOf: > > > + - $ref: "/schemas/types.yaml#/definitions/string" > > > > No need for this, '*-names' already has a defined type. > So, should I remove the above two lines ? Actually, all 4. There's no need to describe what 'mbox-names' is. > > > + - enum: [ "txdb0", "txdb1", "rxdb0", "rxdb1" ] > > > > Should be an 'items' list with 4 entries? > > Let me better read the yaml spec. But "items" list indeed sounds better. What you should end up with is: items: - const: txdb0 - const: txdb1 - const: rxdb0 - const: rxdb1 This is saying you have 4 strings in the listed order. The enum you had would be a single string of one of the 4 values. > > > +required: > > > + - compatible > > > + - mboxes > > > + - mbox-names > > > > This seems incomplete. How does one boot the DSP? Load firmware? No > > resources that Linux has to manage. Shared memory? > > This is only the IPC mailboxes used by DSP to communicate with Linux. The > loading of the firmware, the resources needed to be managed by Linux, etc > are part of the DSP node. You should just add the mailboxes to the DSP node then. I suppose you didn't because you want 2 drivers? If so, that's the OS's problem and not part of DT. A Linux driver can instantiate devices for other drivers. > To avoid confusion I have renamed this node from dsp to dsp_ipc. > > > > > > + > > > +examples: > > > + - | > > > + dsp { > > > + compatbile = "fsl,imx-dsp"; > > > + mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1"; > > > + mboxes = <&lsio_mu13 2 0 &lsio_mu13 2 1 &lsio_mu13 3 0 &lsio_mu13 3 1>; > > > > mboxes = <&lsio_mu13 2 0>, <&lsio_mu13 2 1>, <&lsio_mu13 3 0>, <&lsio_mu13 3 1>; > > Actually no! It looks like the imx mailbox expects one element with a > list of phandles directions and index. There's not actually any difference in what the OS sees. Both source syntaxes result in the same data encoding in the dtb. It's simply 12 words of data. What's a phandle is only known because the OS knows what 'mboxes' contains and by reading #mbox-cells in lsio_mu13. However, we are using this source grouping to maintain type information to do schema validation. The grouping is kept thru to the yaml encoding (of the DT, not to be confused with the schemas). So we're going to have to start being stricter in dts files. Rob