Skip to contentSkip to conversation

Add R5F and C7x DSP nodes for AM62a SoC

PATCH Superseded Hari Nagalla 4 participants 11 messages Jun 5, 2024 – Jun 10, 2024

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add R5F and C7x DSP nodes for AM62a SoC

This patch series adds R5F and C7x dsp processor nodes and shared memory based Virtio/IPC configuration for AM62A SoC.

changes in v3:
*) Separated DSP node binding patch and submitted to remoteproc
mailing list, rebased the patches to linux-next.

v2: https://lore.kernel.org/all/[email protected]/

Devarsh Thakkar (2):
arm64: dts: k3-am62a-wakeup: Add R5F device node
arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

Hari Nagalla (1):
arm64: dts: k3-am62a-mcu: Add R5F remote proc node

Jai Luthra (1):
arm64: dts: k3-am62a-main: Add C7xv device node

 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi   | 11 ++++
 arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi    | 35 +++++++++++
 arch/arm64/boot/dts/ti/k3-am62a-wakeup.dtsi | 23 +++++++
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts     | 68 +++++++++++++++++++++
 4 files changed, 137 insertions(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH v3 1/4 arm64: dts: k3-am62a-main: Add C7xv device node

From: Jai Luthra <[email protected]>

AM62A SoCs have a C7xv DSP subsystem with Analytics engine capability. This subsystem is intended for deep learning purposes. Define the device node for C7xv DSP.

---
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a-main.dtsi +11 -0
index bf9c2d9c6439..0912cc31329c 100644
@@ -1062,4 +1062,15 @@ vpu: video-codec@30210000 {
 		clocks = <&k3_clks 204 2>;
 		power-domains = <&k3_pds 204 TI_SCI_PD_EXCLUSIVE>;
 	};
+
+	c7x_0: dsp@7e000000 {
+		compatible = "ti,am62a-c7xv-dsp";
+		reg = <0x00 0x7e000000 0x00 0x00100000>;
+		reg-names = "l2sram";
+		ti,sci = <&dmsc>;
+		ti,sci-dev-id = <208>;
+		ti,sci-proc-ids = <0x04 0xff>;
+		resets = <&k3_reset 208 1>;
+		firmware-name = "am62a-c71_0-fw";
+	};
 };
Signature · 1 line
2.34.1
#2 lore raw

PATCH v3 2/4 arm64: dts: k3-am62a-mcu: Add R5F remote proc node

In reply to Hari Nagalla

AM62A SoCs have a single R5F core in the MCU voltage domain. The MCU domain also has a 512KB sram memory, the R5F core can use for applications needing fast memory access.

---
 arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi | 35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi +35 -0
