Skip to contentSkip to conversation

Update K3 DSP remoteproc driver for C71x DSPs

PATCH Applied Suman Anna 3 participants 5 messages Jun 12, 2020 – Jul 29, 2020

Subsystems (2)

v3 of 5 Applied Latest is v5 →

lore
Share & tools
lore

Suman Anna

author
#0 lore raw

v3 cover Update K3 DSP remoteproc driver for C71x DSPs

Hi All,

This series is the updated v3 version of the 64-bit TI C71x DSP support that goes along with the updated v3 TI K3 C66x DSP patch series [1]. Please see the previous cover-letters [2][3] for a summary of supported features.

The only change is to Patch 1 that had to be rebased and adjusted for the changes to the K3 DSP binding file in the C66x series. Please see the individual patches for differences in v3.

regards
Suman

[1] C66x v3: https://patchwork.kernel.org/cover/11602331/
[2] C71x v2: https://patchwork.kernel.org/cover/11563229/
[2] C71x v1: https://patchwork.kernel.org/cover/11458599/

Suman Anna (2):
dt-bindings: remoteproc: k3-dsp: Update bindings for C71x DSPs
remoteproc: k3-dsp: Add support for C71x DSPs

 .../bindings/remoteproc/ti,k3-dsp-rproc.yaml  | 68 +++++++++++++++----
 drivers/remoteproc/ti_k3_dsp_remoteproc.c     | 20 +++++-
 2 files changed, 73 insertions(+), 15 deletions(-)
Signature · 1 line
2.26.0
author
#1 lore raw

PATCH v3 1/2 dt-bindings: remoteproc: k3-dsp: Update bindings for C71x DSPs

Some Texas Instruments K3 family of SoCs have one of more newer generation TMS320C71x CorePac processor subsystem in addition to the existing TMS320C66x CorePac processor subsystems. Update the device tree bindings document for the C71x DSP devices.

The example is also updated to show the single C71 DSP present on J721E SoCs.

---
v3:
- Dropped Rob's previous Reviewed-by tag due to decent changes in the patch
- Replaced the minItems and maxItems from reg with actual items list
- Dropped C71 reserved memory nodes from example
v2: https://patchwork.kernel.org/patch/11563231/

 .../bindings/remoteproc/ti,k3-dsp-rproc.yaml  | 68 +++++++++++++++----
 1 file changed, 55 insertions(+), 13 deletions(-)
Documentation/devicetree/bindings/remoteproc/ti,k3-dsp-rproc.yaml +55 -13
index f03e88c42a6e..8eaf326b5a7f 100644
@@ -30,21 +30,12 @@ allOf:
 
 properties:
   compatible:
-    const: ti,j721e-c66-dsp
+    enum:
+      - ti,j721e-c66-dsp
+      - ti,j721e-c71-dsp
     description:
       Use "ti,j721e-c66-dsp" for C66x DSPs on K3 J721E SoCs
-
-  reg:
-    items:
-      - description: Address and Size of the L2 SRAM internal memory region
-      - description: Address and Size of the L1 PRAM internal memory region
-      - description: Address and Size of the L1 DRAM internal memory region
-
-  reg-names:
-    items:
-      - const: l2sram
-      - const: l1pram
-      - const: l1dram
+      Use "ti,j721e-c71-dsp" for C71x DSPs on K3 J721E SoCs
 
   resets:
     description: |
@@ -92,6 +83,40 @@ properties:
       should be defined as per the generic bindings in,
       Documentation/devicetree/bindings/sram/sram.yaml
 
+if:
+  properties:
+    compatible:
+      enum:
+        - ti,j721e-c66-dsp
+then:
+  properties:
+    reg:
+      items:
+        - description: Address and Size of the L2 SRAM internal memory region
+        - description: Address and Size of the L1 PRAM internal memory region
+        - description: Address and Size of the L1 DRAM internal memory region
+    reg-names:
+      items:
+        - const: l2sram
+        - const: l1pram
+        - const: l1dram
+else:
+  if:
+    properties:
+      compatible:
+        enum:
+          - ti,j721e-c71-dsp
+  then:
+    properties:
+      reg:
+        items:
+          - description: Address and Size of the L2 SRAM internal memory region
+          - description: Address and Size of the L1 DRAM internal memory region
+      reg-names:
+        items:
+          - const: l2sram
+          - const: l1dram
+
 required:
  - compatible
  - reg
