Skip to contentSkip to conversation

Introduce K3 remoteproc driver for M4 subsystem

PATCH Superseded Judith Mendez 2 participants 9 messages Feb 6, 2025 – Feb 7, 2025 Remote processor (remoteproc)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v4 cover Introduce K3 remoteproc driver for M4 subsystem

Some K3 devices like am62x and am64x have a M4 processor in the MCU voltage domain. This patch series introduces remoteproc M4 driver which will be used to load firmware into and start the M4 remote core.

This series also adds support for R5F cores on am64x SoCs in patch 2, sets up environment to load FW in remote cores in patch 3,4,5 and enables config options for remoteproc support in patch 6.

This patch series was tested on am64x EVM using commands:

=> setenv dorprocboot 1
=> run boot_rprocs

Changes since v3:
- Add patches 4 and 5 for remoteproc env support on am62x & am62px
- Fix implicitly include warning
- Add remoteproc support configs for am62x
- Cleanup remoteproc configs for am62p and am64x.

Hari Nagalla (6):
remoteproc: k3-m4: Introduce K3 remote proc driver for M4 subsystem
remoteproc: k3-r5: Add support for R5F cores on AM64x SoCs
board: ti: am64x: Add remoteproc specific env support
board: ti: am62x: Add remoteproc specific env support
board: ti: am62px: Add remoteproc specific env support
configs: am6*_evm_a53_defconfig: Enable remoteproc support

 board/ti/am62px/am62px.env           |   6 +
 board/ti/am62x/am62x.env             |   6 +
 board/ti/am64x/am64x.env             |   6 +
 configs/am62px_evm_a53_defconfig     |   1 -
 configs/am62x_evm_a53_defconfig      |   2 +
 configs/am64x_evm_a53_defconfig      |   4 +-
 drivers/remoteproc/Kconfig           |  10 +
 drivers/remoteproc/Makefile          |   1 +
 drivers/remoteproc/ti_k3_m4_rproc.c  | 371 +++++++++++++++++++++++++++
 drivers/remoteproc/ti_k3_r5f_rproc.c |   2 +
 10 files changed, 407 insertions(+), 2 deletions(-)
 create mode 100644 drivers/remoteproc/ti_k3_m4_rproc.c

base-commit: 021baf7b08cceb58bb850859dba1614424e16a83

Signature · 1 line
2.48.0
#1 lore raw

PATCH v4 1/6 remoteproc: k3-m4: Introduce K3 remote proc driver for M4 subsystem

From: Hari Nagalla <[email protected]>

Some K3 devices like AM64, AM62 devices have a M4 processor in MCU voltage domain.

Add a remote proc driver to support this subsystem to be able to load and boot the M4 core.

[Ryan: Fix implicitly include warning]
[Judith: Cleanup driver, fix warnings, remove lreset logic]

---
Changes since v3:
- Fix implicitly include warning

---
 drivers/remoteproc/Kconfig          |  10 +
 drivers/remoteproc/Makefile         |   1 +
 drivers/remoteproc/ti_k3_m4_rproc.c | 371 ++++++++++++++++++++++++++++
 3 files changed, 382 insertions(+)
 create mode 100644 drivers/remoteproc/ti_k3_m4_rproc.c
drivers/remoteproc/Kconfig +10 -0
index 2790b168b19..8a5d88917d6 100644
@@ -70,6 +70,16 @@ config REMOTEPROC_TI_K3_DSP
 	  on various TI K3 family of SoCs through the remote processor
 	  framework.
 
+config REMOTEPROC_TI_K3_M4F
+	bool "TI K3 M4F remoteproc support"
+	select REMOTEPROC
+	depends on ARCH_K3
+	depends on TI_SCI_PROTOCOL
+	help
+	  Say y here to support TI's M4F remote processor subsystems
+	  on various TI K3 family of SoCs through the remote processor
+	  framework.
+
 config REMOTEPROC_TI_K3_R5F
 	bool "TI K3 R5F remoteproc support"
 	select REMOTEPROC
