From patchwork Tue Nov 22 10:54:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Yadav X-Patchwork-Id: 2087 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2605793wrr; Tue, 22 Nov 2022 21:34:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4nOsfTkeIXQSiPPqtt3sg/cN8U2NWKdkzv6PMZ58bqqG1M0amCKzzvJHLpod1fK0M1yWhD X-Received: by 2002:aa7:d405:0:b0:461:b4e2:904d with SMTP id z5-20020aa7d405000000b00461b4e2904dmr7099353edq.216.1669181682828; Tue, 22 Nov 2022 21:34:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669181682; cv=none; d=google.com; s=arc-20160816; b=zTO2c7Dwv/7k5mME1N1AJT/4la4ZKQxC2Jt6ApWf80FFgoFuOs0Q5rW5NnVRXwLU01 G8gLruzuuNh9DUMLNSN4Z8/ioOBtI0+3n5XiGX0FWz5DMGupWu4w9de110ONpqYkgyT8 Jm+8fHnyofT47zHQNZdeOxg5RNcHSSoXiOjaWrsd04ldG2XZXgainbpNSUIWgsE7A5yy 4pTyFcENHT7d5WJWHtinyT5xHPIZvoaDNo4E6Y5h8H7KyJkwJYjVWhmrbJvYnNPjxPTj 6eSJDkrPfUtDuc20D68yLjrmHVUAxcIh6Hhi7VsxCHY0WG+naPZjS22mTg/OoBKGW0y6 bL4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=PeHQNfRsUuOEDOm6P6LGWXjKFyyfkz97NfHAPd4GyJk=; b=GFTJN+DhZDT2E0BHYabZJKS5jySAc2SzAlUDFpSosx8xpMh45n/9e0ekL94huxixWL OhCw3Qy42swOXSS+tXjaVseyjZIDaFridfU9lGDx28n+EYeESVcvusphyu+mAPUetUEC NfPLMzr8H8ozw2wAVA6+hfBTvO/FW+heHOwTkNnVgHUYt402zWZx37aRwaZWNmZVjdFK /yszM5stLX9iE7Og56zY9DEN2b9JubSdlvnZy7gxnv+xN1ero+wOqEZsDj9nSPV9uJuQ 4lq+Dp6K+bylI+N+HstZ8fU4UcEZrWHyOtVirXVK+cggq5A06TlA4fFie+eoprceSV9r az2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=FyTwKChw; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id tz14-20020a170907c78e00b0077ef3eeca17si2522527ejc.155.2022.11.22.21.34.19; Tue, 22 Nov 2022 21:34:42 -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=@samsung.com header.s=mail20170921 header.b=FyTwKChw; 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=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235791AbiKWFa7 (ORCPT + 99 others); Wed, 23 Nov 2022 00:30:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235740AbiKWFa5 (ORCPT ); Wed, 23 Nov 2022 00:30:57 -0500 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4572ED70A for ; Tue, 22 Nov 2022 21:30:53 -0800 (PST) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20221123053050epoutp0492f8f541e4cd824cf595b6a841e69abd~qH6_Xrg-n1477914779epoutp04_ for ; Wed, 23 Nov 2022 05:30:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20221123053050epoutp0492f8f541e4cd824cf595b6a841e69abd~qH6_Xrg-n1477914779epoutp04_ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1669181450; bh=PeHQNfRsUuOEDOm6P6LGWXjKFyyfkz97NfHAPd4GyJk=; h=From:To:Cc:Subject:Date:References:From; b=FyTwKChw3xERiVyLZ19SkFeFxevm+9muH6lVih581kmJzCil/7XySyfjAnEPQcaf/ 0iuqWUMYkgp0UEZXHbOYBbFl9MKGMTaJxpTjzIWHVtNg1aFYsK5NseOd1Zx5EDFS4B RdA23v3sjdt/rPxtYa1QHOF4BymwKVgzDpkJYsCs= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20221123053050epcas5p4b4875f16ba7b937d64c4e5e59a17ea2d~qH690mLxB2883728837epcas5p4W; Wed, 23 Nov 2022 05:30:50 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4NH8qD0kJ3z4x9QH; Wed, 23 Nov 2022 05:30:48 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 37.67.56352.700BD736; Wed, 23 Nov 2022 14:30:47 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20221122105017epcas5p269e97219d3ebe2eaf37fa428a7275f35~p4omNphOz2771827718epcas5p2B; Tue, 22 Nov 2022 10:50:17 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221122105017epsmtrp1f2069736b62669576daefbcaaba036d9~p4omMCJIE0938009380epsmtrp1q; Tue, 22 Nov 2022 10:50:17 +0000 (GMT) X-AuditID: b6c32a4b-383ff7000001dc20-37-637db0073ed9 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 34.72.14392.969AC736; Tue, 22 Nov 2022 19:50:17 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221122105014epsmtip1c52304a7e24ac748f20a126b140ec795~p4ojVM-ao0766107661epsmtip1R; Tue, 22 Nov 2022 10:50:14 +0000 (GMT) From: Vivek Yadav To: rcsekar@samsung.com, krzysztof.kozlowski+dt@linaro.org, wg@grandegger.com, mkl@pengutronix.de, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, pankaj.dubey@samsung.com, ravi.patel@samsung.com, alim.akhtar@samsung.com, linux-fsd@tesla.com, robh+dt@kernel.org Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, aswani.reddy@samsung.com, sriranjani.p@samsung.com, Vivek Yadav Subject: [PATCH v3 0/2] can: mcan: Add MCAN support for FSD SoC Date: Tue, 22 Nov 2022 16:24:53 +0530 Message-Id: <20221122105455.39294-1-vivek.2311@samsung.com> X-Mailer: git-send-email 2.17.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrOJsWRmVeSWpSXmKPExsWy7bCmli77htpkgw97rC0ezNvGZnFo81Z2 iznnW1gs5h85x2rx9Ngjdou+Fw+ZLS5s62O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sh2r5laYZz ztPpLnyLpV8/W+MhpMP+f8fe/9XX3VenPD1lmKWRrTzx2SeD82kX7q+f2Wg0SULiyepPZ8Un zGY0mHcx66TVIhvZSbN9MhvSRQzck0tPFZSXBqlsFW2pPv2ca+H7phuzrZwF+paxmiuxFGck GmoxFxUnAgAFlijH+AIAAA== X-CMS-MailID: 20221122105017epcas5p269e97219d3ebe2eaf37fa428a7275f35 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221122105017epcas5p269e97219d3ebe2eaf37fa428a7275f35 References: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750263852272304820?= X-GMAIL-MSGID: =?utf-8?q?1750263852272304820?= Add support for MCAN instances present on the FSD platform. Vivek Yadav (2): can: m_can: Move mram init to mcan device setup arm64: dts: fsd: Add MCAN device node changes since v2: [PATCH v2 1/6] dt-bindings: Document the SYSREG specific compatibles found on FSD SoC link: https://lore.kernel.org/lkml/20221109100928.109478-2-vivek.2311@samsung.com/ 1: Addressed review comment given by Krzysztof Kozlowski a) As per suggestion separated this patch and posted separately. ref: https://www.spinics.net/lists/kernel/msg4597970.html [PATCH v2 2/6] dt-bindings: can: mcan: Add ECC functionality to message ram link: https://lore.kernel.org/lkml/20221109100928.109478-3-vivek.2311@samsung.com/ 1: Addressed review comment given by Krzysztof Kozlowski a) For now I am dropping this. I will reconsider the implementation and will resend as separate patch. [PATCH v2 3/6] arm64: dts: fsd: add sysreg device node link: https://lore.kernel.org/lkml/20221109100928.109478-4-vivek.2311@samsung.com/ 1: Addressed review comment given by Krzysztof Kozlowski a) Dropped Cc from commit message. b) As per suggestion separated this and corresponding DT-binding patch and posted separately. ref: https://www.spinics.net/lists/kernel/msg4597921.html [PATCH v2 4/6] arm64: dts: fsd: Add MCAN device node link: https://lore.kernel.org/lkml/20221109100928.109478-5-vivek.2311@samsung.com/ 1: Addressed review comment given by Krzysztof Kozlowski a) Aligned the lines. [PATCH v2 5/6] can: m_can: Add ECC functionality for message RAM link: https://lore.kernel.org/lkml/20221109100928.109478-6-vivek.2311@samsung.com/ 1: Addressed review comment given by Krzysztof Kozlowski a) We are dropping this for now and will reconsider it's implementation and resend as separate patch. [PATCH v2 6/6] arm64: dts: fsd: Add support for error correction code for message RAM link: https://lore.kernel.org/lkml/20221109100928.109478-7-vivek.2311@samsung.com/ 1: Addressed review comment given by Krzysztof Kozlowski a) Subject is updated and patch go via ARM SOC tree, we will resend this as separate patch along with ECC patch. changes since v1: [PATCH 0/7] can: mcan: Add MCAN support for FSD SoC 1: Addressed review comment given by Marc Kleine-Budde a) Added my signed off. [PATCH 2/7] dt-bindings: can: mcan: Add ECC functionality to message ram link: https://lore.kernel.org/netdev/87k04oxsvb.fsf@hardanger.blackshift.org/ 1: Addressed review comment given by Marc Kleine-Budde a) Added an example to the yaml that makes use of the mram-ecc-cfg property. b) Added prefix to "mram-ecc-cfg" property and "$ref: /schemas/types.yaml#/definitions/phandle". [PATCH 4/7] can: mcan: enable peripheral clk to access mram link: https://lore.kernel.org/netdev/20221021095833.62406-5-vivek.2311@samsung.com/ 1: Addressed review comment given by Marc Kleine-Budde a) Moved mram init into m_can_dev_setup function by then clocks are enabled and prevent probe failure. b) Added the platform init ops in m_can_plat_ops and moved mram init into it. [PATCH 5/7] arm64: dts: fsd: Add MCAN device node link: https://lore.kernel.org/netdev/20221021095833.62406-6-vivek.2311@samsung.com/ 1: Addressed review comment given by Marc Kleine-Budde a) Added the DT people on Cc. [PATCH 6/7] can: m_can: Add ECC functionality for message RAM link: https://lore.kernel.org/netdev/20221021095833.62406-7-vivek.2311@samsung.com/ 1: Addressed review comment given by kernel test robot. a) Addressed missing prototypes warnings. 2: Addressed review comment given by Marc Kleine-Budde a) Sorted the declaration of local variable by reverse Christmas tree. b) Used syscon_regmap_lookup_by_phandle_args to get the syscon Base Address and offset. c) Used FIELD_PREP instead of logical operation. d) Used regmap_read_poll_timeout API to give timeout condition for ECC cfg done status instead of using while loop counter. e) Moved all the ECC mcaros in m_can.c file and changed the name with a common prefix M_CAN. f) Moved ECC init into platform init function called during m_can device setup. .../devicetree/bindings/arm/tesla-sysreg.yaml | 50 +++++++++++ .../bindings/net/can/bosch,m_can.yaml | 31 +++++++ MAINTAINERS | 1 + arch/arm64/boot/dts/tesla/fsd-evb.dts | 16 ++++ arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi | 28 +++++++ arch/arm64/boot/dts/tesla/fsd.dtsi | 82 +++++++++++++++++++ drivers/net/can/m_can/m_can.c | 48 ++++++++++- drivers/net/can/m_can/m_can.h | 17 ++++ drivers/net/can/m_can/m_can_platform.c | 76 ++++++++++++++++- 9 files changed, 343 insertions(+), 6 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/tesla-sysreg.yaml