mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-25 06:46:00 +00:00
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
This commit is contained in:
commit
85e2c6900e
4 changed files with 45 additions and 4 deletions
|
@ -1,5 +1,8 @@
|
||||||
#include <env/ti/ti_common.env>
|
#include <env/ti/ti_common.env>
|
||||||
#include <env/ti/mmc.env>
|
#include <env/ti/mmc.env>
|
||||||
|
#if CONFIG_CMD_REMOTEPROC
|
||||||
|
#include <env/ti/k3_rproc.env>
|
||||||
|
#endif
|
||||||
|
|
||||||
name_kern=Image
|
name_kern=Image
|
||||||
console=ttyS2,115200n8
|
console=ttyS2,115200n8
|
||||||
|
@ -27,3 +30,4 @@ get_kern_mmc=load mmc ${bootpart} ${loadaddr}
|
||||||
get_fit_mmc=load mmc ${bootpart} ${addr_fit}
|
get_fit_mmc=load mmc ${bootpart} ${addr_fit}
|
||||||
${bootdir}/${name_fit}
|
${bootdir}/${name_fit}
|
||||||
partitions=name=rootfs,start=0,size=-,uuid=${uuid_gpt_rootfs}
|
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
|
||||||
|
|
|
@ -72,6 +72,8 @@ CONFIG_POWER_DOMAIN=y
|
||||||
CONFIG_TI_SCI_POWER_DOMAIN=y
|
CONFIG_TI_SCI_POWER_DOMAIN=y
|
||||||
CONFIG_K3_SYSTEM_CONTROLLER=y
|
CONFIG_K3_SYSTEM_CONTROLLER=y
|
||||||
CONFIG_REMOTEPROC_TI_K3_ARM64=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_RESET_TI_SCI=y
|
||||||
CONFIG_DM_SERIAL=y
|
CONFIG_DM_SERIAL=y
|
||||||
CONFIG_SOC_DEVICE=y
|
CONFIG_SOC_DEVICE=y
|
||||||
|
@ -81,3 +83,4 @@ CONFIG_SYSRESET=y
|
||||||
CONFIG_SPL_SYSRESET=y
|
CONFIG_SPL_SYSRESET=y
|
||||||
CONFIG_SYSRESET_TI_SCI=y
|
CONFIG_SYSRESET_TI_SCI=y
|
||||||
CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
|
CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
|
||||||
|
CONFIG_CMD_REMOTEPROC=y
|
||||||
|
|
|
@ -338,7 +338,8 @@ static int k3_dsp_of_get_memories(struct udevice *dev)
|
||||||
for (i = 0; i < dsp->num_mems; i++) {
|
for (i = 0; i < dsp->num_mems; i++) {
|
||||||
/* C71 cores only have a L1P Cache, there are no L1P SRAMs */
|
/* C71 cores only have a L1P Cache, there are no L1P SRAMs */
|
||||||
if (((device_is_compatible(dev, "ti,j721e-c71-dsp")) ||
|
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")) {
|
!strcmp(mem_names[i], "l1pram")) {
|
||||||
dsp->mem[i].bus_addr = FDT_ADDR_T_NONE;
|
dsp->mem[i].bus_addr = FDT_ADDR_T_NONE;
|
||||||
dsp->mem[i].dev_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;
|
dsp->mem[i].size = 0;
|
||||||
continue;
|
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],
|
dsp->mem[i].bus_addr = dev_read_addr_size_name(dev, mem_names[i],
|
||||||
(fdt_addr_t *)&dsp->mem[i].size);
|
(fdt_addr_t *)&dsp->mem[i].size);
|
||||||
if (dsp->mem[i].bus_addr == FDT_ADDR_T_NONE) {
|
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-c66-dsp", .data = (ulong)&c66_data, },
|
||||||
{ .compatible = "ti,j721e-c71-dsp", .data = (ulong)&c71_data, },
|
{ .compatible = "ti,j721e-c71-dsp", .data = (ulong)&c71_data, },
|
||||||
{ .compatible = "ti,j721s2-c71-dsp", .data = (ulong)&c71_data, },
|
{ .compatible = "ti,j721s2-c71-dsp", .data = (ulong)&c71_data, },
|
||||||
|
{ .compatible = "ti,am62a-c7xv-dsp", .data = (ulong)&c71_data, },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
#define PROC_BOOT_CFG_FLAG_GEN_IGN_BOOTVECTOR 0x10000000
|
#define PROC_BOOT_CFG_FLAG_GEN_IGN_BOOTVECTOR 0x10000000
|
||||||
/* Available from J7200 SoCs onwards */
|
/* Available from J7200 SoCs onwards */
|
||||||
#define PROC_BOOT_CFG_FLAG_R5_MEM_INIT_DIS 0x00004000
|
#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 */
|
/* R5 TI-SCI Processor Control Flags */
|
||||||
#define PROC_BOOT_CTRL_FLAG_R5_CORE_HALT 0x00000001
|
#define PROC_BOOT_CTRL_FLAG_R5_CORE_HALT 0x00000001
|
||||||
|
@ -54,6 +56,8 @@
|
||||||
enum cluster_mode {
|
enum cluster_mode {
|
||||||
CLUSTER_MODE_SPLIT = 0,
|
CLUSTER_MODE_SPLIT = 0,
|
||||||
CLUSTER_MODE_LOCKSTEP,
|
CLUSTER_MODE_LOCKSTEP,
|
||||||
|
CLUSTER_MODE_SINGLECPU,
|
||||||
|
CLUSTER_MODE_SINGLECORE,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -64,6 +68,7 @@ enum cluster_mode {
|
||||||
struct k3_r5f_ip_data {
|
struct k3_r5f_ip_data {
|
||||||
bool tcm_is_double;
|
bool tcm_is_double;
|
||||||
bool tcm_ecc_autoinit;
|
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 */
|
/* Sanity check for Lockstep mode */
|
||||||
lockstep_permitted = !!(sts &
|
lockstep_permitted = !!(sts &
|
||||||
PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED);
|
PROC_BOOT_STATUS_FLAG_R5_LOCKSTEP_PERMITTED);
|
||||||
if (cluster->mode && is_primary_core(core) && !lockstep_permitted) {
|
if (cluster->mode == CLUSTER_MODE_LOCKSTEP && is_primary_core(core) &&
|
||||||
dev_err(core->dev, "LockStep mode not permitted on this device\n");
|
!lockstep_permitted) {
|
||||||
|
dev_err(core->dev, "LockStep mode not permitted on this \
|
||||||
|
device\n");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto out;
|
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;
|
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)
|
if (core->atcm_enable)
|
||||||
set_cfg |= PROC_BOOT_CFG_FLAG_R5_ATCM_EN;
|
set_cfg |= PROC_BOOT_CFG_FLAG_R5_ATCM_EN;
|
||||||
else
|
else
|
||||||
|
@ -852,11 +862,19 @@ static int k3_r5f_remove(struct udevice *dev)
|
||||||
static const struct k3_r5f_ip_data k3_data = {
|
static const struct k3_r5f_ip_data k3_data = {
|
||||||
.tcm_is_double = false,
|
.tcm_is_double = false,
|
||||||
.tcm_ecc_autoinit = false,
|
.tcm_ecc_autoinit = false,
|
||||||
|
.is_single_core = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct k3_r5f_ip_data j7200_j721s2_data = {
|
static const struct k3_r5f_ip_data j7200_j721s2_data = {
|
||||||
.tcm_is_double = true,
|
.tcm_is_double = true,
|
||||||
.tcm_ecc_autoinit = 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[] = {
|
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,j721e-r5f", .data = (ulong)&k3_data, },
|
||||||
{ .compatible = "ti,j7200-r5f", .data = (ulong)&j7200_j721s2_data, },
|
{ .compatible = "ti,j7200-r5f", .data = (ulong)&j7200_j721s2_data, },
|
||||||
{ .compatible = "ti,j721s2-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 = dev_read_u32_default(dev, "ti,cluster-mode",
|
||||||
CLUSTER_MODE_LOCKSTEP);
|
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) {
|
if (device_get_child_count(dev) != 2) {
|
||||||
dev_err(dev, "Invalid number of R5 cores");
|
dev_err(dev, "Invalid number of R5 cores");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -902,6 +926,7 @@ static const struct udevice_id k3_r5fss_ids[] = {
|
||||||
{ .compatible = "ti,j721e-r5fss"},
|
{ .compatible = "ti,j721e-r5fss"},
|
||||||
{ .compatible = "ti,j7200-r5fss"},
|
{ .compatible = "ti,j7200-r5fss"},
|
||||||
{ .compatible = "ti,j721s2-r5fss"},
|
{ .compatible = "ti,j721s2-r5fss"},
|
||||||
|
{ .compatible = "ti,am62-r5fss"},
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue