devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Judith Mendez <jm@ti.com>
To: Chandrasekar Ramakrishnan <rcsekar@samsung.com>
Cc: Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
	Andrew Davis <afd@ti.com>,
	Wolfgang Grandegger <wg@grandegger.com>,
	Marc Kleine-Budde <mkl@pengutronix.de>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	<linux-can@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
	Schuyler Patton <spatton@ti.com>
Subject: [RFC PATCH 4/5] arm64: dts: ti: Enable multiple MCAN for AM62x in MCU MCAN overlay
Date: Thu, 13 Apr 2023 17:30:50 -0500	[thread overview]
Message-ID: <20230413223051.24455-5-jm@ti.com> (raw)
In-Reply-To: <20230413223051.24455-1-jm@ti.com>

Enable two MCAN in MCU domain. AM62x does not have on-board CAN
transcievers, so instead of changing the DTB permanently, add
MCU MCAN nodes and transceiver nodes to a MCU MCAN overlay.

If there are no hardware interrupts rounted to the GIC interrupt
controller for MCAN IP, A53 Linux will not receive hardware
interrupts. If an hrtimer is used to generate software interrupts,
the two required interrupt attributes in the MCAN node do not have
to be included.

Signed-off-by: Judith Mendez <jm@ti.com>
---
 arch/arm64/boot/dts/ti/Makefile               |  2 +-
 .../boot/dts/ti/k3-am625-sk-mcan-mcu.dtso     | 75 +++++++++++++++++++
 2 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am625-sk-mcan-mcu.dtso

diff --git a/arch/arm64/boot/dts/ti/Makefile b/arch/arm64/boot/dts/ti/Makefile
index abe15e76b614..c76be3888e4d 100644
--- a/arch/arm64/boot/dts/ti/Makefile
+++ b/arch/arm64/boot/dts/ti/Makefile
@@ -9,7 +9,7 @@
 # alphabetically.
 
 # Boards with AM62x SoC
-k3-am625-sk-mcan-dtbs := k3-am625-sk.dtb k3-am625-sk-mcan-main.dtbo
+k3-am625-sk-mcan-dtbs := k3-am625-sk.dtb k3-am625-sk-mcan-main.dtbo k3-am625-sk-mcan-mcu.dtbo
 dtb-$(CONFIG_ARCH_K3) += k3-am625-beagleplay.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-sk.dtb
 dtb-$(CONFIG_ARCH_K3) += k3-am625-sk-mcan.dtb
diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk-mcan-mcu.dtso b/arch/arm64/boot/dts/ti/k3-am625-sk-mcan-mcu.dtso
new file mode 100644
index 000000000000..777705aea546
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am625-sk-mcan-mcu.dtso
@@ -0,0 +1,75 @@
+// SPDX-License-Identifier: GPL-2.0
+/**
+ * DT overlay for MCAN in MCU domain on AM625 SK
+ *
+ * Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com/
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/pinctrl/k3.h>
+#include <dt-bindings/soc/ti,sci_pm_domain.h>
+
+
+&{/} {
+	transceiver2: can-phy1 {
+		compatible = "ti,tcan1042";
+		#phy-cells = <0>;
+		max-bitrate = <5000000>;
+	};
+
+	transceiver3: can-phy2 {
+		compatible = "ti,tcan1042";
+		#phy-cells = <0>;
+		max-bitrate = <5000000>;
+	};
+};
+
+&mcu_pmx0 {
+	mcu_mcan1_pins_default: mcu-mcan1-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x038, PIN_INPUT, 0) /* (B3) MCU_MCAN0_RX */
+			AM62X_IOPAD(0x034, PIN_OUTPUT, 0) /* (D6) MCU_MCAN0_TX */
+		>;
+	};
+
+	mcu_mcan2_pins_default: mcu-mcan2-pins-default {
+		pinctrl-single,pins = <
+			AM62X_IOPAD(0x040, PIN_INPUT, 0) /* (D4) MCU_MCAN1_RX */
+			AM62X_IOPAD(0x03C, PIN_OUTPUT, 0) /* (E5) MCU_MCAN1_TX */
+		>;
+	};
+};
+
+&cbass_mcu {
+	mcu_mcan1: can@4e00000 {
+		compatible = "bosch,m_can";
+		reg = <0x00 0x4e00000 0x00 0x8000>,
+			  <0x00 0x4e08000 0x00 0x200>;
+		reg-names = "message_ram", "m_can";
+		power-domains = <&k3_pds 188 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 188 6>, <&k3_clks 188 1>;
+		clock-names = "hclk", "cclk";
+		bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&mcu_mcan1_pins_default>;
+		phys = <&transceiver2>;
+		status = "okay";
+	};
+
+	mcu_mcan2: can@4e10000 {
+		compatible = "bosch,m_can";
+		reg = <0x00 0x4e10000 0x00 0x8000>,
+			  <0x00 0x4e18000 0x00 0x200>;
+		reg-names = "message_ram", "m_can";
+		power-domains = <&k3_pds 189 TI_SCI_PD_EXCLUSIVE>;
+		clocks = <&k3_clks 189 6>, <&k3_clks 189 1>;
+		clock-names = "hclk", "cclk";
+		bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&mcu_mcan2_pins_default>;
+		phys = <&transceiver3>;
+		status = "okay";
+	};
+};
-- 
2.17.1


  parent reply	other threads:[~2023-04-13 22:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 22:30 [RFC PATCH 0/5] Enable multiple MCAN on AM62x Judith Mendez
2023-04-13 22:30 ` [RFC PATCH 1/5] arm64: dts: ti: Add AM62x MCAN MAIN domain transceiver overlay Judith Mendez
2023-04-13 22:30 ` [RFC PATCH 2/5] arm64: defconfig: Enable MCAN driver Judith Mendez
2023-04-13 22:30 ` [RFC PATCH 3/5] dt-binding: can: m_can: Remove required interrupt attributes Judith Mendez
2023-04-14  8:00   ` Krzysztof Kozlowski
2023-04-13 22:30 ` Judith Mendez [this message]
2023-04-14  8:01   ` [RFC PATCH 4/5] arm64: dts: ti: Enable multiple MCAN for AM62x in MCU MCAN overlay Krzysztof Kozlowski
2023-04-14 18:29     ` Nishanth Menon
2023-04-14 20:44       ` Krzysztof Kozlowski
2023-04-14 22:11         ` Nishanth Menon
2023-04-19 15:54           ` Mendez, Judith
2023-04-13 22:30 ` [RFC PATCH 5/5] can: m_can: Add hrtimer to generate software interrupt Judith Mendez
2023-04-14 18:20   ` Marc Kleine-Budde
2023-04-16 12:33     ` Oliver Hartkopp
2023-04-16 15:35       ` Marc Kleine-Budde
2023-04-16 19:46         ` Oliver Hartkopp
2023-04-17  7:26           ` Marc Kleine-Budde
2023-04-17 17:34             ` Oliver Hartkopp
2023-04-17 19:26               ` Marc Kleine-Budde
2023-04-18 20:59                 ` Mendez, Judith
2023-04-19  6:13                   ` Marc Kleine-Budde
2023-04-19 14:38                     ` Mendez, Judith
2023-04-19 19:06     ` Mendez, Judith
2023-04-14  6:12 ` [RFC PATCH 0/5] Enable multiple MCAN on AM62x Vignesh Raghavendra
2023-04-19 15:12   ` Mendez, Judith
2023-04-14 17:49 ` Marc Kleine-Budde
2023-04-18 16:15   ` Mendez, Judith
2023-04-19  6:10     ` Marc Kleine-Budde
2023-04-19 20:40       ` Mendez, Judith
2023-04-20  9:36         ` Marc Kleine-Budde
2023-04-20 15:17           ` Mendez, Judith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230413223051.24455-5-jm@ti.com \
    --to=jm@ti.com \
    --cc=afd@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rcsekar@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=spatton@ti.com \
    --cc=vigneshr@ti.com \
    --cc=wg@grandegger.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).