From patchwork Wed Dec 7 10:06:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Yadav X-Patchwork-Id: 13066957 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 C364DC6370A for ; Wed, 7 Dec 2022 10:36:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbiLGKgH (ORCPT ); Wed, 7 Dec 2022 05:36:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbiLGKgE (ORCPT ); Wed, 7 Dec 2022 05:36:04 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA4732E9CE for ; Wed, 7 Dec 2022 02:36:00 -0800 (PST) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221207103559epoutp01c54002d36518d0d3c937a53934a28915~ufHZXgwlC0906009060epoutp01R for ; Wed, 7 Dec 2022 10:35:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221207103559epoutp01c54002d36518d0d3c937a53934a28915~ufHZXgwlC0906009060epoutp01R DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1670409359; bh=7OMAQpbsGocH22zsW2ocEen3evfSBiClsKxTYz2A12U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YdlQaWyPIH6jxPxwxMFaoCMrdavIWvaYIaOixfCbEPLMXApaU2UlkHtZtLj+b0Tjc w1R6jK3buTAuhtIDiNI68OTMvIk6yveMkk8HZaFBRQd5Z9DrB6vFbxAMjzEhfJJirP ukN8gxXqV/m/cr3rmTY8WkTcVMxHll4DpbZCSmF0= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20221207103558epcas5p1865133bf17ba0a562dddeb48ff783fc0~ufHY4f4n23078230782epcas5p1f; Wed, 7 Dec 2022 10:35:58 +0000 (GMT) Received: from epsmges5p3new.samsung.com (unknown [182.195.38.182]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4NRtws2bRqz4x9Pt; Wed, 7 Dec 2022 10:35:57 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 71.67.56352.D8C60936; Wed, 7 Dec 2022 19:35:57 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20221207100650epcas5p408d280e0e2d2d6acfb5e252e37f504b2~uet8Pv3mn2820728207epcas5p4r; Wed, 7 Dec 2022 10:06:50 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221207100650epsmtrp2f29bd6eb515116b065d19f85931bb13b~uet8OjKJl0765407654epsmtrp2p; Wed, 7 Dec 2022 10:06:50 +0000 (GMT) X-AuditID: b6c32a4b-383ff7000001dc20-ec-63906c8d5519 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 66.FD.14392.AB560936; Wed, 7 Dec 2022 19:06:50 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221207100647epsmtip259d17f4ea7e4adaf034f52c4ad9543c2~uet5baeyq0610006100epsmtip2b; Wed, 7 Dec 2022 10:06:47 +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 v4 1/2] can: m_can: Call the RAM init directly from m_can_chip_config Date: Wed, 7 Dec 2022 15:36:31 +0530 Message-Id: <20221207100632.96200-2-vivek.2311@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221207100632.96200-1-vivek.2311@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA0WTf0xTVxTHuX1975VukDcQuTQTyMvMAhNoZ1svWtwMDh+BTMziiDOk1vLW IqVt+kPUTed0ztHJD2MJSAArwjLLBFagMAVmKoGFATLdOjfc1sKWIBpBYSLiYNCn23+f873n nPu9594rwMI8hEiQp7ewJr1KRxNCvvtaXHxCsa5MLR4YCkW+WjeBPK3tJKq+/gkfnesdxtFf fWMkKpnwY2jEXYIj17gXR865cgz5J7PRzcvVBKq83sNDzXV2PupzrEaPvr8HUF37LIn8010k qhrpxNGJ7l4Sjd5rwtGT89f4qOH3b/A3VzNtF3/hMQ6XlXlwYxQwLmcRwdz2dhFMa/1HTOk/ Ymaq5yeCKWlzAmbxWA3JzLiis154L1+hZVW5rCmW1asNuXl6TQqd8Y4yVSmTiyUJkmS0gY7V qwrYFHprZlZCWp5u+ah07H6VzrosZanMZjpps8JksFrYWK3BbEmhWWOuzig1JppVBWarXpOo Zy0bJWLx67LlxD352pnHh4y+lw903RzlHwUjkTYQLICUFB5vbeLbgFAQRl0BsOMPJ84FDwFc nG8EXPAIwHrPIGkDgkDJ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t9V9k8+rasYvT41zSX3ePzJrkA 7igum5TUnMyy1CJ9uwSujM8/qgoeyFTsuXybpYHxgngXIweHhICJxJfvZV2MXBxCArsZJWZM /czYxcgJFJeSmHLmJQuELSyx8t9zdoiiZiaJ82tXgRWxCWhJPO5cwAKSEBHYzSTxtnsuWBWz wCImiZdXeplBVggLhEpcu2AM0sAioCrR8/0SO4jNK2AtcWpNGxPEBnmJ1RsOMIPYnAI2Ep/u 9oPZQkA1/349Y5zAyLeAkWEVo2RqQXFuem6xYYFhXmq5XnFibnFpXrpecn7uJkZw9Ghp7mDc vuqD3iFGJg7GQ4wSHMxKIrwvNvYmC/GmJFZWpRblxxeV5qQWH2KU5mBREue90HUyXkggPbEk NTs1tSC1CCbLxMEp1cDUwc3vq/lEYPWLrydmnbjAkLJ21ZJr1Tf7t0QIx7+QFuAsLFJT8fE9 qvzy9Yo/3XcarbsqfugVz+lpe5mvxcnk1Ktr8equ+5flv8pLdwqISQevuKduXpEtf36zsqLx o/nsCabvl5/Z2LKOwbTrclFnsPi+u1Nivouty58f0d6/cNbTl3Pluew1r4hpavYzTn6lwa3x 9emW5V8OX97DdnjFwsrnl2W1tRdlcMyOZF0gds5e0+6mUlHCzrRiRodFSi6zqicsD/cyFVK5 +MxxxfEfytuf+ntviF6Uzbh27xvNn14Pv29qUuX5eja828psxrYFk4IfPjh5fHknu7t1ho/8 x1QeNdfu5fJ8jF5eQSuUWIozEg21mIuKEwHWtqozDQMAAA== X-CMS-MailID: 20221207100650epcas5p408d280e0e2d2d6acfb5e252e37f504b2 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221207100650epcas5p408d280e0e2d2d6acfb5e252e37f504b2 References: <20221207100632.96200-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 during the probe, hclk is gated by any other drivers or disabled, because of that probe gets failed. Move the mram init functionality to mcan chip config called by m_can_start from mcan open function, by that time clocks are enabled. Suggested-by: Marc Kleine-Budde Signed-off-by: Vivek Yadav --- drivers/net/can/m_can/m_can.c | 32 +++++++++++++++++++++----- drivers/net/can/m_can/m_can_platform.c | 4 ---- drivers/net/can/m_can/tcan4x5x-core.c | 5 ---- 3 files changed, 26 insertions(+), 15 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index a776cab1a5a4..2261d01324f8 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1233,10 +1233,17 @@ static int m_can_set_bittiming(struct net_device *dev) * - setup bittiming * - configure timestamp generation */ -static void m_can_chip_config(struct net_device *dev) +static int m_can_chip_config(struct net_device *dev) { struct m_can_classdev *cdev = netdev_priv(dev); u32 cccr, test; + int err; + + err = m_can_init_ram(cdev); + if (err) { + dev_err(cdev->dev, "Message RAM configuration failed\n"); + return err; + } m_can_config_endisable(cdev, true); @@ -1360,18 +1367,25 @@ static void m_can_chip_config(struct net_device *dev) if (cdev->ops->init) cdev->ops->init(cdev); + + return 0; } -static void m_can_start(struct net_device *dev) +static int m_can_start(struct net_device *dev) { struct m_can_classdev *cdev = netdev_priv(dev); + int ret; /* basic m_can configuration */ - m_can_chip_config(dev); + ret = m_can_chip_config(dev); + if (ret) + return ret; cdev->can.state = CAN_STATE_ERROR_ACTIVE; m_can_enable_all_interrupts(cdev); + + return 0; } static int m_can_set_mode(struct net_device *dev, enum can_mode mode) @@ -1799,7 +1813,9 @@ static int m_can_open(struct net_device *dev) } /* start the m_can controller */ - m_can_start(dev); + err = m_can_start(dev); + if (err) + goto exit_irq_fail; if (!cdev->is_peripheral) napi_enable(&cdev->napi); @@ -2058,9 +2074,13 @@ int m_can_class_resume(struct device *dev) ret = m_can_clk_start(cdev); if (ret) return ret; + ret = m_can_start(ndev); + if (ret) { + m_can_clk_stop(cdev); + + return ret; + } - m_can_init_ram(cdev); - m_can_start(ndev); netif_device_attach(ndev); netif_start_queue(ndev); } diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index b5a5bedb3116..9c1dcf838006 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -140,10 +140,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) diff --git a/drivers/net/can/m_can/tcan4x5x-core.c b/drivers/net/can/m_can/tcan4x5x-core.c index 41645a24384c..a3aeb83de152 100644 --- a/drivers/net/can/m_can/tcan4x5x-core.c +++ b/drivers/net/can/m_can/tcan4x5x-core.c @@ -234,11 +234,6 @@ static int tcan4x5x_init(struct m_can_classdev *cdev) if (ret) return ret; - /* Zero out the MCAN buffers */ - ret = m_can_init_ram(cdev); - if (ret) - return ret; - ret = regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG, TCAN4X5X_MODE_SEL_MASK, TCAN4X5X_MODE_NORMAL); if (ret) From patchwork Wed Dec 7 10:06:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Yadav X-Patchwork-Id: 13066958 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 922DDC352A1 for ; Wed, 7 Dec 2022 10:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229996AbiLGKgW (ORCPT ); Wed, 7 Dec 2022 05:36:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbiLGKgI (ORCPT ); Wed, 7 Dec 2022 05:36:08 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 753B02EF3D for ; Wed, 7 Dec 2022 02:36:07 -0800 (PST) Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20221207103606epoutp010773e43ede250a1ad9e5f1f8c51ad4d8~ufHfaoDsk0992209922epoutp01h for ; Wed, 7 Dec 2022 10:36:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20221207103606epoutp010773e43ede250a1ad9e5f1f8c51ad4d8~ufHfaoDsk0992209922epoutp01h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1670409366; bh=zxEW4aRMNY+I/kBJaywdBjCo9sOxx8Km7j9aqHAo5dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NP5oCXm9d4Rg8XsxXuAA2Ph3hzvezKN3sJqiI/uh8UFkh4ZMA/CX+O847EAYZE3WX EaqwHl5u3qOMklsfGQ5ew93jxcKTVUx9rcdk3Zr+AY2YSfN40kVhj4dVhukXqT2vIT lb2OVM6VWF8Qse5X8nnwcijM3r7773kmYFxePNYc= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20221207103604epcas5p46ed071591a8b7c3a61aeda1c5a48b667~ufHd6SGaR3205632056epcas5p4H; Wed, 7 Dec 2022 10:36:04 +0000 (GMT) Received: from epsmges5p2new.samsung.com (unknown [182.195.38.183]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4NRtwy4dX8z4x9Pw; Wed, 7 Dec 2022 10:36:02 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id E4.25.39477.29C60936; Wed, 7 Dec 2022 19:36:02 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20221207100700epcas5p408c436aaaf0edd215b54f36f500cd02c~ueuFbrcTq2723727237epcas5p4F; Wed, 7 Dec 2022 10:07:00 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20221207100700epsmtrp29aab399730057e716faf8a2cf6acba50~ueuFZKJUG0757407574epsmtrp25; Wed, 7 Dec 2022 10:07:00 +0000 (GMT) X-AuditID: b6c32a4a-007ff70000019a35-fb-63906c9259a3 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id FB.FD.14392.3C560936; Wed, 7 Dec 2022 19:06:59 +0900 (KST) Received: from cheetah.sa.corp.samsungelectronics.net (unknown [107.109.115.53]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20221207100657epsmtip2cef9b724734c821be031ee8ed03931c2~ueuClidVI0667806678epsmtip2f; Wed, 7 Dec 2022 10:06:56 +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 v4 2/2] arm64: dts: fsd: Add MCAN device node Date: Wed, 7 Dec 2022 15:36:32 +0530 Message-Id: <20221207100632.96200-3-vivek.2311@samsung.com> X-Mailer: git-send-email 2.17.1 In-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nvk50VrSlW2vYdyUDj6u pbPyFnYVfpgeeDfDXPbxLt37s4Q+nipQ1bcLziw3uC+csjHuxvnzDr2MKaEfrsuc2ViowebP OH+rQ4FhSNWbe8tC/K//ig3nnedtW5sy75WoVavXiWky3fMXiyRpZV674OZUuIazZMaf10bu rur7rr1r/9puf1l71sd/J0/K7/ZgOjbh1HJTcb9iXvnkW3eapsxTmrVr1YPlxS+NGwIXK58R 4+r65nBWuGmW8bebC58GJad+P9r81fPcSznG44msZzNezDibz7Jshslc8RW2Fmed/i719lO1 cU1dtEa2oL7KrpJ9qr8SS3FGoqEWc1FxIgAnLSt5DgMAAA== X-CMS-MailID: 20221207100700epcas5p408c436aaaf0edd215b54f36f500cd02c X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20221207100700epcas5p408c436aaaf0edd215b54f36f500cd02c References: <20221207100632.96200-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 --- 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>;