Skip to contentSkip to conversation

TI K3 M4F support on AM62 and AM64 SoCs

PATCH Applied Andrew Davis 4 participants 10 messages Oct 3, 2024 – Oct 28, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v12 cover TI K3 M4F support on AM62 and AM64 SoCs

Hello all,

M4F driver[0] and DT bindings[1] are in, so last step is adding the nodes to the base AM64/AM62 DTSI files, plus a couple of our SK boards. These can be used as a reference for other boards using AM64/AM62, or I can add these nodes for existing upstream boards, just let me know.

Thanks,
Andrew

[0] commit ebcf9008a895a ("remoteproc: k3-m4: Add a remoteproc driver for M4F subsystem")
[1] commit 9fedb829372d4 ("dt-bindings: remoteproc: k3-m4f: Add K3 AM64x SoCs")

Changes for v12:
- Rebased on v6.12-rc1
- Dropped taken patches
- Added Tested-by tags

Previous series (v11):
https://lore.kernel.org/linux-arm-kernel/[email protected]/

Hari Nagalla (5):
arm64: dts: ti: k3-am62: Add M4F remoteproc node
arm64: dts: ti: k3-am625-sk: Add M4F remoteproc node
arm64: dts: ti: k3-am64: Add M4F remoteproc node
arm64: dts: ti: k3-am642-sk: Add M4F remoteproc node
arm64: dts: ti: k3-am642-evm: Add M4F remoteproc node

 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi       | 13 +++++++++++++
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 19 +++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi       | 13 +++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-evm.dts       | 19 +++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am642-sk.dts        | 19 +++++++++++++++++++
 5 files changed, 83 insertions(+)
Signature · 1 line
2.39.2
#2 lore raw

PATCH v12 2/5 arm64: dts: ti: k3-am625-sk: Add M4F remoteproc node

From: Hari Nagalla <[email protected]>

The AM62x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed. The first region is used as a DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory.

The current carveout addresses and sizes are defined statically for each rproc device. The M4F processor does not have an MMU, and as such requires the exact memory used by the firmware to be set-aside.

---
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +19 -0
index 44ff67b6bf1e4..6957b3e44c82f 100644
@@ -56,6 +56,18 @@ linux,cma {
 			linux,cma-default;
 		};
 
+		mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cb00000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_m4fss_memory_region: m4f-memory@9cc00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cc00000 0x00 0xe00000>;
+			no-map;
+		};
+
 		secure_tfa_ddr: tfa@9e780000 {
 			reg = <0x00 0x9e780000 0x00 0x80000>;
 			alignment = <0x1000>;
@@ -464,6 +476,13 @@ mbox_m4_0: mbox-m4-0 {
 	};
 };
 
+&mcu_m4fss {
+	mboxes = <&mailbox0_cluster0 &mbox_m4_0>;
+	memory-region = <&mcu_m4fss_dma_memory_region>,
+			<&mcu_m4fss_memory_region>;
+	status = "okay";
+};
+
 &usbss0 {
 	bootph-all;
 	status = "okay";
Signature · 1 line
2.39.2
#6 lore raw

PATCH v12 3/5 arm64: dts: ti: k3-am64: Add M4F remoteproc node

In reply to Andrew Davis

From: Hari Nagalla <[email protected]>

The AM64x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed.

Disable by default as this node is not complete until mailbox data is provided in the board level DT.

---
 arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/ti/k3-am64-mcu.dtsi +13 -0
index ad4bed5d3f9eb..a243c981e8535 100644
@@ -161,4 +161,17 @@ mcu_esm: esm@4100000 {
 		/* Interrupt sources: esm0_cfg, esm0_hi, esm0_low, mrti0 */
 		ti,esm-pins = <0>, <1>, <2>, <85>;
 	};
+
+	mcu_m4fss: m4fss@5000000 {
+		compatible = "ti,am64-m4fss";
+		reg = <0x00 0x5000000 0x00 0x30000>,
+		      <0x00 0x5040000 0x00 0x10000>;
+		reg-names = "iram", "dram";
+		resets = <&k3_reset 9 1>;
+		firmware-name = "am64-mcu-m4f0_0-fw";
+		ti,sci = <&dmsc>;
+		ti,sci-dev-id = <9>;
+		ti,sci-proc-ids = <0x18 0xff>;
+		status = "disabled";
+	};
 };
Signature · 1 line
2.39.2
#7 lore raw

PATCH v12 4/5 arm64: dts: ti: k3-am642-sk: Add M4F remoteproc node

In reply to Andrew Davis

From: Hari Nagalla <[email protected]>

The AM64x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed. The first region is used as a DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory.

The current carveout addresses and sizes are defined statically for each rproc device. The M4F processor does not have an MMU, and as such requires the exact memory used by the firmware to be set-aside.

---
 arch/arm64/boot/dts/ti/k3-am642-sk.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-sk.dts +19 -0
index 86369525259c3..26d4ad5e96f1c 100644
@@ -99,6 +99,18 @@ main_r5fss1_core1_memory_region: r5f-memory@a3100000 {
 			no-map;
 		};
 
