From patchwork Tue Nov 22 10:54:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Yadav X-Patchwork-Id: 13053057 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD42BC4332F for ; Wed, 23 Nov 2022 05:31:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235796AbiKWFbE (ORCPT ); Wed, 23 Nov 2022 00:31:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235800AbiKWFbC (ORCPT ); Wed, 23 Nov 2022 00:31:02 -0500 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79638ED713 for ; Tue, 22 Nov 2022 21:30:56 -0800 (PST) Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20221123053054epoutp03de7854f6d057177e262d75277bef965c~qH7CGJIkS0249602496epoutp03U for ; Wed, 23 Nov 2022 05:30:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20221123053054epoutp03de7854f6d057177e262d75277bef965c~qH7CGJIkS0249602496epoutp03U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1669181454; bh=uNgkOuD3RPHcSBkSiq6pg/mVd4Fv7cnPoyYY63AMJPU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jRC1OQVwG8SXLa5jAG+w5IgGefdc/fMBXKMa+lWJJR0v5Ip2YBNBCGzPv1ISN5vcT IlUfI3IP67yx31JOOp6Ye2CEP6la9p80mXvyXo5NQMgLtk88SOUiagHOsGTowlRMdt ltvL8EESgLh34hwZKLgzT6B6s4B32skUDwxTzohA= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p3.samsung.com (KnoxPortal) with ESMTP id 20221123053054epcas5p314c5706d2a650b1ccb7e7046bde2854e~qH7BWnxEq2606226062epcas5p3Z; Wed, 23 Nov 2022 05:30:54 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.181]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4NH8qH2Nsvz4x9QL; Wed, 23 Nov 2022 05:30:51 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 9A.FF.39477.B00BD736; Wed, 23 Nov 2022 14:30:51 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20221122105022epcas5p3f5db1c5790b605bac8d319fe06ad915b~p4orKHLp42891928919epcas5p3H; Tue, 22 Nov 2022 10:50:22 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221122105022epsmtrp2b68721a6754af3ac3845ff1df5c78888~p4orIvhDV3232832328epsmtrp2S; Tue, 22 Nov 2022 10:50:22 +0000 (GMT) X-AuditID: b6c32a4a-259fb70000019a35-f1-637db00bd847 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 09.72.14392.E69AC736; Tue, 22 Nov 2022 19:50:22 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221122105019epsmtip1b22090c23b59f16edbbbe6ac857a6127~p4ooOtWSA0765207652epsmtip1b; Tue, 22 Nov 2022 10:50:19 +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 1/2] can: m_can: Move mram init to mcan device setup Date: Tue, 22 Nov 2022 16:24:54 +0530 Message-Id: <20221122105455.39294-2-vivek.2311@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221122105455.39294-1-vivek.2311@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VTe1BUVRzu3H3cC87GDVBOW9F6s4ydAXcRtoOBvQiuSg0zTDk2k8vOcocl 4O62d9dHSUJmDaiAiCnEY0UZZSFYlgVx5bkSqTuBA0Xho1iJYggQoSGVAdtlof77ft/5vvP9 zu+cQ/D8e4ViIo01MHpWlUEJffktV0JeDl1jyVLLztb6oZGKFiFyNDXjqKz/Cz6q7OkToLHe uzjKH3fx0I2WfAGyjg4JkPmfkzzkmtiJBu1lQnS6vwNDDVXFfNRrWofmnZMAVTX/jSPXTBuO Sm+0CtDh9h4c3ZqsF6BHZ67wUfWvlwSvr6NtNcMYbbIa6fsDtwBtNecK6dtDbUK66dxBumBR Rt/r+ElI59vMgF76vByn56zBiWs+SI/WMKoURi9hWLU2JY1NjaF2JCnfUkYqZPJQeRR6hZKw qkwmhopNSAyNS8twH5WS7FFlGN1UoorjqE1bo/Vao4GRaLScIYZidCkZughdGKfK5IxsahjL GLbIZbLwSLcwOV1TXGPBdTOB+xznO0E2qHoqD/gQkIyAjsfFgjzgS/iTlwEcKcrhe4tZACuu 12LeYh7AzgcVvF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q2wefVtWMXr8a5rL7vF5k1wA dxSXTUpqTmZZapG+XQJXxpSVG9gLPohUHFq+n7GBcZFgFyMnh4SAicTWk7uYuhi5OIQEdjNK /Pj8hhkiISUx5cxLFghbWGLlv+fsEEXNTBJ/d81jB0mwCWhJPO5cwAKSEBHYzSTxtnsuWBWz wCImiZdXesFGCQu4S/zd/wasg0VAVeJ850FWEJtXwFpi57mDjBAr5CVWbzgAVs8pYCNx4PoO sHohoJrH8xqYJjDyLWBkWMUomVpQnJueW2xYYJiXWq5XnJhbXJqXrpecn7uJERxDWpo7GLev +qB3iJGJg/EQowQHs5IIb71nTbIQb0piZVVqUX58UWlOavEhRmkOFiVx3gtdJ+OFBNITS1Kz U1MLUotgskwcnFINTKxbZLQfPVV4uFNlxe3ParfEpz3zy52RajM17Id3A1urcOB1n9tV0TPm 7Zi3SrV4yrYqEQM+jXNrmWMePY26Htoh/nBH+er1gj8qHNND55vMDJ7xsHbdyY+b/3zffeuh 3wS/Ob+zJv3ufPGw0cXdnn1yUf3i55dW/tl3Sv0n5+0FZ+N38p9/m8z74M7kFXmBOe6Sun+L CsO385Ub7W6LPBOS2/t3I9dh9xCepUdWOSeY7DdmrQ9oltt+JU/mTM66Axd0rGVLNXi/ymik TI2ZfzLxlc6V2xynf8dMezrjwR2nN2wzNZRmrnN7futwyLYYvk97L99b0LVx5mvWeBExZq7Q sMeNq7wiSxUWBmX9nbNRiaU4I9FQi7moOBEAm1k9ARADAAA= X-CMS-MailID: 20221122105022epcas5p3f5db1c5790b605bac8d319fe06ad915b X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221122105022epcas5p3f5db1c5790b605bac8d319fe06ad915b References: <20221122105455.39294-1-vivek.2311@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org When we try to access the mcan message ram addresses, hclk is gated by any other drivers or disabled, because of that probe gets failed. Move the mram init functionality to mcan device setup called by mcan class register from mcan probe function, by that time clocks are enabled. Signed-off-by: Chandrasekar R Signed-off-by: Vivek Yadav --- drivers/net/can/m_can/m_can.c | 4 ++-- drivers/net/can/m_can/m_can.h | 1 + drivers/net/can/m_can/m_can_platform.c | 21 +++++++++++++++++---- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index a776cab1a5a4..5956f0b4d5b1 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1516,9 +1516,9 @@ static int m_can_dev_setup(struct m_can_classdev *cdev) } if (cdev->ops->init) - cdev->ops->init(cdev); + err = cdev->ops->init(cdev); - return 0; + return err; } static void m_can_stop(struct net_device *dev) diff --git a/drivers/net/can/m_can/m_can.h b/drivers/net/can/m_can/m_can.h index 401410022823..c6e77b93f4a2 100644 --- a/drivers/net/can/m_can/m_can.h +++ b/drivers/net/can/m_can/m_can.h @@ -93,6 +93,7 @@ struct m_can_classdev { int is_peripheral; struct mram_cfg mcfg[MRAM_CFG_NUM]; + bool mram_cfg_flag; }; struct m_can_classdev *m_can_class_allocate_dev(struct device *dev, int sizeof_priv); diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index b5a5bedb3116..1a65b0d256fb 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -67,11 +67,28 @@ static int iomap_write_fifo(struct m_can_classdev *cdev, int offset, return 0; } +static int plat_init(struct m_can_classdev *cdev) +{ + int ret = 0; + + if (!cdev->mram_cfg_flag) { + /* Initialize mcan message ram */ + ret = m_can_init_ram(cdev); + if (ret) + return ret; + + cdev->mram_cfg_flag = true; + } + + return 0; +} + static struct m_can_ops m_can_plat_ops = { .read_reg = iomap_read_reg, .write_reg = iomap_write_reg, .write_fifo = iomap_write_fifo, .read_fifo = iomap_read_fifo, + .init = plat_init, }; static int m_can_plat_probe(struct platform_device *pdev) @@ -140,10 +157,6 @@ static int m_can_plat_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mcan_class); - ret = m_can_init_ram(mcan_class); - if (ret) - goto probe_fail; - pm_runtime_enable(mcan_class->dev); ret = m_can_class_register(mcan_class); if (ret) From patchwork Tue Nov 22 10:54:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Yadav X-Patchwork-Id: 13053058 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99A65C4332F for ; Wed, 23 Nov 2022 05:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235841AbiKWFbM (ORCPT ); Wed, 23 Nov 2022 00:31:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235804AbiKWFbC (ORCPT ); Wed, 23 Nov 2022 00:31:02 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C471ED70E for ; Tue, 22 Nov 2022 21:30:58 -0800 (PST) Received: from epcas5p4.samsung.com (unknown [182.195.41.42]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221123053056epoutp0191bbc51433a836135c2fc3735b5cec56~qH7DyBNLl0869908699epoutp01g for ; Wed, 23 Nov 2022 05:30:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221123053056epoutp0191bbc51433a836135c2fc3735b5cec56~qH7DyBNLl0869908699epoutp01g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1669181456; bh=zxEW4aRMNY+I/kBJaywdBjCo9sOxx8Km7j9aqHAo5dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N3xv1MSVXXMVKmGc9pQXYtr6a95+WWRkh6SqcfB6rMvYKEX+jK4SfPgIvLBlhwY4E ATXqsm1mG+PA57j+xLZ/6neI5dPeAlujkW5bBMwCy5Yz6UMQNP0oWpsAXu+uZ72mgE rxG9oazgZuDoBtEIYSU8h5avtNs2YQyVUWXMFJs0= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20221123053056epcas5p1301c275ddcbdaea62ae9a8108af57075~qH7DYM08H2401924019epcas5p1T; Wed, 23 Nov 2022 05:30:56 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.177]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4NH8qL1yPqz4x9Q3; Wed, 23 Nov 2022 05:30:54 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 07.77.56352.D00BD736; Wed, 23 Nov 2022 14:30:54 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20221122105027epcas5p2237c5bc9ab02cf12f6e0f603c5bb90c4~p4ov8AEnc2771827718epcas5p2b; Tue, 22 Nov 2022 10:50:27 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20221122105027epsmtrp169d1cede51b1841bb5ee1c8979606b4e~p4ov6-EoG0938009380epsmtrp1z; Tue, 22 Nov 2022 10:50:27 +0000 (GMT) X-AuditID: b6c32a4b-383ff7000001dc20-5d-637db00d7ce5 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 47.8B.18644.379AC736; Tue, 22 Nov 2022 19:50:27 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20221122105024epsmtip16d9c1b80cccb7f2649509e879aa615ed~p4osxvLtU0765207652epsmtip1c; Tue, 22 Nov 2022 10:50:24 +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 2/2] arm64: dts: fsd: Add MCAN device node Date: Tue, 22 Nov 2022 16:24:55 +0530 Message-Id: <20221122105455.39294-3-vivek.2311@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221122105455.39294-1-vivek.2311@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0VTe0xTVxz23Ht7Wx4lN4XhsdmguWFjMoFWW3ZwoAYZuz4SMf6xbMsGtVwo oa+0xW06xDA0gQQKIltFVMS68VgQy6tFIKwobLKJPGRDGBYEwxxTB45lE8igt27/fd+X7zu/ xzlHgItcpFiQqTOzRp1SQ5O+RGvP5ojIgMYclfTauB9yX2glkauphY8qB/IJdPHGbR6a7Z3m o+K5KRzdaS3mIfuDUR6q+6scR1OP3kXD7ZUksg50Yehq9RkC9VYFo6X+eYCqW57x0dTTDj6q uOPgoZOdN/hofL6Bh/651EOgK5NO3q5gprl2DGOq7NnMH0PjgLHXFZDMxGgHyTTZchnLipR5 0nWXZIqb6wCzmneezyzaQ5L93s+KU7PKNNYoYXUqfVqmLiOe3ncoZXeKIkY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jdou+Fw+ZLS5s62O12PT4GqvFqu9TmS0evgq3uLxrDpvFjPP7mCzW L5rCYnFsgZjFt9NvGC0Wbf3CbvHwwx52i1kXdrBatO49wm5x+806VotfCw+zWCy9t5PVQcxj y8qbTB4LNpV6fLx0m9Fj06pONo871/aweWxeUu/R/9fA4/2+q2wefVtWMXr8a5rL7vF5k1wA dxSXTUpqTmZZapG+XQJXxr+uiUwFM9Qrrj6dydLAuFu+i5GTQ0LAROJK1yHGLkYuDiGBHYwS TctnM0EkpCSmnHnJAmELS6z895wdoqiZSeLFjkusIAk2AS2Jx50LWEASIgK7mSTeds8Fq2IW WMQk8fJKLzNIlbCArcT8a8fAxrIIqEq8mHoIqIODg1fAWmLdnnSIDfISqzccACvnFLCROHB9 BzuILQRU8nheA9MERr4FjAyrGCVTC4pz03OLDQuM8lLL9YoTc4tL89L1kvNzNzGCI0hLawfj nlUf9A4xMnEwHmKU4GBWEuGt96xJFuJNSaysSi3Kjy8qzUktPsQozcGiJM57oetkvJBAemJJ anZqakFqEUyWiYNTqoGJ74xhUvql0GlLffw2sX46ujHQasZelb63Ul7bZn85dePP0gXlq3sX qD9bz8zUrRsruXOqeVtYmn3Nf9OXSwtLj89/5ng6tz179fUm++nqh9bvCvBvfytVeWf2rGXn pBVy0s8fitdut35tbOR5X4N118cvwSJMEzmn5roX7IrYESv/uulyileM2/6iW3ZyVW9PflKt Pi4bcWcPR9199pNp/2yWrGV5fuX67Z6dPWkGfVNOLZwoIaSwxzc9qaJ6m/BC0yM3t/q9K9zR Vmczveb81TNKdc5SbeJZy3l/MZ5b7bD92eFVB5u4GnqDXnwOPuIxcarG5O0KTaLnLqdf1TpZ FyO8/WiNdu8//h1vnW/8UGIpzkg01GIuKk4EAGRmXl4PAwAA X-CMS-MailID: 20221122105027epcas5p2237c5bc9ab02cf12f6e0f603c5bb90c4 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221122105027epcas5p2237c5bc9ab02cf12f6e0f603c5bb90c4 References: <20221122105455.39294-1-vivek.2311@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add MCAN device node and enable the same for FSD platform. This also adds the required pin configuration for the same. Signed-off-by: Sriranjani P Signed-off-by: Vivek Yadav Reviewed-by: Pankaj Dubey --- 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 | 68 ++++++++++++++++++++++ 3 files changed, 112 insertions(+) diff --git a/arch/arm64/boot/dts/tesla/fsd-evb.dts b/arch/arm64/boot/dts/tesla/fsd-evb.dts index 1db6ddf03f01..af3862e9fe3b 100644 --- a/arch/arm64/boot/dts/tesla/fsd-evb.dts +++ b/arch/arm64/boot/dts/tesla/fsd-evb.dts @@ -34,6 +34,22 @@ clock-frequency = <24000000>; }; +&m_can0 { + status = "okay"; +}; + +&m_can1 { + status = "okay"; +}; + +&m_can2 { + status = "okay"; +}; + +&m_can3 { + status = "okay"; +}; + &serial_0 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi b/arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi index d0abb9aa0e9e..bb5289ebfef3 100644 --- a/arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi +++ b/arch/arm64/boot/dts/tesla/fsd-pinctrl.dtsi @@ -339,6 +339,34 @@ samsung,pin-pud = ; samsung,pin-drv = ; }; + + m_can0_bus: m-can0-bus-pins { + samsung,pins = "gpd0-0", "gpd0-1"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + m_can1_bus: m-can1-bus-pins { + samsung,pins = "gpd0-2", "gpd0-3"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + m_can2_bus: m-can2-bus-pins { + samsung,pins = "gpd0-4", "gpd0-5"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; + + m_can3_bus: m-can3-bus-pins { + samsung,pins = "gpd0-6", "gpd0-7"; + samsung,pin-function = ; + samsung,pin-pud = ; + samsung,pin-drv = ; + }; }; &pinctrl_pmu { diff --git a/arch/arm64/boot/dts/tesla/fsd.dtsi b/arch/arm64/boot/dts/tesla/fsd.dtsi index f35bc5a288c2..dfdb32514887 100644 --- a/arch/arm64/boot/dts/tesla/fsd.dtsi +++ b/arch/arm64/boot/dts/tesla/fsd.dtsi @@ -755,6 +755,74 @@ interrupts = ; }; + m_can0: can@14088000 { + compatible = "bosch,m_can"; + reg = <0x0 0x14088000 0x0 0x0200>, + <0x0 0x14080000 0x0 0x8000>; + reg-names = "m_can", "message_ram"; + interrupts = , + ; + interrupt-names = "int0", "int1"; + pinctrl-names = "default"; + pinctrl-0 = <&m_can0_bus>; + clocks = <&clock_peric PERIC_MCAN0_IPCLKPORT_PCLK>, + <&clock_peric PERIC_MCAN0_IPCLKPORT_CCLK>; + clock-names = "hclk", "cclk"; + bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + status = "disabled"; + }; + + m_can1: can@14098000 { + compatible = "bosch,m_can"; + reg = <0x0 0x14098000 0x0 0x0200>, + <0x0 0x14090000 0x0 0x8000>; + reg-names = "m_can", "message_ram"; + interrupts = , + ; + interrupt-names = "int0", "int1"; + pinctrl-names = "default"; + pinctrl-0 = <&m_can1_bus>; + clocks = <&clock_peric PERIC_MCAN1_IPCLKPORT_PCLK>, + <&clock_peric PERIC_MCAN1_IPCLKPORT_CCLK>; + clock-names = "hclk", "cclk"; + bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + status = "disabled"; + }; + + m_can2: can@140a8000 { + compatible = "bosch,m_can"; + reg = <0x0 0x140a8000 0x0 0x0200>, + <0x0 0x140a0000 0x0 0x8000>; + reg-names = "m_can", "message_ram"; + interrupts = , + ; + interrupt-names = "int0", "int1"; + pinctrl-names = "default"; + pinctrl-0 = <&m_can2_bus>; + clocks = <&clock_peric PERIC_MCAN2_IPCLKPORT_PCLK>, + <&clock_peric PERIC_MCAN2_IPCLKPORT_CCLK>; + clock-names = "hclk", "cclk"; + bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + status = "disabled"; + }; + + m_can3: can@140b8000 { + compatible = "bosch,m_can"; + reg = <0x0 0x140b8000 0x0 0x0200>, + <0x0 0x140b0000 0x0 0x8000>; + reg-names = "m_can", "message_ram"; + interrupts = , + ; + interrupt-names = "int0", "int1"; + pinctrl-names = "default"; + pinctrl-0 = <&m_can3_bus>; + clocks = <&clock_peric PERIC_MCAN3_IPCLKPORT_PCLK>, + <&clock_peric PERIC_MCAN3_IPCLKPORT_CCLK>; + clock-names = "hclk", "cclk"; + bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>; + status = "disabled"; + }; + spi_0: spi@14140000 { compatible = "tesla,fsd-spi"; reg = <0x0 0x14140000 0x0 0x100>;