index 8c36e56f4138..803da3cce336 100644
@@ -6,6 +6,17 @@
  */
 
 &cbass_mcu {
+	mcu_ram: sram@79100000 {
+		compatible = "mmio-sram";
+		reg = <0x00 0x79100000 0x00 0x80000>;
+		ranges = <0x00 0x00 0x79100000 0x80000>;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		mcu1-sram@0 {
+			reg = <0x0 0x80000>;
+		};
+	};
 	mcu_pmx0: pinctrl@4084000 {
 		compatible = "pinctrl-single";
 		reg = <0x00 0x04084000 0x00 0x88>;
@@ -167,4 +178,28 @@ mcu_mcan1: can@4e18000 {
 		bosch,mram-cfg = <0x0 128 64 64 64 64 32 32>;
 		status = "disabled";
 	};
+
+	mcu_r5fss0: r5fss@79000000 {
+		compatible = "ti,am62-r5fss";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x79000000 0x00 0x79000000 0x8000>,
+			 <0x79020000 0x00 0x79020000 0x8000>;
+		power-domains = <&k3_pds 7 TI_SCI_PD_EXCLUSIVE>;
+		mcu_r5fss0_core0: r5f@79000000 {
+			compatible = "ti,am62-r5f";
+			reg = <0x79000000 0x00008000>,
+				<0x79020000 0x00008000>;
+			reg-names = "atcm", "btcm";
+			ti,sci = <&dmsc>;
+			ti,sci-dev-id = <9>;
+			ti,sci-proc-ids = <0x03 0xff>;
+			resets = <&k3_reset 9 1>;
+			firmware-name = "am62a-mcu-r5f0_0-fw";
+			ti,atcm-enable = <0>;
+			ti,btcm-enable = <1>;
+			ti,loczrama = <0>;
+			sram = <&mcu_ram>;
+		};
+	};
 };
Signature · 1 line
2.34.1
#3 lore raw

PATCH v3 3/4 arm64: dts: k3-am62a-wakeup: Add R5F device node

In reply to Hari Nagalla

From: Devarsh Thakkar <[email protected]>

AM62A SoCs have a single R5F core in waekup domain. This core is also used as a device manager for the SoC.

---
 arch/arm64/boot/dts/ti/k3-am62a-wakeup.dtsi | 23 +++++++++++++++++++++
 1 file changed, 23 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a-wakeup.dtsi +23 -0
index 98043e9aa316..70471d969aa6 100644
@@ -73,6 +73,29 @@ wkup_rti0: watchdog@2b000000 {
 		status = "reserved";
 	};
 
+	wkup_r5fss0: r5fss@78000000 {
+		compatible = "ti,am62-r5fss";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		ranges = <0x78000000 0x00 0x78000000 0x8000>,
+			 <0x78100000 0x00 0x78100000 0x8000>;
+		power-domains = <&k3_pds 119 TI_SCI_PD_EXCLUSIVE>;
+		wkup_r5fss0_core0: r5f@78000000 {
+			compatible = "ti,am62-r5f";
+			reg = <0x78000000 0x00008000>,
+				<0x78100000 0x00008000>;
+			reg-names = "atcm", "btcm";
+			ti,sci = <&dmsc>;
+			ti,sci-dev-id = <121>;
+			ti,sci-proc-ids = <0x01 0xff>;
+			resets = <&k3_reset 121 1>;
+			firmware-name = "am62-wkup-r5f0_0-fw";
+			ti,atcm-enable = <1>;
+			ti,btcm-enable = <1>;
+			ti,loczrama = <1>;
+		};
+	};
+
 	wkup_vtm0: temperature-sensor@b00000 {
 		compatible = "ti,j7200-vtm";
 		reg = <0x00 0xb00000 0x00 0x400>,
Signature · 1 line
2.34.1
#4 lore raw

PATCH v3 4/4 arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

In reply to Hari Nagalla

From: Devarsh Thakkar <[email protected]>

Reserve memory for remote rpoc IPC and bind the mailbox assignments for each remote proc. Two memory regions are reserved for each remote processor. The first region of 1Mb of memory is used for Vring shared buffers and the second region is used as external memory to the remote processor, resource table and as tracebuffer.

---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 68 +++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +68 -0
index fa43cd0b631e..09bb8af53b1e 100644
@@ -52,11 +52,40 @@ secure_ddr: optee@9e800000 {
 			no-map;
 		};
 
+		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9c800000 0x00 0x100000>;
+			no-map;
+		};
+
 		wkup_r5fss0_core0_memory_region: r5f-dma-memory@9c900000 {
 			compatible = "shared-dma-pool";
 			reg = <0x00 0x9c900000 0x00 0x01e00000>;
 			no-map;
 		};
+		mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9b800000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9b900000 0x00 0x0f00000>;
+			no-map;
+		};
+
+		c7x_0_dma_memory_region: c7x-dma-memory@99800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99800000 0x00 0x100000>;
+			no-map;
+		};
+
+		c7x_0_memory_region: c7x-memory@99900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99900000 0x00 0x01efffff>;
+			no-map;
+		};
 	};
 
 	vmain_pd: regulator-0 {
@@ -721,3 +750,42 @@ dpi1_out: endpoint {
 		};
 	};
 };