+		mcu_m4fss_dma_memory_region: m4f-dma-memory@a4000000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0xa4000000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_m4fss_memory_region: m4f-memory@a4100000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0xa4100000 0x00 0xf00000>;
+			no-map;
+		};
+
 		rtos_ipc_memory_region: ipc-memories@a5000000 {
 			reg = <0x00 0xa5000000 0x00 0x00800000>;
 			alignment = <0x1000>;
@@ -681,6 +693,13 @@ &main_r5fss1_core1 {
 			<&main_r5fss1_core1_memory_region>;
 };
 
+&mcu_m4fss {
+	mboxes = <&mailbox0_cluster6 &mbox_m4_0>;
+	memory-region = <&mcu_m4fss_dma_memory_region>,
+			<&mcu_m4fss_memory_region>;
+	status = "okay";
+};
+
 &ecap0 {
 	status = "okay";
 	/* PWM is available on Pin 1 of header J3 */
Signature · 1 line
2.39.2
#1 lore raw

PATCH v12 1/5 arm64: dts: ti: k3-am62: Add M4F remoteproc node

In reply to Andrew Davis

From: Hari Nagalla <[email protected]>

The AM62x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed.

Disable by default as this node is not complete until mailbox data is provided in the board level DT.

---
 arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)
arch/arm64/boot/dts/ti/k3-am62-mcu.dtsi +13 -0
index bb43a411f59b2..68e906796aefe 100644
@@ -174,4 +174,17 @@ mcu_mcan1: can@4e18000 {
 		bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>;
 		status = "disabled";
 	};
+
+	mcu_m4fss: m4fss@5000000 {
+		compatible = "ti,am64-m4fss";
+		reg = <0x00 0x5000000 0x00 0x30000>,
+		      <0x00 0x5040000 0x00 0x10000>;
+		reg-names = "iram", "dram";
+		resets = <&k3_reset 9 1>;
+		firmware-name = "am62-mcu-m4f0_0-fw";
+		ti,sci = <&dmsc>;
+		ti,sci-dev-id = <9>;
+		ti,sci-proc-ids = <0x18 0xff>;
+		status = "disabled";
+	};
 };
Signature · 1 line
2.39.2
#8 lore raw

PATCH v12 5/5 arm64: dts: ti: k3-am642-evm: Add M4F remoteproc node

In reply to Andrew Davis

From: Hari Nagalla <[email protected]>

The AM64x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed. The first region is used as a DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory.

The current carveout addresses and sizes are defined statically for each rproc device. The M4F processor does not have an MMU, and as such requires the exact memory used by the firmware to be set-aside.

---
 arch/arm64/boot/dts/ti/k3-am642-evm.dts | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/ti/k3-am642-evm.dts +19 -0
index 97ca16f00cd26..19d7ed8a9ea0f 100644
@@ -101,6 +101,18 @@ main_r5fss1_core1_memory_region: r5f-memory@a3100000 {
 			no-map;
 		};
 
