From patchwork Mon May 1 22:31:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Judith Mendez X-Patchwork-Id: 89190 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp218724vqo; Mon, 1 May 2023 15:41:08 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vLL1XmIxET3t7DP1+QKY9JOtCH8t+DbEP/ajT73JDzzfepkOOiX7c2wdrxzxM2MHXh+Db X-Received: by 2002:a05:6a00:a0a:b0:63f:1c78:4049 with SMTP id p10-20020a056a000a0a00b0063f1c784049mr20303804pfh.31.1682980868419; Mon, 01 May 2023 15:41:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682980868; cv=none; d=google.com; s=arc-20160816; b=ahJnykKm/BcfumHR4Wc+A1A0+8rBFolUmCPkCvMiMUJNqEjQX19Bg4vAndKf+lXQ4X F379Kk/ATr58yiUOH5DXbE8kAZnfZipEFOrmEOYqnvn0GCZEI5H3wvcJe9CHgMtYpoll qCTzclDCOeusk0tJS6Tm6c3/ibX0rMOJBIetBVPtSC1xtV0fsqzd1r7YlcZ0Sxc70hGz M+zmiSMPrzP8d6mv0n0iyF5pLQ1KoiU5vm5t1Nk0Hl8ednevg8fcuJItOH9J2REm6vRP Xy8dhZ8k1TpoOHxuBmxy6ch6mzpmcoD3tPCqJ0UM7SUEDovVlK4dIc/ccnDERS9MPVAO K/tQ== 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=VsEa8VMR3JqO+ntx9VYuIlONylNKXfO65d8OFdZhIAa5XnHEO2chDfcGJl3Me569fI FjZrAWycWHgaoct2Al/q8ytWPSEJmrzg8YcwWZgLiDgk/Uh7rZ8b1YrlNbL2BYu1bi+Z KzULEbEg1kYL5OWnHogyu8DcVj7FORbA4+7yyeKvKVjyyjMb9hzbJFb8Rl59d2pUd4zO rQRuQCE+bjcW/4frL+4m42MaAM8JYU1hqMMWRG0J8dg9m4x8ZD4hnerzSEGte1nM77It J9I32m6x680Bwr5N52ZLeu9hVuIYyW8QfxCtEfCIJ5ZmhT0A9Yi0T+WmDOvbrZGa3p4i T6sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=l02eWcsc; 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 t6-20020a625f06000000b0063806e9892fsi26255698pfb.243.2023.05.01.15.40.54; Mon, 01 May 2023 15:41:08 -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=l02eWcsc; 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 S233095AbjEAWcW (ORCPT + 99 others); Mon, 1 May 2023 18:32:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232627AbjEAWcK (ORCPT ); Mon, 1 May 2023 18:32:10 -0400 Received: from lelv0142.ext.ti.com (lelv0142.ext.ti.com [198.47.23.249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1F4830E4; Mon, 1 May 2023 15:32:07 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 341MVMEs014801; Mon, 1 May 2023 17:31:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1682980282; bh=sJojSr8Wpe0gZ6WbySQHjNOucNb6OIRfQCVF8zDaBpM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=l02eWcsc3PheABDBW5Rpsq9hAUkyYI6WMy5ylB8N0YEpLX46m2hmVFddbiamvyCHC wvKTn1bR6vtpoyxa9hNAFb63krE3HDNSsCId2CuwRoIMrvk8Ri4sXaO84KE48hZzNQ G7+8VDwW8fKZxmV6Kw3s+vKoiVuvl/7jPg1R2WlE= Received: from DFLE112.ent.ti.com (dfle112.ent.ti.com [10.64.6.33]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 341MVMNU027912 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 1 May 2023 17:31:22 -0500 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE112.ent.ti.com (10.64.6.33) 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:31:21 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE107.ent.ti.com (10.64.6.28) 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:31:22 -0500 Received: from a0498204.dal.design.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 341MVLEH023009; Mon, 1 May 2023 17:31:21 -0500 From: Judith Mendez To: Chandrasekar Ramakrishnan , Wolfgang Grandegger , Marc Kleine-Budde , Krzysztof Kozlowski CC: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , , , , Schuyler Patton , Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , , , Oliver Hartkopp , Simon Horman Subject: [PATCH v3 1/4] dt-bindings: net: can: Add poll-interval for MCAN Date: Mon, 1 May 2023 17:31:18 -0500 Message-ID: <20230501223121.21663-2-jm@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230501223121.21663-1-jm@ti.com> References: <20230501223121.21663-1-jm@ti.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764733346963676894?= X-GMAIL-MSGID: =?utf-8?q?1764733346963676894?= 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 --- 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 + 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 can@20e8000 { compatible = "bosch,m_can"; @@ -149,4 +163,22 @@ examples: }; }; + - | + // Example with timer polling + #include + 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>; + }; + }; + ...