drivers/remoteproc/Makefile +1 -0
index 3a092b7660e..f81e5009c5e 100644
@@ -13,6 +13,7 @@ obj-$(CONFIG_REMOTEPROC_SANDBOX) += sandbox_testproc.o
 obj-$(CONFIG_REMOTEPROC_STM32_COPRO) += stm32_copro.o
 obj-$(CONFIG_REMOTEPROC_TI_K3_ARM64) += ti_k3_arm64_rproc.o
 obj-$(CONFIG_REMOTEPROC_TI_K3_DSP) += ti_k3_dsp_rproc.o
+obj-$(CONFIG_REMOTEPROC_TI_K3_M4F) += ti_k3_m4_rproc.o
 obj-$(CONFIG_REMOTEPROC_TI_K3_R5F) += ti_k3_r5f_rproc.o
 obj-$(CONFIG_REMOTEPROC_TI_POWER) += ti_power_proc.o
 obj-$(CONFIG_REMOTEPROC_TI_PRU) += pru_rproc.o
drivers/remoteproc/ti_k3_m4_rproc.c new file +371 -0

371 lines not on this page · raw message

Signature · 1 line
2.48.0
#2 lore raw

PATCH v4 2/6 remoteproc: k3-r5: Add support for R5F cores on AM64x SoCs

In reply to Judith Mendez

From: Hari Nagalla <[email protected]>

AM64x SoCs have two R5F clusters in the main power domain. Extend support for R5F remote proc driver on AM64x with compatible strings.

---
Changes since v3:
- no change

---
 drivers/remoteproc/ti_k3_r5f_rproc.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/remoteproc/ti_k3_r5f_rproc.c +2 -0
index d78b3fa1bbd..57268e7f8ff 100644
@@ -886,6 +886,7 @@ static const struct udevice_id k3_r5f_rproc_ids[] = {
 	{ .compatible = "ti,j7200-r5f", .data = (ulong)&j7200_j721s2_data, },
 	{ .compatible = "ti,j721s2-r5f", .data = (ulong)&j7200_j721s2_data, },
 	{ .compatible = "ti,am62-r5f", .data = (ulong)&am62_data, },
+	{ .compatible = "ti,am64-r5f", .data = (ulong)&j7200_j721s2_data, },
 	{}
 };
 
@@ -930,6 +931,7 @@ static const struct udevice_id k3_r5fss_ids[] = {
 	{ .compatible = "ti,j7200-r5fss"},
 	{ .compatible = "ti,j721s2-r5fss"},
 	{ .compatible = "ti,am62-r5fss"},
+	{ .compatible = "ti,am64-r5fss"},
 	{}
 };
 
Signature · 1 line
2.48.0
#3 lore raw

PATCH v4 3/6 board: ti: am64x: Add remoteproc specific env support

In reply to Judith Mendez

From: Hari Nagalla <[email protected]>

Add remoteproc specific env support for am64x device. If the remoteproc CMD is defined, include the K3 remoteproc environment. Also define rproc_fw_binaries which holds a list of remoteproc FW binaries for u-boot loading of remote cores.

---
Changes since v3:
- no functional change

---
 board/ti/am64x/am64x.env | 6 ++++++
 1 file changed, 6 insertions(+)
board/ti/am64x/am64x.env +6 -0
index 8ad805a613c..c8ab57b807c 100644
@@ -2,6 +2,12 @@
 #include <env/ti/mmc.env>
 #include <env/ti/k3_dfu.env>
 
+#if CONFIG_CMD_REMOTEPROC
+#include <env/ti/k3_rproc.env>
+#endif
+
+rproc_fw_binaries= 0 /lib/firmware/am64-mcu-m4f0_0-fw 1 /lib/firmware/am64-main-r5f0_0-fw 2 /lib/firmware/am64-main-r5f0_1-fw 3 /lib/firmware/am64-main-r5f1_0-fw 4 /lib/firmware/am64-main-r5f1_1-fw
+
 name_kern=Image
 console=ttyS2,115200n8
 args_all=setenv optargs earlycon=ns16550a,mmio32,0x02800000 ${mtdparts}
Signature · 1 line
2.48.0
#4 lore raw

PATCH v4 4/6 board: ti: am62x: Add remoteproc specific env support

In reply to Judith Mendez

From: Hari Nagalla <[email protected]>