+		mcu_m4fss_dma_memory_region: m4f-dma-memory@a4000000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0xa4000000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_m4fss_memory_region: m4f-memory@a4100000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0xa4100000 0x00 0xf00000>;
+			no-map;
+		};
+
 		rtos_ipc_memory_region: ipc-memories@a5000000 {
 			reg = <0x00 0xa5000000 0x00 0x00800000>;
 			alignment = <0x1000>;
@@ -776,6 +788,13 @@ &main_r5fss1_core1 {
 			<&main_r5fss1_core1_memory_region>;
 };
 
+&mcu_m4fss {
+	mboxes = <&mailbox0_cluster6 &mbox_m4_0>;
+	memory-region = <&mcu_m4fss_dma_memory_region>,
+			<&mcu_m4fss_memory_region>;
+	status = "okay";
+};
+
 &serdes_ln_ctrl {
 	idle-states = <AM64_SERDES0_LANE0_PCIE0>;
 };
Signature · 1 line
2.39.2
#3 lore raw

Re: [PATCH v12 2/5] arm64: dts: ti: k3-am625-sk: Add M4F remoteproc node

In reply to Andrew Davis

Hi Andrew!

On October 3, 2024 thus sayeth Andrew Davis:

Quoted 29 lines

From: Hari Nagalla <[email protected]>

The AM62x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed. The first region is used as a DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory.

The current carveout addresses and sizes are defined statically for each rproc device. The M4F processor does not have an MMU, and as such requires the exact memory used by the firmware to be set-aside.

---
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +2 -0
index 44ff67b6bf1e4..6957b3e44c82f 100644
@@ -56,6 +56,18 @@ linux,cma {
 			linux,cma-default;
 		};
 
+		mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
+			compatible = "shared-dma-pool";

arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi linux,cma { · line 70

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +10 -0
+			reg = <0x00 0x9cb00000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_m4fss_memory_region: m4f-memory@9cc00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cc00000 0x00 0xe00000>;
+			no-map;
+		};
+

The only issue I have here is this takes away memory from people who do not use these firmware or causes them to work around this patch if they choose to have different carveouts.

Would an overlay be appropriate for this?

~Bryan

maintainer
#4 lore raw

Re: [PATCH v12 2/5] arm64: dts: ti: k3-am625-sk: Add M4F remoteproc node

Quoted 30 lines · Bryan Brattlof

Hi Andrew!

On October 3, 2024 thus sayeth Andrew Davis:

Quoted 27 lines

From: Hari Nagalla <[email protected]>

The AM62x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed. The first region is used as a DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory.

The current carveout addresses and sizes are defined statically for each rproc device. The M4F processor does not have an MMU, and as such requires the exact memory used by the firmware to be set-aside.

---
 .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +0 -0
index 44ff67b6bf1e4..6957b3e44c82f 100644
@@ -56,6 +56,18 @@ linux,cma {
 			linux,cma-default;
 		};
 
Quoted 16 lines

arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi linux,cma { · line 70

Quoted 12 lines
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +12 -0
+		mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cb00000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_m4fss_memory_region: m4f-memory@9cc00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cc00000 0x00 0xe00000>;
+			no-map;
+		};
+

The only issue I have here is this takes away memory from people who do not use these firmware or causes them to work around this patch if they choose to have different carveouts.

They can define their own overlays.

Quoted 2 lines

Would an overlay be appropriate for this?

Why is this any different from existing boards? Are you suggesting a change for all existing boards as well?

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#5 lore raw

Re: [PATCH v12 2/5] arm64: dts: ti: k3-am625-sk: Add M4F remoteproc node

Quoted 48 lines · Nishanth Menon
Quoted 30 lines · Bryan Brattlof

Hi Andrew!

On October 3, 2024 thus sayeth Andrew Davis:

Quoted 27 lines

From: Hari Nagalla <[email protected]>

The AM62x SoCs of the TI K3 family have a Cortex M4F core in the MCU domain. This core can be used by non safety applications as a remote processor. When used as a remote processor with virtio/rpmessage IPC, two carveout reserved memory nodes are needed. The first region is used as a DMA pool for the rproc device, and the second region will furnish the static carveout regions for the firmware memory.

The current carveout addresses and sizes are defined statically for each rproc device. The M4F processor does not have an MMU, and as such requires the exact memory used by the firmware to be set-aside.

---
  .../arm64/boot/dts/ti/k3-am62x-sk-common.dtsi | 19 +++++++++++++++++++
  1 file changed, 19 insertions(+)
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +0 -0
index 44ff67b6bf1e4..6957b3e44c82f 100644
@@ -56,6 +56,18 @@ linux,cma {
  			linux,cma-default;
  		};
 
Quoted 16 lines

arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi linux,cma { · line 70

Quoted 12 lines
arch/arm64/boot/dts/ti/k3-am62x-sk-common.dtsi +12 -0
+		mcu_m4fss_dma_memory_region: m4f-dma-memory@9cb00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cb00000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_m4fss_memory_region: m4f-memory@9cc00000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9cc00000 0x00 0xe00000>;
+			no-map;
+		};
+

The only issue I have here is this takes away memory from people who do not use these firmware or causes them to work around this patch if they choose to have different carveouts.

Quoted 8 lines

They can define their own overlays.

Quoted 2 lines

Would an overlay be appropriate for this?

Why is this any different from existing boards? Are you suggesting a change for all existing boards as well?

Yes, I believe that is what is being suggested, and I agree with it. It would also help with all these non-SK boards we now have, they would simply apply the same overlay when using the firmware that requires these carveouts.

I've been thinking on doing that for a while, but I wanted to keep the same pattern just for this one last series. Then we can attempt to refactor next.

Andrew

maintainer Applied
#9 lore raw
In reply to Andrew Davis

Hi Andrew Davis,

Quoted 10 lines · Andrew Davis

M4F driver[0] and DT bindings[1] are in, so last step is adding the nodes to the base AM64/AM62 DTSI files, plus a couple of our SK boards. These can be used as a reference for other boards using AM64/AM62, or I can add these nodes for existing upstream boards, just let me know.

Thanks,
Andrew

[...]

I have applied the following to branch ti-k3-dts-next on [1]. Thank you!

[1/5] arm64: dts: ti: k3-am62: Add M4F remoteproc node

      commit: be4bac3bcb281b264bd35ae1ff7bbbb99e3e00fe
[2/5] arm64: dts: ti: k3-am625-sk: Add M4F remoteproc node
      commit: 23a6aba92e53883bccbbb27933aad6dd09992e6f
[3/5] arm64: dts: ti: k3-am64: Add M4F remoteproc node
      commit: ef1876ff76096b3cad6fdb8b797226e4914f5726
[4/5] arm64: dts: ti: k3-am642-sk: Add M4F remoteproc node
      commit: 6e36e6200360e1703071b38fa5e91f4894716658
[5/5] arm64: dts: ti: k3-am642-evm: Add M4F remoteproc node
      commit: 8e77fc1fbb291e193664df0ac5176ac9fbfb3ea8

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent up the chain during the next merge window (or sooner if it is a relevant bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
--
Vignesh