TI K3 M4F support on AM64x and AM62x SoCs
Subsystems (2)
v4 cover TI K3 M4F support on AM64x and AM62x SoCs
The following series introduces K3 M4F remoteproc driver support for AM64x and AM62x SoC families. These SoCs have a ARM Cortex M4F core in the MCU voltage domain. For safety oriented applications, this core is operated independently with out any IPC to other cores on the SoC. However, for non safety applications, some customers use it as a remote processor and so linux remote proc support is extended to the M4F core.
See AM64x Technical Reference Manual (SPRUIM2C – SEPTEMBER 2021) for further details: https://www.ti.com/lit/pdf/SPRUIM2
Hari Nagalla (1):
dt-bindings: remoteproc: k3-m4f: Add bindings for K3 AM64x SoCs
Martyn Welch (2):
remoteproc: k3: Split out functions common with M4 driver
remoteproc: k3-m4: Add a remoteproc driver for M4F subsystem
.../bindings/remoteproc/ti,k3-m4f-rproc.yaml | 123 ++++ drivers/remoteproc/Kconfig | 13 + drivers/remoteproc/Makefile | 3 +- drivers/remoteproc/ti_k3_common.c | 513 +++++++++++++++ drivers/remoteproc/ti_k3_common.h | 108 ++++ drivers/remoteproc/ti_k3_dsp_remoteproc.c | 598 +----------------- drivers/remoteproc/ti_k3_m4_remoteproc.c | 333 ++++++++++ 7 files changed, 1121 insertions(+), 570 deletions(-) create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml create mode 100644 drivers/remoteproc/ti_k3_common.c create mode 100644 drivers/remoteproc/ti_k3_common.h create mode 100644 drivers/remoteproc/ti_k3_m4_remoteproc.c
Signature · 1 line
2.34.1
PATCH v4 1/3 dt-bindings: remoteproc: k3-m4f: Add K3 AM64x SoCs
K3 AM64x SoC has a Cortex M4F subsystem in the MCU voltage domain. The remote processor's life cycle management and IPC mechanisms are similar across the R5F and M4F cores from remote processor driver point of view. However, there are subtle differences in image loading and starting the M4F subsystems.
The YAML binding document provides the various node properties to be configured by the consumers of the M4F subsystem.
---
Changes since v1:
- Spelling corrections
- Corrected to pass DT checks
Changes since v2:
- Missed spelling correction to commit message
Changes since v3:
- Removed unnecessary descriptions and used generic memory region names
- Made mboxes and memory-region optional
- Removed unrelated items from examples
.../bindings/remoteproc/ti,k3-m4f-rproc.yaml | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml
Documentation/devicetree/bindings/remoteproc/ti,k3-m4f-rproc.yaml new file +123 -0
@@ -0,0 +1,123 @@ +# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/remoteproc/ti,k3-m4f-rproc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI K3 M4F processor subsystems + +maintainers: + - Hari Nagalla <[email protected]> + - Mathieu Poirier <[email protected]> + +description: | + Some K3 family SoCs have Arm Cortex M4F cores. AM64x is a SoC in K3 + family with a M4F core. Typically safety oriented applications may use + the M4F core in isolation without an IPC. Where as some industrial and + home automation applications, may use the M4F core as a remote processor + with IPC communications. + +$ref: /schemas/arm/keystone/ti,k3-sci-common.yaml# + +properties: + + compatible: + enum: + - ti,am64-m4fss + + power-domains: + maxItems: 1 + + "#address-cells": + const: 2 + + "#size-cells": + const: 2 + + reg: + items: + - description: IRAM internal memory region + - description: DRAM internal memory region + + reg-names: + items: + - const: iram + - const: dram + + resets: + maxItems: 1 + + firmware-name: + $ref: /schemas/types.yaml#/definitions/string + description: Name of firmware to load for the M4F core + + mboxes: + description: | + Mailbox specifier denoting the sub-mailbox, to be used for communication + with the remote processor. This property should match with the + sub-mailbox node used in the firmware image. + maxItems: 1 + + memory-region: + description: | + phandle to the reserved memory nodes to be associated with the + remoteproc device. The reserved memory nodes should be carveout nodes, + and should be defined with a "no-map" property as per the bindings in + Documentation/devicetree/bindings/reserved-memory/reserved-memory.yaml + Optional memory regions available for firmware specific purposes. + maxItems: 8 + items: + - description: regions used for DMA allocations like vrings, vring buffers + and memory dedicated to firmware's specific purposes. + additionalItems: true + +required: + - compatible + - reg + - reg-names + - ti,sci + - ti,sci-dev-id + - ti,sci-proc-ids + - resets + - firmware-name + +unevaluatedProperties: false + +examples: + - | + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + + 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; + }; + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + + remoteproc@5000000 { + compatible = "ti,am64-m4fss"; + reg = <0x00 0x5000000 0x00 0x30000>, + <0x00 0x5040000 0x00 0x10000>; + reg-names = "iram", "dram"; + ti,sci = <&dmsc>; + ti,sci-dev-id = <9>; + ti,sci-proc-ids = <0x18 0xff>; + resets = <&k3_reset 9 1>; + firmware-name = "am62-mcu-m4f0_0-fw"; + mboxes = <&mailbox0_cluster0 &mbox_m4_0>; + memory-region = <&mcu_m4fss_dma_memory_region>, + <&mcu_m4fss_memory_region>; + }; + };
Signature · 1 line
2.34.1
Re: [PATCH v4 1/3] dt-bindings: remoteproc: k3-m4f: Add K3 AM64x SoCs
Quoted 9 lines · Hari Nagalla
K3 AM64x SoC has a Cortex M4F subsystem in the MCU voltage domain. The remote processor's life cycle management and IPC mechanisms are similar across the R5F and M4F cores from remote processor driver point of view. However, there are subtle differences in image loading and starting the M4F subsystems.
The YAML binding document provides the various node properties to be configured by the consumers of the M4F subsystem.
Quoted 7 lines
Signed-off-by Martyn Welch <[email protected]>Signed-off-by Hari Nagalla <[email protected]>---
Changes since v1:
- Spelling corrections
- Corrected to pass DT checks
I don't think so.
Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.
You missed at least DT list (maybe more), so this won't be tested by automated tooling. Performing review on untested code might be a waste of time, thus I will skip this patch entirely till you follow the process allowing the patch to be tested.
Please kindly resend and include all necessary To/Cc entries.
Best regards,
Krzysztof
PATCH v4 2/3 remoteproc: k3: Split out functions common with M4 driver
In reply to Hari NagallaFrom: Martyn Welch <[email protected]>
In the next commit we will be adding the M4F driver which shares a lot of commonality with the DSP driver. Split this shared functionality out so that it can be used by both drivers.
---
Changes since v2:
- New pacth (reordered refactored from v2)
Changes since v3:
- Removed "ipc_only" element from k3_rproc structure
- Refactored to bring 3 more common functions
drivers/remoteproc/Makefile | 2 +- drivers/remoteproc/ti_k3_common.c | 513 +++++++++++++++++++ drivers/remoteproc/ti_k3_common.h | 103 ++++ drivers/remoteproc/ti_k3_dsp_remoteproc.c | 598 ++-------------------- 4 files changed, 646 insertions(+), 570 deletions(-) create mode 100644 drivers/remoteproc/ti_k3_common.c create mode 100644 drivers/remoteproc/ti_k3_common.h
drivers/remoteproc/Makefile +1 -1
@@ -36,6 +36,6 @@ obj-$(CONFIG_RCAR_REMOTEPROC) += rcar_rproc.o obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o -obj-$(CONFIG_TI_K3_DSP_REMOTEPROC) += ti_k3_dsp_remoteproc.o +obj-$(CONFIG_TI_K3_DSP_REMOTEPROC) += ti_k3_dsp_remoteproc.o ti_k3_common.o obj-$(CONFIG_TI_K3_R5_REMOTEPROC) += ti_k3_r5_remoteproc.o obj-$(CONFIG_XLNX_R5_REMOTEPROC) += xlnx_r5_remoteproc.o
drivers/remoteproc/ti_k3_common.c new file +513 -0
513 lines not on this page · raw message
drivers/remoteproc/ti_k3_common.h new file +103 -0
103 lines not on this page · raw message
drivers/remoteproc/ti_k3_dsp_remoteproc.c +29 -569
742 lines not on this page · raw message
Signature · 1 line
2.34.1
PATCH v4 3/3 remoteproc: k3-m4: Add a remoteproc driver for M4F subsystem
In reply to Hari NagallaFrom: Martyn Welch <[email protected]>
The AM62x and AM64x SoCs of the TI K3 family has a Cortex M4F core in the MCU domain. This core is typically used for safety applications in a stand alone mode. However, some application (non safety related) may want to use the M4F core as a generic remote processor with IPC to the host processor. The M4F core has internal IRAM and DRAM memories and are exposed to the system bus for code and data loading.
A remote processor driver is added to support this subsystem, including being able to load and boot the M4F core. Loading includes to M4F internal memories and predefined external code/data memories. The carve outs for external contiguous memory is defined in the M4F device node and should match with the external memory declarations in the M4F image binary. The M4F subsystem has two resets. One reset is for the entire subsystem i.e including the internal memories and the other, a local reset is only for the M4F processing core. When loading the image, the driver first releases the subsystem reset, loads the firmware image and then releases the local reset to let the M4F processing core run.
---
Changes since v1:
- Addressed minor review comments (refactoring completed in separate patch)
Changes since v2:
- Refactoring completed first, thus smaller change
Changes since v3:
- Removed 'ipc_only' flag and made changes in probe() to enact right operations
- Fixed spelling mistakes in commit message
- Changed some 'dev_err' messages to 'dev_info'
- Removed unnecessary checks rproc state
drivers/remoteproc/Kconfig | 13 + drivers/remoteproc/Makefile | 1 + drivers/remoteproc/ti_k3_common.h | 7 +- drivers/remoteproc/ti_k3_m4_remoteproc.c | 333 +++++++++++++++++++++++ 4 files changed, 353 insertions(+), 1 deletion(-) create mode 100644 drivers/remoteproc/ti_k3_m4_remoteproc.c
drivers/remoteproc/Kconfig +13 -0
@@ -339,6 +339,19 @@ config TI_K3_DSP_REMOTEPROC It's safe to say N here if you're not interested in utilizing the DSP slave processors. +config TI_K3_M4_REMOTEPROC + tristate "TI K3 M4 remoteproc support" + depends on ARCH_K3 + select MAILBOX + select OMAP2PLUS_MBOX + help + Say m here to support TI's M4 remote processor subsystems + on various TI K3 family of SoCs through the remote processor + framework. + + It's safe to say N here if you're not interested in utilizing + a remote processor. + config TI_K3_R5_REMOTEPROC tristate "TI K3 R5 remoteproc support" depends on ARCH_K3
drivers/remoteproc/Makefile +1 -0
@@ -37,5 +37,6 @@ obj-$(CONFIG_ST_REMOTEPROC) += st_remoteproc.o obj-$(CONFIG_ST_SLIM_REMOTEPROC) += st_slim_rproc.o obj-$(CONFIG_STM32_RPROC) += stm32_rproc.o obj-$(CONFIG_TI_K3_DSP_REMOTEPROC) += ti_k3_dsp_remoteproc.o ti_k3_common.o +obj-$(CONFIG_TI_K3_M4_REMOTEPROC) += ti_k3_m4_remoteproc.o ti_k3_common.o obj-$(CONFIG_TI_K3_R5_REMOTEPROC) += ti_k3_r5_remoteproc.o obj-$(CONFIG_XLNX_R5_REMOTEPROC) += xlnx_r5_remoteproc.o
drivers/remoteproc/ti_k3_common.h +6 -1
@@ -2,11 +2,15 @@/* * TI K3 Remote Processor(s) driver common code * -* Refactored from ti_k3_dsp_remoteproc.c. +* Refactored from ti_k3_dsp_remoteproc.c and ti_k3_m4_remoteproc.c. * * ti_k3_dsp_remoteproc.c: * Copyright (C) 2018-2022 Texas Instruments Incorporated - https://www.ti.com/ * Suman Anna <[email protected]> +* +* ti_k3_m4_remoteproc.c: +* Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com/ +* Hari Nagalla <[email protected]> */ #ifndef REMOTEPROC_TI_K3_COMMON_H
@@ -82,6 +86,7 @@ struct k3_rproc {u32 ti_sci_id;struct mbox_chan *mbox;struct mbox_client client; +bool ipc_only; };void k3_rproc_kick (struct rproc *rproc,int vqid);
drivers/remoteproc/ti_k3_m4_remoteproc.c new file +333 -0
333 lines not on this page · raw message
Signature · 1 line
2.34.1