aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-05-15 10:45:33 -0600
committerTom Rini <trini@konsulko.com>2024-05-15 10:45:33 -0600
commit85e2c6900ea3282b766ffc37c71f035b0f47395f (patch)
tree306b075de550984b6e08a122baf8fa36f4cdfe77
parent9c29afe0ccff5b6d8f6c57f4b0b41e3daf6ea94a (diff)
parentbf37851dc639273feefea8115fa3d43898d58e8d (diff)
downloadu-boot-85e2c6900ea3282b766ffc37c71f035b0f47395f.zip
u-boot-85e2c6900ea3282b766ffc37c71f035b0f47395f.tar.gz
u-boot-85e2c6900ea3282b766ffc37c71f035b0f47395f.tar.bz2
Merge patch series "Add remoteproc driver for AM62a SoC"
Hari Nagalla <hnagalla@ti.com> says: This series adds relevant ip data in remoteproc driver for AM62a devices. Logs: https://paste.sr.ht/~hnagalla/5e20838705c1d688bca81886dad56451b56d3913
-rw-r--r--board/ti/am62ax/am62ax.env4
-rw-r--r--configs/am62ax_evm_a53_defconfig3
-rw-r--r--drivers/remoteproc/ti_k3_dsp_rproc.c13
-rw-r--r--drivers/remoteproc/ti_k3_r5f_rproc.c29
4 files changed, 45 insertions, 4 deletions
diff --git a/board/ti/am62ax/am62ax.env b/board/ti/am62ax/am62ax.env
index 334374a..97122fb 100644
--- a/board/ti/am62ax/am62ax.env
+++ b/board/ti/am62ax/am62ax.env
@@ -1,5 +1,8 @@
#include <env/ti/ti_common.env>
#include <env/ti/mmc.env>
+#if CONFIG_CMD_REMOTEPROC
+#include <env/ti/k3_rproc.env>
+#endif
name_kern=Image
console=ttyS2,115200n8
@@ -27,3 +30,4 @@ get_kern_mmc=load mmc ${bootpart} ${loadaddr}
get_fit_mmc=load mmc ${bootpart} ${addr_fit}
${bootdir}/${name_fit}
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
+rproc_fw_binaries= 0 /lib/firmware/am62a-mcu-r5f0_0-fw 1 /lib/firmware/am62a-c71_0-fw
diff --git a/configs/am62ax_evm_a53_defconfig b/configs/am62ax_evm_a53_defconfig
index c4556f5..6b29a4b 100644
--- a/configs/am62ax_evm_a53_defconfig
+++ b/configs/am62ax_evm_a53_defconfig
@@ -72,6 +72,8 @@ CONFIG_POWER_DOMAIN=y
CONFIG_TI_SCI_POWER_DOMAIN=y
CONFIG_K3_SYSTEM_CONTROLLER=y
CONFIG_REMOTEPROC_TI_K3_ARM64=y
+CONFIG_REMOTEPROC_TI_K3_R5F=y
+CONFIG_REMOTEPROC_TI_K3_DSP=y
CONFIG_RESET_TI_SCI=y
CONFIG_DM_SERIAL=y
CONFIG_SOC_DEVICE=y
@@ -81,3 +83,4 @@ CONFIG_SYSRESET=y
CONFIG_SPL_SYSRESET=y
CONFIG_SYSRESET_TI_SCI=y
CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_CMD_REMOTEPROC=y
diff --git a/drivers/remoteproc/ti_k3_dsp_rproc.c b/drivers/remoteproc/ti_k3_dsp_rproc.c
index 57fe103..076b6f2 100644
--- a/drivers/remoteproc/ti_k3_dsp_rproc.c
+++ b/drivers/remoteproc/ti_k3_dsp_rproc.c
@@ -338,7 +338,8 @@ static int k3_dsp_of_get_memories(struct udevice *dev)
for (i = 0; i < dsp->num_mems; i++) {
/* C71 cores only have a L1P Cache, there are no L1P SRAMs */
if (((device_is_compatible(dev, "ti,j721e-c71-dsp")) ||
- (device_is_compatible(dev, "ti,j721s2-c71-dsp"))) &&
+ (device_is_compatible(dev, "ti,j721s2-c71-dsp")) ||
+ (device_is_compatible(dev, "ti,am62a-c7xv-dsp"))) &&
!strcmp(mem_names[i], "l1pram")) {
dsp->mem[i].bus_addr = FDT_ADDR_T_NONE;
dsp->mem[i].dev_addr = FDT_ADDR_T_NONE;
@@ -346,7 +347,14 @@ static int k3_dsp_of_get_memories(struct udevice *dev)
dsp->mem[i].size = 0;
continue;
}
-
+ if (device_is_compatible(dev, "ti,am62a-c7xv-dsp") &&
+ !strcmp(mem_names[i], "l1dram")) {
+ dsp->mem[i].bus_addr = FDT_ADDR_T_NONE;
+ dsp->mem[i].dev_addr = FDT_ADDR_T_NONE;
+ dsp->mem[i].cpu_addr = NULL;
+ dsp->mem[i].size = 0;
+ continue;
+ }
dsp->mem[i].bus_addr = dev_read_addr_size_name(dev, mem_names[i],
(fdt_addr_t *)&dsp->mem[i].size);
if (dsp->mem[i].bus_addr == FDT_ADDR_T_NONE) {
@@ -458,6 +466,7 @@ static const struct udevice_id k3_dsp_ids[] = {
{ .compatible = "ti,j721e-c66-dsp", .data = (ulong)&c66_data, },
{ .compatible = "ti,j721e-c71-dsp", .data = (ulong)&c71_data, },
{ .compatible = "ti,j721s2-c71-dsp", .data = (ulong)&c71_data, },
+ { .compatible = "ti,am62a-c7xv-dsp", .data = (ulong)&c71_data, },
{}
};
diff --git a/drivers/remoteproc/ti_k3_r5f_rproc.c b/drivers/remoteproc/ti_k3_r5f_rproc.c
index b55b1dc..74bf043 100644
--- a/drivers/remoteproc/ti_k3_r5f_rproc.c
+++ b/drivers/remoteproc/ti_k3_r5f_rproc.c
@@ -39,6 +39,8 @@
#define PROC_BOOT_CFG_FLAG_GEN_IGN_BOOTVECTOR 0x10000000
/* Available from J7200 SoCs onwards */
#define PROC_BOOT_CFG_FLAG_R5_MEM_INIT_DIS 0x00004000
+#define PROC_BOOT_CFG_FLAG_R5_SINGLE_CORE 0x00008000
+
/* R5 TI-SCI Processor Control Flags */
#define PROC_BOOT_CTRL_FLAG_R5_CORE_HALT 0x00000001
@@ -54,6 +56,8 @@
enum cluster_mode {
CLUSTER_MODE_SPLIT = 0,
CLUSTER_MODE_LOCKSTEP,
+ CLUSTER_MODE_SINGLECPU,
+ CLUSTER_MODE_SINGLECORE,
};
/**
@@ -64,6 +68,7 @@ enum cluster_mode {
struct k3_r5f_ip_data {
bool tcm_is_double;
bool tcm_ecc_autoinit;
+ bool is_single_core;
};
/**
@@ -598,8 +603,10 @@ static int k3_r5f_rproc_configure(struct k3_r5f_core *core)
/* Sanity check for Lockstep mode */
lockstep_permitted = !!(sts &
PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED);
- if (cluster->mode && is_primary_core(core) && !lockstep_permitted) {
- dev_err(core->dev, "LockStep mode not permitted on this device\n");
+ if (cluster->mode == CLUSTER_MODE_LOCKSTEP && is_primary_core(core) &&
+ !lockstep_permitted) {
+ dev_err(core->dev, "LockStep mode not permitted on this \
+ device\n");
ret = -EINVAL;
goto out;
}
@@ -614,6 +621,9 @@ static int k3_r5f_rproc_configure(struct k3_r5f_core *core)
clr_cfg |= PROC_BOOT_CFG_FLAG_R5_LOCKSTEP;
}
+ if (core->ipdata->is_single_core)
+ set_cfg = PROC_BOOT_CFG_FLAG_R5_SINGLE_CORE;
+
if (core->atcm_enable)
set_cfg |= PROC_BOOT_CFG_FLAG_R5_ATCM_EN;
else
@@ -852,11 +862,19 @@ static int k3_r5f_remove(struct udevice *dev)
static const struct k3_r5f_ip_data k3_data = {
.tcm_is_double = false,
.tcm_ecc_autoinit = false,
+ .is_single_core = false,
};
static const struct k3_r5f_ip_data j7200_j721s2_data = {
.tcm_is_double = true,
.tcm_ecc_autoinit = true,
+ .is_single_core = false,
+};
+
+static const struct k3_r5f_ip_data am62_data = {
+ .tcm_is_double = false,
+ .tcm_ecc_autoinit = false,
+ .is_single_core = true,
};
static const struct udevice_id k3_r5f_rproc_ids[] = {
@@ -864,6 +882,7 @@ static const struct udevice_id k3_r5f_rproc_ids[] = {
{ .compatible = "ti,j721e-r5f", .data = (ulong)&k3_data, },
{ .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, },
{}
};
@@ -886,6 +905,11 @@ static int k3_r5f_cluster_probe(struct udevice *dev)
cluster->mode = dev_read_u32_default(dev, "ti,cluster-mode",
CLUSTER_MODE_LOCKSTEP);
+ if (device_is_compatible(dev, "ti,am62-r5fss")) {
+ cluster->mode = CLUSTER_MODE_SINGLECORE;
+ return 0;
+ }
+
if (device_get_child_count(dev) != 2) {
dev_err(dev, "Invalid number of R5 cores");
return -EINVAL;
@@ -902,6 +926,7 @@ static const struct udevice_id k3_r5fss_ids[] = {
{ .compatible = "ti,j721e-r5fss"},
{ .compatible = "ti,j7200-r5fss"},
{ .compatible = "ti,j721s2-r5fss"},
+ { .compatible = "ti,am62-r5fss"},
{}
};