@@ -116,6 +141,7 @@ examples:
             #address-cells = <2>;
             #size-cells = <2>;
             ranges = <0x00 0x00100000 0x00 0x00100000 0x00 0x00020000>, /* ctrl mmr */
+                     <0x00 0x64800000 0x00 0x64800000 0x00 0x00800000>, /* C71_0 */
                      <0x4d 0x80800000 0x4d 0x80800000 0x00 0x00800000>, /* C66_0 */
                      <0x4d 0x81800000 0x4d 0x81800000 0x00 0x00800000>; /* C66_1 */
 
@@ -135,5 +161,21 @@ examples:
                                 <&c66_0_memory_region>;
                 mboxes = <&mailbox0_cluster3 &mbox_c66_0>;
             };
+
+            /* J721E C71_0 DSP node */
+            c71_0: dsp@64800000 {
+                compatible = "ti,j721e-c71-dsp";
+                reg = <0x00 0x64800000 0x00 0x00080000>,
+                      <0x00 0x64e00000 0x00 0x0000c000>;
+                reg-names = "l2sram", "l1dram";
+                ti,sci = <&dmsc>;
+                ti,sci-dev-id = <15>;
+                ti,sci-proc-ids = <0x30 0xFF>;
+                resets = <&k3_reset 15 1>;
+                firmware-name = "j7-c71_0-fw";
+                memory-region = <&c71_0_dma_memory_region>,
+                                <&c71_0_memory_region>;
+                mboxes = <&mailbox0_cluster4 &mbox_c71_0>;
+            };
         };
     };
Signature · 1 line
2.26.0
maintainer Reviewed-by on v3 1/2
#2 lore raw

Re: [PATCH v3 1/2] dt-bindings: remoteproc: k3-dsp: Update bindings for C71x DSPs

Quoted 17 lines · Suman Anna

Some Texas Instruments K3 family of SoCs have one of more newer generation TMS320C71x CorePac processor subsystem in addition to the existing TMS320C66x CorePac processor subsystems. Update the device tree bindings document for the C71x DSP devices.

The example is also updated to show the single C71 DSP present on J721E SoCs.

---
v3:
- Dropped Rob's previous Reviewed-by tag due to decent changes in the patch
- Replaced the minItems and maxItems from reg with actual items list
- Dropped C71 reserved memory nodes from example
v2: https://patchwork.kernel.org/patch/11563231/

Quoted 3 lines
 .../bindings/remoteproc/ti,k3-dsp-rproc.yaml  | 68 +++++++++++++++----
 1 file changed, 55 insertions(+), 13 deletions(-)

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

author
#3 lore raw

PATCH v3 2/2 remoteproc: k3-dsp: Add support for C71x DSPs

In reply to Suman Anna

The Texas Instrument's K3 J721E SoCs have a newer next-generation C71x DSP Subsystem in the MAIN voltage domain in addition to the previous generation C66x DSP subsystems. The C71x DSP subsystem is based on the TMS320C71x DSP CorePac module. The C71x CPU is a true 64-bit machine including 64-bit memory addressing and single-cycle 64-bit base arithmetic operations and supports vector signal processing providing a significant lift in DSP processing power over C66x DSPs. J721E SoCs use a C711 (a one-core 512-bit vector width CPU core) DSP that is cache coherent with the A72 Arm cores.

Each subsystem has one or more Fixed/Floating-Point DSP CPUs, with 32 KB of L1P Cache, 48 KB of L1D SRAM that can be configured and partitioned as either RAM and/or Cache, and 512 KB of L2 SRAM configurable as either RAM and/or Cache. The CorePac also includes a Matrix Multiplication Accelerator (MMA), a Stream Engine (SE) and a C71x Memory Management Unit (CMMU), an Interrupt Controller (INTC) and a Powerdown Management Unit (PMU) modules.