Add remoteproc specific env support for am62x device. If the remoteproc CMD is defined, include the K3 remote procenvironment. Also define rproc_fw_binaries which holds a list of remoteproc FW binaries for u-boot loading of remote cores.

---
Changes since v3:
- add patch

---
 board/ti/am62x/am62x.env | 6 ++++++
 1 file changed, 6 insertions(+)
board/ti/am62x/am62x.env +6 -0
index 078cc4b5ac9..60b5fd5e6ca 100644
@@ -2,6 +2,12 @@
 #include <env/ti/mmc.env>
 #include <env/ti/k3_dfu.env>
 
+#if CONFIG_CMD_REMOTEPROC
+#include <env/ti/k3_rproc.env>
+#endif
+
+rproc_fw_binaries= 0 /lib/firmware/am62-mcu-m4f0_0-fw
+
 name_kern=Image
 console=ttyS2,115200n8
 args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
Signature · 1 line
2.48.0
#5 lore raw

PATCH v4 5/6 board: ti: am62px: Add remoteproc specific env support

In reply to Judith Mendez

From: Hari Nagalla <[email protected]>

Add remoteproc specific env support for am62px device. If the remoteproc CMD is defined, include the K3 remoteproc environment. Also define rproc_fw_binaries which holds a list of remoteproc FW binaries for u-boot loading of remote cores.

---
Changes since v3:
- add patch

---
 board/ti/am62px/am62px.env | 6 ++++++
 1 file changed, 6 insertions(+)
board/ti/am62px/am62px.env +6 -0
index 7ef54079aa8..2b2c938b2e1 100644
@@ -1,6 +1,12 @@
 #include <env/ti/ti_common.env>
 #include <env/ti/mmc.env>
 
+#if CONFIG_CMD_REMOTEPROC
+#include <env/ti/k3_rproc.env>
+#endif
+
+rproc_fw_binaries= 0 /lib/firmware/am62p-mcu-r5f0_0-fw
+
 name_kern=Image
 console=ttyS2,115200n8
 args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
Signature · 1 line
2.48.0
#6 lore raw

PATCH v4 6/6 configs: am6*_evm_a53_defconfig: Enable remoteproc support

In reply to Judith Mendez

From: Hari Nagalla <[email protected]>

Enable configs needed to enable remoteproc drivers for AM62 and AM64 devices.

While we are here, cleanup some remoteproc configs, there is no DSP subsystem for am62px device.

---
Changes since v3:
- Add remoteproc support configs for am62x
- Cleanup remoteproc configs for am62p and am64x.

---
 configs/am62px_evm_a53_defconfig | 1 -
 configs/am62x_evm_a53_defconfig  | 2 ++
 configs/am64x_evm_a53_defconfig  | 4 +++-
 3 files changed, 5 insertions(+), 2 deletions(-)
configs/am62px_evm_a53_defconfig +0 -1
index 30b4a24ee9a..10e00519bc1 100644
@@ -147,7 +147,6 @@ CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
-CONFIG_REMOTEPROC_TI_K3_DSP=y
 CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_RESET_TI_SCI=y
 CONFIG_DM_RTC=y
configs/am62x_evm_a53_defconfig +2 -0
index c77e09db156..51b8c0ae3fb 100644
@@ -56,6 +56,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y
 CONFIG_CMD_BOOTEFI_SELFTEST=y
 CONFIG_CMD_NVEDIT_EFI=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_EFIDEBUG=y
 CONFIG_MMC_SPEED_MODE_SET=y
 CONFIG_OF_CONTROL=y
@@ -121,6 +122,7 @@ CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_REMOTEPROC_TI_K3_M4F=y
 CONFIG_RESET_TI_SCI=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_EMULATION=y
configs/am64x_evm_a53_defconfig +3 -1
index a501f3f567e..5528f54549d 100644
@@ -70,6 +70,7 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_EFIDEBUG=y
 CONFIG_CMD_TIME=y
@@ -149,8 +150,9 @@ CONFIG_DM_REGULATOR=y
 CONFIG_DM_REGULATOR_TPS65219=y
 CONFIG_K3_SYSTEM_CONTROLLER=y
 CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_REMOTEPROC_TI_K3_M4F=y