+
+&mailbox0_cluster0 {
+	mbox_r5_0: mbox-r5-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
+
+&mailbox0_cluster1 {
+	mbox_c7x_0: mbox-c7x-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
+
+&mailbox0_cluster2 {
+	mbox_mcu_r5_0: mbox-mcu-r5-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
+
+&c7x_0 {
+	mboxes = <&mailbox0_cluster1>, <&mbox_c7x_0>;
+	memory-region = <&c7x_0_dma_memory_region>,
+			<&c7x_0_memory_region>;
+};
+
+&wkup_r5fss0_core0 {
+	mboxes = <&mailbox0_cluster0>, <&mbox_r5_0>;
+	memory-region = <&wkup_r5fss0_core0_dma_memory_region>,
+		<&wkup_r5fss0_core0_memory_region>;
+};
+
+&mcu_r5fss0_core0 {
+	mboxes = <&mailbox0_cluster2>, <&mbox_mcu_r5_0>;
+	memory-region = <&mcu_r5fss0_core0_dma_memory_region>,
+			<&mcu_r5fss0_core0_memory_region>;
+};
Signature · 1 line
2.34.1
#5 lore raw

Re: [PATCH v3 4/4] arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

Hi Hari,

On June 5, 2024 thus sayeth Hari Nagalla:

Quoted 47 lines

From: Devarsh Thakkar <[email protected]>

Reserve memory for remote rpoc IPC and bind the mailbox assignments for each remote proc. Two memory regions are reserved for each remote processor. The first region of 1Mb of memory is used for Vring shared buffers and the second region is used as external memory to the remote processor, resource table and as tracebuffer.

---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 68 +++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +20 -0
index fa43cd0b631e..09bb8af53b1e 100644
@@ -52,11 +52,40 @@ secure_ddr: optee@9e800000 {
 			no-map;
 		};
 
+		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9c800000 0x00 0x100000>;
+			no-map;
+		};
+
 		wkup_r5fss0_core0_memory_region: r5f-dma-memory@9c900000 {
 			compatible = "shared-dma-pool";
 			reg = <0x00 0x9c900000 0x00 0x01e00000>;
 			no-map;
 		};
+		mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9b800000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9b900000 0x00 0x0f00000>;
+			no-map;
+		};
+
+		c7x_0_dma_memory_region: c7x-dma-memory@99800000 {
+			compatible = "shared-dma-pool";

arch/arm64/boot/dts/ti/k3-am62a7-sk.dts secure_ddr: optee@9e800000 { · line 89

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +9 -0
+			reg = <0x00 0x99800000 0x00 0x100000>;
+			no-map;
+		};
+
+		c7x_0_memory_region: c7x-memory@99900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99900000 0x00 0x01efffff>;
+			no-map;
+		};
 	};

This seems highly specific to the demos we're currently running for our reference boards. If someone wants to develop their own app say with Zypher they would instantly need to change this.

If these absolutely need to be in here could they go in a TI-demo overly?

~Bryan

#6 lore raw

Re: [PATCH v3 4/4] arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

Quoted 11 lines · Bryan Brattlof

arch/arm64/boot/dts/ti/k3-am62a7-sk.dts secure_ddr: optee@9e800000 { · line 89

Quoted 7 lines
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +6 -0
+
+		c7x_0_memory_region: c7x-memory@99900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99900000 0x00 0x01efffff>;
+			no-map;
+		};
  	};

This seems highly specific to the demos we're currently running for our reference boards. If someone wants to develop their own app say with Zypher they would instantly need to change this.

Quoted 3 lines

If these absolutely need to be in here could they go in a TI-demo overly?

~Bryan

Hey Bryan,
You are correct, these carveouts match the TI provided firmware binaries. Ideally, these could go into an overlay. Just following the carveout model used with the rest of the TI SoCs (AM6x/J72x), to avoid confusion to the users.

#7 lore raw

Re: [PATCH v3 4/4] arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

On June 10, 2024 thus sayeth Hari Nagalla:

Quoted 12 lines · Bryan Brattlof
Quoted 11 lines

