Message ID | 20230922075913.422435-9-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5620017vqi; Fri, 22 Sep 2023 07:29:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERkMVfEyk0Qjm2nEqA8xqhdcYin0DP1JFPVHtK5iVY2OelPVKd0hxCEPHVpcY7T0qNRrQj X-Received: by 2002:a05:6a21:78a7:b0:14e:6c19:60f6 with SMTP id bf39-20020a056a2178a700b0014e6c1960f6mr9445269pzc.50.1695392953391; Fri, 22 Sep 2023 07:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695392953; cv=none; d=google.com; s=arc-20160816; b=uHFKeOsw+z+Fr/lpD3otqxgn9atoO/U5I2l8IBRCdGqBqTnTCBHW1rSOzBt60aX57A JHQ2QvcPvKMl6lA4CAIuY9T3UUXQSzXP2XgjvAe8CUGhs68uDRMLixzEPJOK4aSamjHs zXx3ZqZAIqieEMsZnDWdoNQm/nCGbmlHze/xC6TPzWSxfqhIlpLGTx1QoUDSt+4t4N/n R+WD6Vd3FF62DK6UWABsZzs4o2DLKhaJ4sSYalJztlRquoNkN86oV8LUMBu3+pA2sdCq xUPnqbtxNbNZfSbNuKH85RzsFaKuRTx+XRVNNWCh+0BCLaeLk1pfj96m8AVZnhs//zP5 Z3Fg== 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=3Ei1SGBpAQnikHMG2PgG7rf+pMcYro8+X/9szrlFHGc=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=Zsrrk9g4MSQJG6HPqaXEvj1XiRIkLFQCYPU1b+ANk+Mv41yrim1qQL1f7Ol241Xzz0 esx+kkyUjuMcMVMEzDaVJeHotH6D07Jdsmisn3X87N1NAz/OYcR7uMGth7z9zSdZ1NCT oiZf3E+zqCnw+xjKWw0eeD/G97LZnVU/XB+wdPpYhnNYYfkc8Av/RYhg79+im87yvg+Q ZdgUL0M376yUCFshS0zb1OvJnvQKRwThQ83jeBdQf9DTcwvK+aPY4DnubparTY4oeecC U9feAnq/d21vsGFOTPx/8ZWTUoEOTY2XijNXLPxbW5QPbaMNJJ3Y1C1wIqwHdACRmzhM Xj7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EN0N1Rbw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z10-20020a17090a1fca00b00271a0262e88si6177172pjz.4.2023.09.22.07.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 07:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=EN0N1Rbw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id B6304809F38F; Fri, 22 Sep 2023 01:00:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232083AbjIVIAg (ORCPT <rfc822;chrisfriedt@gmail.com> + 30 others); Fri, 22 Sep 2023 04:00:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjIVIAP (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 22 Sep 2023 04:00:15 -0400 Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::228]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0A92CC9; Fri, 22 Sep 2023 00:59:52 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id 1DDC71BF210; Fri, 22 Sep 2023 07:59:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1695369591; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Ei1SGBpAQnikHMG2PgG7rf+pMcYro8+X/9szrlFHGc=; b=EN0N1RbwflOkNfBzO4aA5HnQxKxWRVL7bXCcWdd88EQJhy2wYgbYQ9rFEjUAFBSOGAeeyB PjuFQXcGVErIuIRmsUMP5oD8xatWs0XC2pPO22WyYP5JZJs1JijiaXKHSwo9+nbiRgp26K /FCvaL1zHUQTTpXoCS0ba2jd7wMm9/m1FafcdnonQoQUHkJkpGfnZzUcyHb1DkdA+PcrLy MPA1kmk4WqLz4SCDlQHb07MGhB226BY98b/nKb5+GVSQ5zLvfvXxaMp3R0EmVlVawVmFdZ cQSoDK1lChsHA7Ijo3u57KzE77uYIxZWEEp3sfwk8gxcNGUXC8hwEMddrzysbQ== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Shengjiu Wang <shengjiu.wang@gmail.com>, Xiubo Li <Xiubo.Lee@gmail.com>, Fabio Estevam <festevam@gmail.com>, Nicolin Chen <nicoleotsuka@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Randy Dunlap <rdunlap@infradead.org> Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman <horms@kernel.org>, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v6 08/30] dt-bindings: soc: fsl: cpm_qe: cpm1-scc-qmc: Add support for QMC HDLC Date: Fri, 22 Sep 2023 09:58:43 +0200 Message-ID: <20230922075913.422435-9-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230922075913.422435-1-herve.codina@bootlin.com> References: <20230922075913.422435-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 22 Sep 2023 01:00:57 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777748361912500056 X-GMAIL-MSGID: 1777748361912500056 |
Series |
Add support for QMC HDLC, framer infrastructure and PEF2256 framer
|
|
Commit Message
Herve Codina
Sept. 22, 2023, 7:58 a.m. UTC
The QMC (QUICC mutichannel controller) is a controller present in some
PowerQUICC SoC such as MPC885.
The QMC HDLC uses the QMC controller to transfer HDLC data.
Additionally, a framer can be connected to the QMC HDLC.
If present, this framer is the interface between the TDM bus used by the
QMC HDLC and the E1/T1 line.
The QMC HDLC can use this framer to get information about the E1/T1 line
and configure the E1/T1 line.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
.../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++
1 file changed, 24 insertions(+)
Comments
On Fri, 22 Sep 2023 09:58:43 +0200, Herve Codina wrote: > The QMC (QUICC mutichannel controller) is a controller present in some > PowerQUICC SoC such as MPC885. > The QMC HDLC uses the QMC controller to transfer HDLC data. > > Additionally, a framer can be connected to the QMC HDLC. > If present, this framer is the interface between the TDM bus used by the > QMC HDLC and the E1/T1 line. > The QMC HDLC can use this framer to get information about the E1/T1 line > and configure the E1/T1 line. > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > --- > .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ > 1 file changed, 24 insertions(+) > Reviewed-by: Rob Herring <robh@kernel.org>
On 22/09/2023 09:58, Herve Codina wrote: > The QMC (QUICC mutichannel controller) is a controller present in some > PowerQUICC SoC such as MPC885. > The QMC HDLC uses the QMC controller to transfer HDLC data. > > Additionally, a framer can be connected to the QMC HDLC. > If present, this framer is the interface between the TDM bus used by the > QMC HDLC and the E1/T1 line. > The QMC HDLC can use this framer to get information about the E1/T1 line > and configure the E1/T1 line. > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > --- > .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > index 82d9beb48e00..61dfd5ef7407 100644 > --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > @@ -101,6 +101,27 @@ patternProperties: > Channel assigned Rx time-slots within the Rx time-slots routed by the > TSA to this cell. > > + compatible: > + const: fsl,qmc-hdlc Why this is not a device/SoC specific compatible? > + > + fsl,framer: > + $ref: /schemas/types.yaml#/definitions/phandle > + description: > + phandle to the framer node. The framer is in charge of an E1/T1 line > + interface connected to the TDM bus. It can be used to get the E1/T1 line > + status such as link up/down. > + > + allOf: > + - if: > + properties: > + compatible: > + not: > + contains: > + const: fsl,qmc-hdlc > + then: > + properties: > + fsl,framer: false > + > required: > - reg > - fsl,tx-ts-mask > @@ -159,5 +180,8 @@ examples: > fsl,operational-mode = "hdlc"; > fsl,tx-ts-mask = <0x00000000 0x0000ff00>; > fsl,rx-ts-mask = <0x00000000 0x0000ff00>; > + > + compatible = "fsl,qmc-hdlc"; compatible is always the first property. > + fsl,framer = <&framer>; > }; > }; Best regards, Krzysztof
Hi Krzysztof, On Sat, 23 Sep 2023 19:39:49 +0200 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 22/09/2023 09:58, Herve Codina wrote: > > The QMC (QUICC mutichannel controller) is a controller present in some > > PowerQUICC SoC such as MPC885. > > The QMC HDLC uses the QMC controller to transfer HDLC data. > > > > Additionally, a framer can be connected to the QMC HDLC. > > If present, this framer is the interface between the TDM bus used by the > > QMC HDLC and the E1/T1 line. > > The QMC HDLC can use this framer to get information about the E1/T1 line > > and configure the E1/T1 line. > > > > Signed-off-by: Herve Codina <herve.codina@bootlin.com> > > --- > > .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ > > 1 file changed, 24 insertions(+) > > > > diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > > index 82d9beb48e00..61dfd5ef7407 100644 > > --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > > +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > > @@ -101,6 +101,27 @@ patternProperties: > > Channel assigned Rx time-slots within the Rx time-slots routed by the > > TSA to this cell. > > > > + compatible: > > + const: fsl,qmc-hdlc > > Why this is not a device/SoC specific compatible? This compatible is present in a QMC channel. The parent node (the QMC itself) contains a compatible with device/SoC: --- 8< --- compatible: items: - enum: - fsl,mpc885-scc-qmc - fsl,mpc866-scc-qmc - const: fsl,cpm1-scc-qmc --- 8< --- At the child level (ie QMC channel), I am not sure that adding device/SoC makes sense. This compatible indicates that the QMC channel is handled by the QMC HDLC driver. At this level, whatever the device/SoC, we have to be QMC compliant. With these details, do you still think I need to change the child (channel) compatible ? > > > + > > + fsl,framer: > > + $ref: /schemas/types.yaml#/definitions/phandle > > + description: > > + phandle to the framer node. The framer is in charge of an E1/T1 line > > + interface connected to the TDM bus. It can be used to get the E1/T1 line > > + status such as link up/down. > > + > > + allOf: > > + - if: > > + properties: > > + compatible: > > + not: > > + contains: > > + const: fsl,qmc-hdlc > > + then: > > + properties: > > + fsl,framer: false > > + > > required: > > - reg > > - fsl,tx-ts-mask > > @@ -159,5 +180,8 @@ examples: > > fsl,operational-mode = "hdlc"; > > fsl,tx-ts-mask = <0x00000000 0x0000ff00>; > > fsl,rx-ts-mask = <0x00000000 0x0000ff00>; > > + > > + compatible = "fsl,qmc-hdlc"; > > compatible is always the first property. Will be moved to the first property in the next iteration. Best regards, Hervé > > > + fsl,framer = <&framer>; > > }; > > }; > > Best regards, > Krzysztof >
On 25/09/2023 10:17, Herve Codina wrote: > Hi Krzysztof, > > On Sat, 23 Sep 2023 19:39:49 +0200 > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >> On 22/09/2023 09:58, Herve Codina wrote: >>> The QMC (QUICC mutichannel controller) is a controller present in some >>> PowerQUICC SoC such as MPC885. >>> The QMC HDLC uses the QMC controller to transfer HDLC data. >>> >>> Additionally, a framer can be connected to the QMC HDLC. >>> If present, this framer is the interface between the TDM bus used by the >>> QMC HDLC and the E1/T1 line. >>> The QMC HDLC can use this framer to get information about the E1/T1 line >>> and configure the E1/T1 line. >>> >>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> >>> --- >>> .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ >>> 1 file changed, 24 insertions(+) >>> >>> diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml >>> index 82d9beb48e00..61dfd5ef7407 100644 >>> --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml >>> +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml >>> @@ -101,6 +101,27 @@ patternProperties: >>> Channel assigned Rx time-slots within the Rx time-slots routed by the >>> TSA to this cell. >>> >>> + compatible: >>> + const: fsl,qmc-hdlc >> >> Why this is not a device/SoC specific compatible? > > This compatible is present in a QMC channel. > The parent node (the QMC itself) contains a compatible with device/SoC: > --- 8< --- > compatible: > items: > - enum: > - fsl,mpc885-scc-qmc > - fsl,mpc866-scc-qmc > - const: fsl,cpm1-scc-qmc > --- 8< --- > > At the child level (ie QMC channel), I am not sure that adding device/SoC > makes sense. This compatible indicates that the QMC channel is handled by > the QMC HDLC driver. > At this level, whatever the device/SoC, we have to be QMC compliant. > > With these details, do you still think I need to change the child (channel) > compatible ? From OS point of view, you have a driver binding to this child-level compatible. How do you enforce Linux driver binding based on parent compatible? I looked at your next patch and I did not see it. Best regards, Krzysztof
On Mon, 25 Sep 2023 10:21:15 +0200 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 25/09/2023 10:17, Herve Codina wrote: > > Hi Krzysztof, > > > > On Sat, 23 Sep 2023 19:39:49 +0200 > > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > > >> On 22/09/2023 09:58, Herve Codina wrote: > >>> The QMC (QUICC mutichannel controller) is a controller present in some > >>> PowerQUICC SoC such as MPC885. > >>> The QMC HDLC uses the QMC controller to transfer HDLC data. > >>> > >>> Additionally, a framer can be connected to the QMC HDLC. > >>> If present, this framer is the interface between the TDM bus used by the > >>> QMC HDLC and the E1/T1 line. > >>> The QMC HDLC can use this framer to get information about the E1/T1 line > >>> and configure the E1/T1 line. > >>> > >>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> > >>> --- > >>> .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ > >>> 1 file changed, 24 insertions(+) > >>> > >>> diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > >>> index 82d9beb48e00..61dfd5ef7407 100644 > >>> --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > >>> +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > >>> @@ -101,6 +101,27 @@ patternProperties: > >>> Channel assigned Rx time-slots within the Rx time-slots routed by the > >>> TSA to this cell. > >>> > >>> + compatible: > >>> + const: fsl,qmc-hdlc > >> > >> Why this is not a device/SoC specific compatible? > > > > This compatible is present in a QMC channel. > > The parent node (the QMC itself) contains a compatible with device/SoC: > > --- 8< --- > > compatible: > > items: > > - enum: > > - fsl,mpc885-scc-qmc > > - fsl,mpc866-scc-qmc > > - const: fsl,cpm1-scc-qmc > > --- 8< --- > > > > At the child level (ie QMC channel), I am not sure that adding device/SoC > > makes sense. This compatible indicates that the QMC channel is handled by > > the QMC HDLC driver. > > At this level, whatever the device/SoC, we have to be QMC compliant. > > > > With these details, do you still think I need to change the child (channel) > > compatible ? > > From OS point of view, you have a driver binding to this child-level > compatible. How do you enforce Linux driver binding based on parent > compatible? I looked at your next patch and I did not see it. We do not need to have the child driver binding based on parent. We have to ensure that the child handles a QMC channel and the parent provides a QMC channel. A QMC controller (parent) has to implement the QMC API (include/soc/fsl/qe/qmc.h) and a QMC channel driver (child) has to use the QMC API. Best regards, Hervé > > Best regards, > Krzysztof >
On 25/09/2023 12:27, Herve Codina wrote: > On Mon, 25 Sep 2023 10:21:15 +0200 > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >> On 25/09/2023 10:17, Herve Codina wrote: >>> Hi Krzysztof, >>> >>> On Sat, 23 Sep 2023 19:39:49 +0200 >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: >>> >>>> On 22/09/2023 09:58, Herve Codina wrote: >>>>> The QMC (QUICC mutichannel controller) is a controller present in some >>>>> PowerQUICC SoC such as MPC885. >>>>> The QMC HDLC uses the QMC controller to transfer HDLC data. >>>>> >>>>> Additionally, a framer can be connected to the QMC HDLC. >>>>> If present, this framer is the interface between the TDM bus used by the >>>>> QMC HDLC and the E1/T1 line. >>>>> The QMC HDLC can use this framer to get information about the E1/T1 line >>>>> and configure the E1/T1 line. >>>>> >>>>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> >>>>> --- >>>>> .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ >>>>> 1 file changed, 24 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml >>>>> index 82d9beb48e00..61dfd5ef7407 100644 >>>>> --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml >>>>> +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml >>>>> @@ -101,6 +101,27 @@ patternProperties: >>>>> Channel assigned Rx time-slots within the Rx time-slots routed by the >>>>> TSA to this cell. >>>>> >>>>> + compatible: >>>>> + const: fsl,qmc-hdlc >>>> >>>> Why this is not a device/SoC specific compatible? >>> >>> This compatible is present in a QMC channel. >>> The parent node (the QMC itself) contains a compatible with device/SoC: >>> --- 8< --- >>> compatible: >>> items: >>> - enum: >>> - fsl,mpc885-scc-qmc >>> - fsl,mpc866-scc-qmc >>> - const: fsl,cpm1-scc-qmc >>> --- 8< --- >>> >>> At the child level (ie QMC channel), I am not sure that adding device/SoC >>> makes sense. This compatible indicates that the QMC channel is handled by >>> the QMC HDLC driver. >>> At this level, whatever the device/SoC, we have to be QMC compliant. >>> >>> With these details, do you still think I need to change the child (channel) >>> compatible ? >> >> From OS point of view, you have a driver binding to this child-level >> compatible. How do you enforce Linux driver binding based on parent >> compatible? I looked at your next patch and I did not see it. > > We do not need to have the child driver binding based on parent. Exactly, that's what I said. > We have to ensure that the child handles a QMC channel and the parent provides > a QMC channel. > > A QMC controller (parent) has to implement the QMC API (include/soc/fsl/qe/qmc.h) > and a QMC channel driver (child) has to use the QMC API. How does this solve my concerns? Sorry, I do not understand. Your driver is a platform driver and binds to the generic compatible. How do you solve regular compatibility issues (need for quirks) if parent compatible is not used? How does being QMC compliant affects driver binding and compatibility/quirks? We are back to my original question and I don't think you answered to any of the concerns. Best regards, Krzysztof
On Mon, 25 Sep 2023 12:44:35 +0200 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 25/09/2023 12:27, Herve Codina wrote: > > On Mon, 25 Sep 2023 10:21:15 +0200 > > Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > > > >> On 25/09/2023 10:17, Herve Codina wrote: > >>> Hi Krzysztof, > >>> > >>> On Sat, 23 Sep 2023 19:39:49 +0200 > >>> Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > >>> > >>>> On 22/09/2023 09:58, Herve Codina wrote: > >>>>> The QMC (QUICC mutichannel controller) is a controller present in some > >>>>> PowerQUICC SoC such as MPC885. > >>>>> The QMC HDLC uses the QMC controller to transfer HDLC data. > >>>>> > >>>>> Additionally, a framer can be connected to the QMC HDLC. > >>>>> If present, this framer is the interface between the TDM bus used by the > >>>>> QMC HDLC and the E1/T1 line. > >>>>> The QMC HDLC can use this framer to get information about the E1/T1 line > >>>>> and configure the E1/T1 line. > >>>>> > >>>>> Signed-off-by: Herve Codina <herve.codina@bootlin.com> > >>>>> --- > >>>>> .../soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml | 24 +++++++++++++++++++ > >>>>> 1 file changed, 24 insertions(+) > >>>>> > >>>>> diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > >>>>> index 82d9beb48e00..61dfd5ef7407 100644 > >>>>> --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > >>>>> +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml > >>>>> @@ -101,6 +101,27 @@ patternProperties: > >>>>> Channel assigned Rx time-slots within the Rx time-slots routed by the > >>>>> TSA to this cell. > >>>>> > >>>>> + compatible: > >>>>> + const: fsl,qmc-hdlc > >>>> > >>>> Why this is not a device/SoC specific compatible? > >>> > >>> This compatible is present in a QMC channel. > >>> The parent node (the QMC itself) contains a compatible with device/SoC: > >>> --- 8< --- > >>> compatible: > >>> items: > >>> - enum: > >>> - fsl,mpc885-scc-qmc > >>> - fsl,mpc866-scc-qmc > >>> - const: fsl,cpm1-scc-qmc > >>> --- 8< --- > >>> > >>> At the child level (ie QMC channel), I am not sure that adding device/SoC > >>> makes sense. This compatible indicates that the QMC channel is handled by > >>> the QMC HDLC driver. > >>> At this level, whatever the device/SoC, we have to be QMC compliant. > >>> > >>> With these details, do you still think I need to change the child (channel) > >>> compatible ? > >> > >> From OS point of view, you have a driver binding to this child-level > >> compatible. How do you enforce Linux driver binding based on parent > >> compatible? I looked at your next patch and I did not see it. > > > > We do not need to have the child driver binding based on parent. > > Exactly, that's what I said. > > > We have to ensure that the child handles a QMC channel and the parent provides > > a QMC channel. > > > > A QMC controller (parent) has to implement the QMC API (include/soc/fsl/qe/qmc.h) > > and a QMC channel driver (child) has to use the QMC API. > > How does this solve my concerns? Sorry, I do not understand. Your driver > is a platform driver and binds to the generic compatible. How do you > solve regular compatibility issues (need for quirks) if parent > compatible is not used? > > How does being QMC compliant affects driver binding and > compatibility/quirks? > > We are back to my original question and I don't think you answered to > any of the concerns. Well, to be sure that I understand correctly, do you mean that I should provide a compatible for the child (HDLC) with something like this: --- 8< --- compatible: items: - enum: - fsl,mpc885-qmc-hdlc - fsl,mpc866-qmc-hdlc - const: fsl,cpm1-qmc-hdlc - const: fsl,qmc-hdlc --- 8< --- If so, I didn't do that because a QMC channel consumer (driver matching fsl,qmc-hdlc) doesn't contains any SoC specific part. It uses the channel as a communication channel to send/receive HDLC frames to/from this communication channel. All the specific SoC part is handled by the QMC controller (parent) itself and not by any consumer (child). Best regards, Hervé
On 25/09/2023 15:50, Herve Codina wrote: >>>>> With these details, do you still think I need to change the child (channel) >>>>> compatible ? >>>> >>>> From OS point of view, you have a driver binding to this child-level >>>> compatible. How do you enforce Linux driver binding based on parent >>>> compatible? I looked at your next patch and I did not see it. >>> >>> We do not need to have the child driver binding based on parent. >> >> Exactly, that's what I said. >> >>> We have to ensure that the child handles a QMC channel and the parent provides >>> a QMC channel. >>> >>> A QMC controller (parent) has to implement the QMC API (include/soc/fsl/qe/qmc.h) >>> and a QMC channel driver (child) has to use the QMC API. >> >> How does this solve my concerns? Sorry, I do not understand. Your driver >> is a platform driver and binds to the generic compatible. How do you >> solve regular compatibility issues (need for quirks) if parent >> compatible is not used? >> >> How does being QMC compliant affects driver binding and >> compatibility/quirks? >> >> We are back to my original question and I don't think you answered to >> any of the concerns. > > Well, to be sure that I understand correctly, do you mean that I should > provide a compatible for the child (HDLC) with something like this: > --- 8< --- > compatible: > items: > - enum: > - fsl,mpc885-qmc-hdlc > - fsl,mpc866-qmc-hdlc > - const: fsl,cpm1-qmc-hdlc > - const: fsl,qmc-hdlc > --- 8< --- Yes, more or less, depending on actual compatibility and SoC-family. Maybe "fsl,cpm1-qmc-hdlc" item in the middle is not needed. > > If so, I didn't do that because a QMC channel consumer (driver matching > fsl,qmc-hdlc) doesn't contains any SoC specific part. Just like hundreds of other drivers. :) There is a paragraph about specific compatibles here: https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.html > It uses the channel as a communication channel to send/receive HDLC frames > to/from this communication channel. > All the specific SoC part is handled by the QMC controller (parent) itself and > not by any consumer (child). OK, so you guarantee in 100% for this hardware and all future (including designs unknown currently), that they will be 100% compatible with existing QMC channel consumer (child, matching fsl,qmc-hdlc) driver, thus there will be no need for any quirk. Specifically, there will be no chances that it would be reasonable to re-use the same driver for child (currently fsl,qmc-hdlc) in different parent. P.S. If you received this email twice, apologies, I have here troubles with internet. Best regards, Krzysztof
Hi Krzysztof, On Tue, 26 Sep 2023 22:59:14 +0200 Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote: > On 25/09/2023 15:50, Herve Codina wrote: > >>>>> With these details, do you still think I need to change the child (channel) > >>>>> compatible ? > >>>> > >>>> From OS point of view, you have a driver binding to this child-level > >>>> compatible. How do you enforce Linux driver binding based on parent > >>>> compatible? I looked at your next patch and I did not see it. > >>> > >>> We do not need to have the child driver binding based on parent. > >> > >> Exactly, that's what I said. > >> > >>> We have to ensure that the child handles a QMC channel and the parent provides > >>> a QMC channel. > >>> > >>> A QMC controller (parent) has to implement the QMC API (include/soc/fsl/qe/qmc.h) > >>> and a QMC channel driver (child) has to use the QMC API. > >> > >> How does this solve my concerns? Sorry, I do not understand. Your driver > >> is a platform driver and binds to the generic compatible. How do you > >> solve regular compatibility issues (need for quirks) if parent > >> compatible is not used? > >> > >> How does being QMC compliant affects driver binding and > >> compatibility/quirks? > >> > >> We are back to my original question and I don't think you answered to > >> any of the concerns. > > > > Well, to be sure that I understand correctly, do you mean that I should > > provide a compatible for the child (HDLC) with something like this: > > --- 8< --- > > compatible: > > items: > > - enum: > > - fsl,mpc885-qmc-hdlc > > - fsl,mpc866-qmc-hdlc > > - const: fsl,cpm1-qmc-hdlc > > - const: fsl,qmc-hdlc > > --- 8< --- > > Yes, more or less, depending on actual compatibility and SoC-family. > Maybe "fsl,cpm1-qmc-hdlc" item in the middle is not needed. Ok, I will keep "fsl,cpm1-qmc-hdlc". The CPM1 is the co-processor present in these SoCs and it handles the QMC controller. So, it makes sense to have it in this binding. I plan to add support for other SoCs in the future and for these SoCs, the co-processor is not the CPM1. So, it makes sense to keep "fsl,cpm1-qmc-hdlc" to identify the co-processor. > > > > > If so, I didn't do that because a QMC channel consumer (driver matching > > fsl,qmc-hdlc) doesn't contains any SoC specific part. > > Just like hundreds of other drivers. :) > > There is a paragraph about specific compatibles here: > https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.html > > > > It uses the channel as a communication channel to send/receive HDLC frames > > to/from this communication channel. > > All the specific SoC part is handled by the QMC controller (parent) itself and > > not by any consumer (child). > > OK, so you guarantee in 100% for this hardware and all future (including > designs unknown currently), that they will be 100% compatible with > existing QMC channel consumer (child, matching fsl,qmc-hdlc) driver, > thus there will be no need for any quirk. Specifically, there will be no > chances that it would be reasonable to re-use the same driver for child > (currently fsl,qmc-hdlc) in different parent. Right, compatible strings with SoC and co-processor will be added in the next iteration. Thanks for your feedback. Best regards, Hervé > > P.S. If you received this email twice, apologies, I have here troubles > with internet. > > Best regards, > Krzysztof >
diff --git a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml index 82d9beb48e00..61dfd5ef7407 100644 --- a/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml +++ b/Documentation/devicetree/bindings/soc/fsl/cpm_qe/fsl,cpm1-scc-qmc.yaml @@ -101,6 +101,27 @@ patternProperties: Channel assigned Rx time-slots within the Rx time-slots routed by the TSA to this cell. + compatible: + const: fsl,qmc-hdlc + + fsl,framer: + $ref: /schemas/types.yaml#/definitions/phandle + description: + phandle to the framer node. The framer is in charge of an E1/T1 line + interface connected to the TDM bus. It can be used to get the E1/T1 line + status such as link up/down. + + allOf: + - if: + properties: + compatible: + not: + contains: + const: fsl,qmc-hdlc + then: + properties: + fsl,framer: false + required: - reg - fsl,tx-ts-mask @@ -159,5 +180,8 @@ examples: fsl,operational-mode = "hdlc"; fsl,tx-ts-mask = <0x00000000 0x0000ff00>; fsl,rx-ts-mask = <0x00000000 0x0000ff00>; + + compatible = "fsl,qmc-hdlc"; + fsl,framer = <&framer>; }; };