+CONFIG_REMOTEPROC_TI_K3_R5F=y
 CONFIG_REMOTEPROC_TI_PRU=y
-CONFIG_CMD_REMOTEPROC=y
 CONFIG_RESET_TI_SCI=y
 CONFIG_DM_RTC=y
 CONFIG_RTC_EMULATION=y
Signature · 1 line
2.48.0
Reviewed-by on v4 6/6
#7 lore raw

Re: [PATCH v4 6/6] configs: am6*_evm_a53_defconfig: Enable remoteproc support

Quoted 65 lines · Judith Mendez

From: Hari Nagalla <[email protected]>

Enable configs needed to enable remoteproc drivers for AM62 and AM64 devices.

While we are here, cleanup some remoteproc configs, there is no DSP subsystem for am62px device.

---
Changes since v3:
- Add remoteproc support configs for am62x
- Cleanup remoteproc configs for am62p and am64x.

---
  configs/am62px_evm_a53_defconfig | 1 -
  configs/am62x_evm_a53_defconfig  | 2 ++
  configs/am64x_evm_a53_defconfig  | 4 +++-
  3 files changed, 5 insertions(+), 2 deletions(-)
configs/am62px_evm_a53_defconfig +0 -1
index 30b4a24ee9a..10e00519bc1 100644
@@ -147,7 +147,6 @@ CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_SPL_DM_REGULATOR_GPIO=y
  CONFIG_K3_SYSTEM_CONTROLLER=y
  CONFIG_REMOTEPROC_TI_K3_ARM64=y
-CONFIG_REMOTEPROC_TI_K3_DSP=y
  CONFIG_REMOTEPROC_TI_K3_R5F=y
  CONFIG_RESET_TI_SCI=y
  CONFIG_DM_RTC=y
configs/am62x_evm_a53_defconfig +2 -0
index c77e09db156..51b8c0ae3fb 100644
@@ -56,6 +56,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y
  CONFIG_CMD_BOOTEFI_SELFTEST=y
  CONFIG_CMD_NVEDIT_EFI=y
  CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
  CONFIG_CMD_EFIDEBUG=y
  CONFIG_MMC_SPEED_MODE_SET=y
  CONFIG_OF_CONTROL=y
@@ -121,6 +122,7 @@ CONFIG_DM_REGULATOR_GPIO=y
  CONFIG_SPL_DM_REGULATOR_GPIO=y
  CONFIG_K3_SYSTEM_CONTROLLER=y
  CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_REMOTEPROC_TI_K3_M4F=y
  CONFIG_RESET_TI_SCI=y
  CONFIG_DM_RTC=y
  CONFIG_RTC_EMULATION=y
configs/am64x_evm_a53_defconfig +1 -0
index a501f3f567e..5528f54549d 100644
@@ -70,6 +70,7 @@ CONFIG_CMD_DFU=y
  CONFIG_CMD_GPT=y
  CONFIG_CMD_I2C=y
  CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_EFIDEBUG=y
  CONFIG_CMD_TIME=y

configs/am64x_evm_a53_defconfig CONFIG_DM_REGULATOR=y · line 154

Quoted 5 lines
configs/am64x_evm_a53_defconfig +2 -0
@@ -149,8 +150,9 @@ CONFIG_DM_REGULATOR=y
  CONFIG_DM_REGULATOR_TPS65219=y
  CONFIG_K3_SYSTEM_CONTROLLER=y
  CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_REMOTEPROC_TI_K3_M4F=y
+CONFIG_REMOTEPROC_TI_K3_R5F=y

Would it work better to add these to the kconfig for AM64 so other boards get this without needing to add to each defconfig?

Otherwise whole series looks fine to me,

Quoted 5 lines
configs/am64x_evm_a53_defconfig +0 -1
  CONFIG_REMOTEPROC_TI_PRU=y
-CONFIG_CMD_REMOTEPROC=y
  CONFIG_RESET_TI_SCI=y
  CONFIG_DM_RTC=y
  CONFIG_RTC_EMULATION=y
#8 lore raw

Re: [PATCH v4 6/6] configs: am6*_evm_a53_defconfig: Enable remoteproc support

