Message ID | 20230501224624.13866-2-jm@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp230775vqo; Mon, 1 May 2023 16:10:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7jeN3k92NnXeNwIVFBejaNO2g30heN/BDx6KNeG3uJLQ+ILX4agHq1SKlSRsekwVShN8OK X-Received: by 2002:a05:6a00:179c:b0:63a:fb40:891a with SMTP id s28-20020a056a00179c00b0063afb40891amr23528845pfg.2.1682982610731; Mon, 01 May 2023 16:10:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682982610; cv=none; d=google.com; s=arc-20160816; b=EMohO7+iiRM33TL0PZEGl+/UYmaZ70kD0YDBN0wiVhtfrc6sIvMZm+Xe1XGIgZlsDD qMBiBGnqtuMSGLMCe/15Du3gjVd3nrb1vjgLgE12q8Jlc34IwL6xA6M3NoEzfj2a1tI7 rHBEsNcyKcdy7MKS8Jz7L8LYqls9shai//vu2b/ZxWwz1ZLTCg3SkUc+eDaRHY/+rF1G 92Dct+GttM52trir4RLC7kEPq6Qle71swnA7u3j1j3aIMYYNre9lgwToSNBF9i6ReK59 cjJT3ymbZlrp5sorhcHHSqLVWOoL2CiMAu09gfJSiTqGA8Ff6GYoobiwUB2Mer0m2nhu Qm1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=sJojSr8Wpe0gZ6WbySQHjNOucNb6OIRfQCVF8zDaBpM=; b=lokVfljbcmCU0wgRRi2Uiy0ygtR+oS2pw4zsaZ5NVSP/+9mjdIe8xx8S6fsK1oXa6W ptPSLuDaCPBLb9IYT7xmJBDkEHfYTyHC3JWmgslJ5wA8hya6xTtFUZqSXXQF1pJb5CL7 LHKMBoBBxDoRs1uI+ltSoR5+dEhYzVJwiS2KZ0B5tPzDUF90RoznwxMi4pl18v0EbwNV s0kiZGCrzz5TfjOUT95ftVOUKAkM6Zr1VYvDwgMyMoHVqQXa4DbtR3+dYXkNR6RVcz2U xv45LBjJJ2hpfcBYPXMvm4pOc/116McabqRbE9SgumJ/3iA1Z4aY64/pvyByv4oavIaI IL2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Q9pOKvah; 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=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 73-20020a63014c000000b004dab94e3f03si29049632pgb.758.2023.05.01.16.09.57; Mon, 01 May 2023 16:10:10 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=Q9pOKvah; 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=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233036AbjEAWq6 (ORCPT <rfc822;rbbytesnap@gmail.com> + 99 others); Mon, 1 May 2023 18:46:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbjEAWqx (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 1 May 2023 18:46:53 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57D63269E; Mon, 1 May 2023 15:46:52 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 341MkO60051539; Mon, 1 May 2023 17:46:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1682981185; bh=sJojSr8Wpe0gZ6WbySQHjNOucNb6OIRfQCVF8zDaBpM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Q9pOKvahu8I43lNS4u3dDrXUWd6BlOvkFUQI06NQvifLvZi8hZGgMwguCpO9OnmD+ IAme34HDX3JgT7E5ePErO6N35TGtY2AtNMZOvlRMuKOsDA6EMSET6LEGCTQ0WUwWC4 +AGjulaH0QoJpxqYiRfHYuMH3nXJ4cit6n8/VHs8= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 341MkOAE004491 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 May 2023 17:46:24 -0500 Received: from DFLE111.ent.ti.com (10.64.6.32) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Mon, 1 May 2023 17:46:24 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Mon, 1 May 2023 17:46:24 -0500 Received: from a0498204.dal.design.ti.com (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 341MkOhe002097; Mon, 1 May 2023 17:46:24 -0500 From: Judith Mendez <jm@ti.com> To: Chandrasekar Ramakrishnan <rcsekar@samsung.com>, Wolfgang Grandegger <wg@grandegger.com>, Marc Kleine-Budde <mkl@pengutronix.de>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org> CC: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, <linux-can@vger.kernel.org>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, Schuyler Patton <spatton@ti.com>, Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>, Tero Kristo <kristo@kernel.org>, Rob Herring <robh+dt@kernel.org>, <linux-arm-kernel@lists.infradead.org>, <devicetree@vger.kernel.org>, Oliver Hartkopp <socketcan@hartkopp.net>, Simon Horman <simon.horman@corigine.com> Subject: [PATCH v4 1/4] dt-bindings: net: can: Add poll-interval for MCAN Date: Mon, 1 May 2023 17:46:21 -0500 Message-ID: <20230501224624.13866-2-jm@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230501224624.13866-1-jm@ti.com> References: <20230501224624.13866-1-jm@ti.com> MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1764735174054124849?= X-GMAIL-MSGID: =?utf-8?q?1764735174054124849?= |
Series |
Enable multiple MCAN on AM62x
|
|
Commit Message
Judith Mendez
May 1, 2023, 10:46 p.m. UTC
On AM62x SoC, MCANs on MCU domain do not have hardware interrupt
routed to A53 Linux, instead they will use software interrupt by
hrtimer. To enable timer method, interrupts should be optional so
remove interrupts property from required section and introduce
poll-interval property.
Signed-off-by: Judith Mendez <jm@ti.com>
---
Changelog:
v3:
1. Move binding patch to first in series
2. Update description for poll-interval
3. Add oneOf to specify using interrupts/interrupt-names or poll-interval
4. Fix example property: add comment below 'example'
v2:
1. Add poll-interval property to enable timer polling method
2. Add example using poll-interval property
.../bindings/net/can/bosch,m_can.yaml | 36 +++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
Comments
On Mon, May 01, 2023 at 05:46:21PM -0500, Judith Mendez wrote: > On AM62x SoC, MCANs on MCU domain do not have hardware interrupt > routed to A53 Linux, instead they will use software interrupt by > hrtimer. To enable timer method, interrupts should be optional so > remove interrupts property from required section and introduce > poll-interval property. > > Signed-off-by: Judith Mendez <jm@ti.com> > --- > Changelog: > v3: > 1. Move binding patch to first in series > 2. Update description for poll-interval > 3. Add oneOf to specify using interrupts/interrupt-names or poll-interval > 4. Fix example property: add comment below 'example' > > v2: > 1. Add poll-interval property to enable timer polling method > 2. Add example using poll-interval property > > .../bindings/net/can/bosch,m_can.yaml | 36 +++++++++++++++++-- > 1 file changed, 34 insertions(+), 2 deletions(-) > > diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > index 67879aab623b..c024ee49962c 100644 > --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > @@ -14,6 +14,13 @@ maintainers: > allOf: > - $ref: can-controller.yaml# > > +oneOf: > + - required: > + - interrupts > + - interrupt-names > + - required: > + - poll-interval Move this next to 'required'. > + > properties: > compatible: > const: bosch,m_can > @@ -40,6 +47,14 @@ properties: > - const: int1 > minItems: 1 > > + poll-interval: > + $ref: /schemas/types.yaml#/definitions/flag This is a common property already defined as a uint32. You shouldn't define a new type. A flag doesn't even make sense. If that's all you need, then just enable polling if no interrupt is present. > + description: Enable hrtimer polling method for an M_CAN device. > + If this property is defined in MCAN node, it tells the driver to > + enable polling method for an MCAN device. If for an MCAN device, > + hardware interrupt is found and hrtimer polling method is enabled, What's hrtimer? (Don't put Linuxisms in bindings) > + the driver will use hardware interrupt method. > + > clocks: > items: > - description: peripheral clock > @@ -122,8 +137,6 @@ required: > - compatible > - reg > - reg-names > - - interrupts > - - interrupt-names > - clocks > - clock-names > - bosch,mram-cfg > @@ -132,6 +145,7 @@ additionalProperties: false > > examples: > - | > + // Example with interrupts > #include <dt-bindings/clock/imx6sx-clock.h> > can@20e8000 { > compatible = "bosch,m_can"; > @@ -149,4 +163,22 @@ examples: > }; > }; > > + - | > + // Example with timer polling > + #include <dt-bindings/clock/imx6sx-clock.h> > + can@20e8000 { > + compatible = "bosch,m_can"; > + reg = <0x020e8000 0x4000>, <0x02298000 0x4000>; > + reg-names = "m_can", "message_ram"; > + poll-interval; > + clocks = <&clks IMX6SX_CLK_CANFD>, > + <&clks IMX6SX_CLK_CANFD>; > + clock-names = "hclk", "cclk"; > + bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>; > + > + can-transceiver { > + max-bitrate = <5000000>; > + }; > + }; > + > ... > -- > 2.17.1 >
On 05.05.2023 16:29:48, Rob Herring wrote: > On Mon, May 01, 2023 at 05:46:21PM -0500, Judith Mendez wrote: > > On AM62x SoC, MCANs on MCU domain do not have hardware interrupt > > routed to A53 Linux, instead they will use software interrupt by > > hrtimer. To enable timer method, interrupts should be optional so > > remove interrupts property from required section and introduce > > poll-interval property. > > > > Signed-off-by: Judith Mendez <jm@ti.com> > > --- > > Changelog: > > v3: > > 1. Move binding patch to first in series > > 2. Update description for poll-interval > > 3. Add oneOf to specify using interrupts/interrupt-names or poll-interval > > 4. Fix example property: add comment below 'example' > > > > v2: > > 1. Add poll-interval property to enable timer polling method > > 2. Add example using poll-interval property > > > > .../bindings/net/can/bosch,m_can.yaml | 36 +++++++++++++++++-- > > 1 file changed, 34 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > > index 67879aab623b..c024ee49962c 100644 > > --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > > +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml > > @@ -14,6 +14,13 @@ maintainers: > > allOf: > > - $ref: can-controller.yaml# > > > > +oneOf: > > + - required: > > + - interrupts > > + - interrupt-names > > + - required: > > + - poll-interval > > Move this next to 'required'. > > > + > > properties: > > compatible: > > const: bosch,m_can > > @@ -40,6 +47,14 @@ properties: > > - const: int1 > > minItems: 1 > > > > + poll-interval: > > + $ref: /schemas/types.yaml#/definitions/flag > > This is a common property already defined as a uint32. You shouldn't > define a new type. > > A flag doesn't even make sense. If that's all you need, then just enable > polling if no interrupt is present. Ok, then it's implicit. No IRQs -> polling. Marc
Hello all, On 5/9/23 07:27, Marc Kleine-Budde wrote: > On 05.05.2023 16:29:48, Rob Herring wrote: >> On Mon, May 01, 2023 at 05:46:21PM -0500, Judith Mendez wrote: >>> On AM62x SoC, MCANs on MCU domain do not have hardware interrupt >>> routed to A53 Linux, instead they will use software interrupt by >>> hrtimer. To enable timer method, interrupts should be optional so >>> remove interrupts property from required section and introduce >>> poll-interval property. >>> >>> Signed-off-by: Judith Mendez <jm@ti.com> >>> --- >>> Changelog: >>> v3: >>> 1. Move binding patch to first in series >>> 2. Update description for poll-interval >>> 3. Add oneOf to specify using interrupts/interrupt-names or poll-interval >>> 4. Fix example property: add comment below 'example' >>> >>> v2: >>> 1. Add poll-interval property to enable timer polling method >>> 2. Add example using poll-interval property >>> >>> .../bindings/net/can/bosch,m_can.yaml | 36 +++++++++++++++++-- >>> 1 file changed, 34 insertions(+), 2 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml >>> index 67879aab623b..c024ee49962c 100644 >>> --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml >>> +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml >>> @@ -14,6 +14,13 @@ maintainers: >>> allOf: >>> - $ref: can-controller.yaml# >>> >>> +oneOf: >>> + - required: >>> + - interrupts >>> + - interrupt-names >>> + - required: >>> + - poll-interval >> >> Move this next to 'required'. >> >>> + >>> properties: >>> compatible: >>> const: bosch,m_can >>> @@ -40,6 +47,14 @@ properties: >>> - const: int1 >>> minItems: 1 >>> >>> + poll-interval: >>> + $ref: /schemas/types.yaml#/definitions/flag >> >> This is a common property already defined as a uint32. You shouldn't >> define a new type. >> >> A flag doesn't even make sense. If that's all you need, then just enable >> polling if no interrupt is present. > > Ok, then it's implicit. No IRQs -> polling. Ok, will send out a v5 with these updates. Thanks. regards, Judith
diff --git a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml index 67879aab623b..c024ee49962c 100644 --- a/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml +++ b/Documentation/devicetree/bindings/net/can/bosch,m_can.yaml @@ -14,6 +14,13 @@ maintainers: allOf: - $ref: can-controller.yaml# +oneOf: + - required: + - interrupts + - interrupt-names + - required: + - poll-interval + properties: compatible: const: bosch,m_can @@ -40,6 +47,14 @@ properties: - const: int1 minItems: 1 + poll-interval: + $ref: /schemas/types.yaml#/definitions/flag + description: Enable hrtimer polling method for an M_CAN device. + If this property is defined in MCAN node, it tells the driver to + enable polling method for an MCAN device. If for an MCAN device, + hardware interrupt is found and hrtimer polling method is enabled, + the driver will use hardware interrupt method. + clocks: items: - description: peripheral clock @@ -122,8 +137,6 @@ required: - compatible - reg - reg-names - - interrupts - - interrupt-names - clocks - clock-names - bosch,mram-cfg @@ -132,6 +145,7 @@ additionalProperties: false examples: - | + // Example with interrupts #include <dt-bindings/clock/imx6sx-clock.h> can@20e8000 { compatible = "bosch,m_can"; @@ -149,4 +163,22 @@ examples: }; }; + - | + // Example with timer polling + #include <dt-bindings/clock/imx6sx-clock.h> + can@20e8000 { + compatible = "bosch,m_can"; + reg = <0x020e8000 0x4000>, <0x02298000 0x4000>; + reg-names = "m_can", "message_ram"; + poll-interval; + clocks = <&clks IMX6SX_CLK_CANFD>, + <&clks IMX6SX_CLK_CANFD>; + clock-names = "hclk", "cclk"; + bosch,mram-cfg = <0x0 0 0 32 0 0 0 1>; + + can-transceiver { + max-bitrate = <5000000>; + }; + }; + ...