arch/arm64/boot/dts/ti/k3-am62a7-sk.dts secure_ddr: optee@9e800000 { · line 89

Quoted 7 lines
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +6 -0
+
+		c7x_0_memory_region: c7x-memory@99900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99900000 0x00 0x01efffff>;
+			no-map;
+		};
  	};

This seems highly specific to the demos we're currently running for our reference boards. If someone wants to develop their own app say with Zypher they would instantly need to change this.

Quoted 8 lines
Quoted 3 lines

If these absolutely need to be in here could they go in a TI-demo overly?

~Bryan

Hey Bryan,
You are correct, these carveouts match the TI provided firmware binaries. Ideally, these could go into an overlay. Just following the carveout model used with the rest of the TI SoCs (AM6x/J72x), to avoid confusion to the users.

Ah yeah, I was planning to rip those out too ;)

My idea was to throw them into our SDK layers so that other distros don't have to work around them anymore. This also gives the maintainers of those meta- layers the control of the reserved-memory{} node so they can carve it up or move it around as they need along with the firmware they build.

~Bryan

#8 lore raw

Re: [PATCH v3 4/4] arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

In reply to Hari Nagalla
Quoted 5 lines · Hari Nagalla

From: Devarsh Thakkar <[email protected]>

Reserve memory for remote rpoc IPC and bind the mailbox assignments for each remote proc. Two memory regions are reserved for each remote processor. The first region of 1Mb of memory is used for Vring

s/1Mb/1MB?

Quoted 39 lines

shared buffers and the second region is used as external memory to the remote processor, resource table and as tracebuffer.

---
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 68 +++++++++++++++++++++++++
 1 file changed, 68 insertions(+)
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +17 -0
index fa43cd0b631e..09bb8af53b1e 100644
@@ -52,11 +52,40 @@ secure_ddr: optee@9e800000 {
 			no-map;
 		};
 
+		wkup_r5fss0_core0_dma_memory_region: r5f-dma-memory@9c800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9c800000 0x00 0x100000>;
+			no-map;
+		};
+
 		wkup_r5fss0_core0_memory_region: r5f-dma-memory@9c900000 {
 			compatible = "shared-dma-pool";
 			reg = <0x00 0x9c900000 0x00 0x01e00000>;
 			no-map;
 		};
+		mcu_r5fss0_core0_dma_memory_region: r5f-dma-memory@9b800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9b800000 0x00 0x100000>;
+			no-map;
+		};
+
+		mcu_r5fss0_core0_memory_region: r5f-dma-memory@9b900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x9b900000 0x00 0x0f00000>;
+			no-map;
+		};

arch/arm64/boot/dts/ti/k3-am62a7-sk.dts secure_ddr: optee@9e800000 { · line 86

Quoted 10 lines
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +10 -0
+
+		c7x_0_dma_memory_region: c7x-dma-memory@99800000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99800000 0x00 0x100000>;
+			no-map;
+		};
+
+		c7x_0_memory_region: c7x-memory@99900000 {
+			compatible = "shared-dma-pool";
+			reg = <0x00 0x99900000 0x00 0x01efffff>;

0x01efffff -> are you sure this is correct? Just missing a byte to a nice round number size. looks like typo of using range vs size?

Quoted 48 lines
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +41 -0
+			no-map;
+		};
 	};
 
 	vmain_pd: regulator-0 {
@@ -721,3 +750,42 @@ dpi1_out: endpoint {
 		};
 	};
 };