Update the existing K3 DSP remoteproc driver to add support for this C71x DSP subsystem. The firmware loading support is provided by using the newly added 64-bit ELF loader support, and is limited to images using only external DDR memory at the moment. The L1D and L2 SRAMs are used as scratch memory when using as RAMs, and cannot be used for loadable segments. The CMMU is also not supported to begin with, and the driver is designed to treat the MMU as if it is in bypass mode.

---
v3:
- No code changes, rebased patch
- Picked up review tags
- Switched from remoteproc/k3-dsp to remoteproc: k3-dsp in patch title
v2: https://patchwork.kernel.org/patch/11563233/

 drivers/remoteproc/ti_k3_dsp_remoteproc.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/remoteproc/ti_k3_dsp_remoteproc.c +18 -2
index 668bb45b3fe8..861cc9126241 100644
@@ -407,8 +407,6 @@ static void *k3_dsp_rproc_da_to_va(struct rproc *rproc, u64 da, size_t len)
 }
 
 static const struct rproc_ops k3_dsp_rproc_ops = {
-	.prepare	= k3_dsp_rproc_prepare,
-	.unprepare	= k3_dsp_rproc_unprepare,
 	.start		= k3_dsp_rproc_start,
 	.stop		= k3_dsp_rproc_stop,
 	.kick		= k3_dsp_rproc_kick,
@@ -618,6 +616,10 @@ static int k3_dsp_rproc_probe(struct platform_device *pdev)
 
 	rproc->has_iommu = false;
 	rproc->recovery_disabled = true;
+	if (data->uses_lreset) {
+		rproc->ops->prepare = k3_dsp_rproc_prepare;
+		rproc->ops->unprepare = k3_dsp_rproc_unprepare;
+	}
 	kproc = rproc->priv;
 	kproc->rproc = rproc;
 	kproc->dev = dev;
@@ -745,6 +747,12 @@ static const struct k3_dsp_mem_data c66_mems[] = {
 	{ .name = "l1dram", .dev_addr = 0xf00000 },
 };
 
+/* C71x cores only have a L1P Cache, there are no L1P SRAMs */
+static const struct k3_dsp_mem_data c71_mems[] = {
+	{ .name = "l2sram", .dev_addr = 0x800000 },
+	{ .name = "l1dram", .dev_addr = 0xe00000 },
+};
+
 static const struct k3_dsp_dev_data c66_data = {
 	.mems = c66_mems,
 	.num_mems = ARRAY_SIZE(c66_mems),
@@ -752,8 +760,16 @@ static const struct k3_dsp_dev_data c66_data = {
 	.uses_lreset = true,
 };
 
+static const struct k3_dsp_dev_data c71_data = {
+	.mems = c71_mems,
+	.num_mems = ARRAY_SIZE(c71_mems),
+	.boot_align_addr = SZ_2M,
+	.uses_lreset = false,
+};
+
 static const struct of_device_id k3_dsp_of_match[] = {
 	{ .compatible = "ti,j721e-c66-dsp", .data = &c66_data, },
+	{ .compatible = "ti,j721e-c71-dsp", .data = &c71_data, },
 	{ /* sentinel */ },
 };
 MODULE_DEVICE_TABLE(of, k3_dsp_of_match);
Signature · 1 line
2.26.0
#4 lore raw
In reply to Suman Anna
This series was applied to andersson/remoteproc.git (refs/heads/for-next).

Hello:

This series was applied to andersson/remoteproc.git (refs/heads/for-next).

Quoted 8 lines · On Fri, 12 Jun 2020 17:53:55 -0500 you wrote:

Hi All,

This series is the updated v3 version of the 64-bit TI C71x DSP support that goes along with the updated v3 TI K3 C66x DSP patch series [1]. Please see the previous cover-letters [2][3] for a summary of supported features.

[...]

Here is a summary with links:
- [v3,1/2] dt-bindings: remoteproc: k3-dsp: Update bindings for C71x DSPs

    https://git.kernel.org/andersson/remoteproc/c/c6caf22eaa2347e75ef639ccfafd277ce466e1ca
  - [v3,2/2] remoteproc: k3-dsp: Add support for C71x DSPs
    https://git.kernel.org/andersson/remoteproc/c/87218f96c21a992817f3841078df873a1b037a58

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/pwbot