Hi Andrew,

Quoted 66 lines · Andrew Davis
Quoted 65 lines · Judith Mendez

From: Hari Nagalla <[email protected]>

Enable configs needed to enable remoteproc drivers for AM62 and AM64 devices.

While we are here, cleanup some remoteproc configs, there is no DSP subsystem for am62px device.

---
Changes since v3:
- Add remoteproc support configs for am62x
- Cleanup remoteproc configs for am62p and am64x.
---
  configs/am62px_evm_a53_defconfig | 1 -
  configs/am62x_evm_a53_defconfig  | 2 ++
  configs/am64x_evm_a53_defconfig  | 4 +++-

  3 files changed, 5 insertions(+), 2 deletions(-)
configs/am62px_evm_a53_defconfig +0 -0
index 30b4a24ee9a..10e00519bc1 100644
@@ -147,7 +147,6 @@ CONFIG_DM_REGULATOR_GPIO=y

  CONFIG_SPL_DM_REGULATOR_GPIO=y
  CONFIG_K3_SYSTEM_CONTROLLER=y
  CONFIG_REMOTEPROC_TI_K3_ARM64=y
-CONFIG_REMOTEPROC_TI_K3_DSP=y
  CONFIG_REMOTEPROC_TI_K3_R5F=y
  CONFIG_RESET_TI_SCI=y
  CONFIG_DM_RTC=y

configs/am62x_evm_a53_defconfig +0 -0
index c77e09db156..51b8c0ae3fb 100644
@@ -56,6 +56,7 @@ CONFIG_SPL_YMODEM_SUPPORT=y

  CONFIG_CMD_BOOTEFI_SELFTEST=y
  CONFIG_CMD_NVEDIT_EFI=y
  CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
  CONFIG_CMD_EFIDEBUG=y
  CONFIG_MMC_SPEED_MODE_SET=y
  CONFIG_OF_CONTROL=y

configs/am62x_evm_a53_defconfig +0 -0
@@ -121,6 +122,7 @@ CONFIG_DM_REGULATOR_GPIO=y

  CONFIG_SPL_DM_REGULATOR_GPIO=y
  CONFIG_K3_SYSTEM_CONTROLLER=y
  CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_REMOTEPROC_TI_K3_M4F=y
  CONFIG_RESET_TI_SCI=y
  CONFIG_DM_RTC=y
  CONFIG_RTC_EMULATION=y

configs/am64x_evm_a53_defconfig +0 -0
index a501f3f567e..5528f54549d 100644
@@ -70,6 +70,7 @@ CONFIG_CMD_DFU=y

  CONFIG_CMD_GPT=y
  CONFIG_CMD_I2C=y
  CONFIG_CMD_MMC=y
+CONFIG_CMD_REMOTEPROC=y
  CONFIG_CMD_USB=y
  CONFIG_CMD_EFIDEBUG=y
  CONFIG_CMD_TIME=y

configs/am64x_evm_a53_defconfig +0 -0
@@ -149,8 +150,9 @@ CONFIG_DM_REGULATOR=y
Quoted 8 lines

configs/am64x_evm_a53_defconfig CONFIG_DM_REGULATOR=y · line 154

Quoted 5 lines

  CONFIG_DM_REGULATOR_TPS65219=y
  CONFIG_K3_SYSTEM_CONTROLLER=y
  CONFIG_REMOTEPROC_TI_K3_ARM64=y

configs/am64x_evm_a53_defconfig +2 -0
+CONFIG_REMOTEPROC_TI_K3_M4F=y
+CONFIG_REMOTEPROC_TI_K3_R5F=y

Would it work better to add these to the kconfig for AM64 so other boards get this without needing to add to each defconfig?

I can do that.

It would also be nice to do the same for other Sitara devices so will do that as well.

Will respin the series with this change.

Thanks Andrew,

Judith

Quoted 10 lines

Otherwise whole series looks fine to me,

Quoted 5 lines

  CONFIG_REMOTEPROC_TI_PRU=y
-CONFIG_CMD_REMOTEPROC=y
  CONFIG_RESET_TI_SCI=y
  CONFIG_DM_RTC=y
  CONFIG_RTC_EMULATION=y