+
+&mailbox0_cluster0 {
+	mbox_r5_0: mbox-r5-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
+
+&mailbox0_cluster1 {
+	mbox_c7x_0: mbox-c7x-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
+
+&mailbox0_cluster2 {
+	mbox_mcu_r5_0: mbox-mcu-r5-0 {
+		ti,mbox-rx = <0 0 0>;
+		ti,mbox-tx = <1 0 0>;
+	};
+};
+
+&c7x_0 {
+	mboxes = <&mailbox0_cluster1>, <&mbox_c7x_0>;
+	memory-region = <&c7x_0_dma_memory_region>,
+			<&c7x_0_memory_region>;
+};
+
+&wkup_r5fss0_core0 {
+	mboxes = <&mailbox0_cluster0>, <&mbox_r5_0>;
+	memory-region = <&wkup_r5fss0_core0_dma_memory_region>,
+		<&wkup_r5fss0_core0_memory_region>;
+};
+
+&mcu_r5fss0_core0 {
+	mboxes = <&mailbox0_cluster2>, <&mbox_mcu_r5_0>;
+	memory-region = <&mcu_r5fss0_core0_dma_memory_region>,
+			<&mcu_r5fss0_core0_memory_region>;
+};
Signature · 2 lines
Regards
Vignesh
#9 lore raw

Re: [PATCH v3 4/4] arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

Quoted 5 lines · Vignesh Raghavendra
Quoted 3 lines

Reserve memory for remote rpoc IPC and bind the mailbox assignments for each remote proc. Two memory regions are reserved for each remote processor. The first region of 1Mb of memory is used for Vring

s/1Mb/1MB?

Yes, will correct it to 1MB.

Quoted 4 lines

arch/arm64/boot/dts/ti/k3-am62a7-sk.dts secure_ddr: optee@9e800000 { · line 86

Quoted 1 line
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +1 -0
+			reg = <0x00 0x99900000 0x00 0x01efffff>;

0x01efffff -> are you sure this is correct? Just missing a byte to a nice round number size. looks like typo of using range vs size?

You are right. Will round it to 0x01f00000.

#10 lore raw
In reply to Hari Nagalla
Quoted 19 lines · Hari Nagalla

This patch series adds R5F and C7x dsp processor nodes and shared memory based Virtio/IPC configuration for AM62A SoC.

changes in v3:
*) Separated DSP node binding patch and submitted to remoteproc
mailing list, rebased the patches to linux-next.

v2: https://lore.kernel.org/all/[email protected]/

Devarsh Thakkar (2):
arm64: dts: k3-am62a-wakeup: Add R5F device node
arm64: dts: ti: k3-am62a7-sk: Enable ipc with remote proc nodes

Hari Nagalla (1):
arm64: dts: k3-am62a-mcu: Add R5F remote proc node

Jai Luthra (1):
arm64: dts: k3-am62a-main: Add C7xv device node

Quoted 11 lines
 arch/arm64/boot/dts/ti/k3-am62a-main.dtsi   | 11 ++++
 arch/arm64/boot/dts/ti/k3-am62a-mcu.dtsi    | 35 +++++++++++
 arch/arm64/boot/dts/ti/k3-am62a-wakeup.dtsi | 23 +++++++
 arch/arm64/boot/dts/ti/k3-am62a7-sk.dts     | 68 +++++++++++++++++++++
 4 files changed, 137 insertions(+)

--
2.34.1

My bot found new DTB warnings on the .dts files added or changed in this series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings are fixed by another series. Ultimately, it is up to the platform maintainer whether these warnings are acceptable or not. No need to reply unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then make sure dt-schema is up to date:

  pip3 install dtschema --upgrade

New warnings running 'make CHECK_DTBS=y ti/k3-am62a7-sk.dtb' for [email protected]:

arch/arm64/boot/dts/ti/k3-am62a7-sk.dtb: dsp@7e000000: reg: [[0, 2113929216, 0, 1048576]] is too short
from schema $id: http://devicetree.org/schemas/remoteproc/ti,k3-dsp-rproc.yaml#
arch/arm64/boot/dts/ti/k3-am62a7-sk.dtb: dsp@7e000000: reg-names: ['l2sram'] is too short
from schema $id: http://devicetree.org/schemas/remoteproc/ti,k3-dsp-rproc.yaml#
arch/arm64/boot/dts/ti/k3-am62a7-sk.dtb: dsp@7e000000: Unevaluated properties are not allowed ('reg', 'reg-names' were unexpected)
from schema $id: http://devicetree.org/schemas/remoteproc/ti,k3-dsp-rproc.yaml#