diff options
Diffstat (limited to 'drivers/remoteproc')
-rw-r--r-- | drivers/remoteproc/ipu_rproc.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/k3_system_controller.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/pru_rproc.c | 10 | ||||
-rw-r--r-- | drivers/remoteproc/rproc-elf-loader.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/rproc-uclass.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/sandbox_testproc.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/stm32_copro.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/ti_k3_arm64_rproc.c | 1 | ||||
-rw-r--r-- | drivers/remoteproc/ti_k3_dsp_rproc.c | 18 | ||||
-rw-r--r-- | drivers/remoteproc/ti_k3_r5f_rproc.c | 34 | ||||
-rw-r--r-- | drivers/remoteproc/ti_power_proc.c | 1 |
11 files changed, 53 insertions, 17 deletions
diff --git a/drivers/remoteproc/ipu_rproc.c b/drivers/remoteproc/ipu_rproc.c index 996e658e871..2ca78b550a7 100644 --- a/drivers/remoteproc/ipu_rproc.c +++ b/drivers/remoteproc/ipu_rproc.c @@ -8,7 +8,6 @@ * Keerthy <j-keerthy@ti.com> */ -#include <common.h> #include <hang.h> #include <cpu_func.h> #include <dm.h> diff --git a/drivers/remoteproc/k3_system_controller.c b/drivers/remoteproc/k3_system_controller.c index 071de40fbd6..71238a6058a 100644 --- a/drivers/remoteproc/k3_system_controller.c +++ b/drivers/remoteproc/k3_system_controller.c @@ -6,7 +6,6 @@ * Lokesh Vutla <lokeshvutla@ti.com> */ -#include <common.h> #include <dm.h> #include <log.h> #include <remoteproc.h> diff --git a/drivers/remoteproc/pru_rproc.c b/drivers/remoteproc/pru_rproc.c index 6ec55e27d9d..9aec138637b 100644 --- a/drivers/remoteproc/pru_rproc.c +++ b/drivers/remoteproc/pru_rproc.c @@ -6,7 +6,6 @@ * Keerthy <j-keerthy@ti.com> */ -#include <common.h> #include <dm.h> #include <elf.h> #include <dm/of_access.h> @@ -399,10 +398,12 @@ static void pru_set_id(struct pru_privdata *priv, struct udevice *dev) { u32 mask2 = 0x38000; - if (device_is_compatible(dev, "ti,am654-rtu")) + if (device_is_compatible(dev, "ti,am654-rtu") || + device_is_compatible(dev, "ti,am642-rtu")) mask2 = 0x6000; - if (device_is_compatible(dev, "ti,am654-tx-pru")) + if (device_is_compatible(dev, "ti,am654-tx-pru") || + device_is_compatible(dev, "ti,am642-tx-pru")) mask2 = 0xc000; if ((priv->pru_iram & mask2) == mask2) @@ -448,6 +449,9 @@ static const struct udevice_id pru_ids[] = { { .compatible = "ti,am654-pru"}, { .compatible = "ti,am654-rtu"}, { .compatible = "ti,am654-tx-pru" }, + { .compatible = "ti,am642-pru"}, + { .compatible = "ti,am642-rtu"}, + { .compatible = "ti,am642-tx-pru" }, {} }; diff --git a/drivers/remoteproc/rproc-elf-loader.c b/drivers/remoteproc/rproc-elf-loader.c index 5e070e5076e..ab1836b3f07 100644 --- a/drivers/remoteproc/rproc-elf-loader.c +++ b/drivers/remoteproc/rproc-elf-loader.c @@ -2,7 +2,6 @@ /* * Copyright (C) 2019, STMicroelectronics - All Rights Reserved */ -#include <common.h> #include <cpu_func.h> #include <dm.h> #include <elf.h> diff --git a/drivers/remoteproc/rproc-uclass.c b/drivers/remoteproc/rproc-uclass.c index aa7f7586a81..3ba2b40dca3 100644 --- a/drivers/remoteproc/rproc-uclass.c +++ b/drivers/remoteproc/rproc-uclass.c @@ -7,7 +7,6 @@ #define LOG_CATEGORY UCLASS_REMOTEPROC #define pr_fmt(fmt) "%s: " fmt, __func__ -#include <common.h> #include <elf.h> #include <errno.h> #include <log.h> diff --git a/drivers/remoteproc/sandbox_testproc.c b/drivers/remoteproc/sandbox_testproc.c index f76f68ebeb4..ad575a7c10f 100644 --- a/drivers/remoteproc/sandbox_testproc.c +++ b/drivers/remoteproc/sandbox_testproc.c @@ -4,7 +4,6 @@ * Texas Instruments Incorporated - https://www.ti.com/ */ #define pr_fmt(fmt) "%s: " fmt, __func__ -#include <common.h> #include <dm.h> #include <errno.h> #include <log.h> diff --git a/drivers/remoteproc/stm32_copro.c b/drivers/remoteproc/stm32_copro.c index 3e322c4d719..f45da9a68ac 100644 --- a/drivers/remoteproc/stm32_copro.c +++ b/drivers/remoteproc/stm32_copro.c @@ -4,7 +4,6 @@ */ #define LOG_CATEGORY UCLASS_REMOTEPROC -#include <common.h> #include <dm.h> #include <errno.h> #include <fdtdec.h> diff --git a/drivers/remoteproc/ti_k3_arm64_rproc.c b/drivers/remoteproc/ti_k3_arm64_rproc.c index 767493c1383..d3eb957b2e4 100644 --- a/drivers/remoteproc/ti_k3_arm64_rproc.c +++ b/drivers/remoteproc/ti_k3_arm64_rproc.c @@ -7,7 +7,6 @@ * */ -#include <common.h> #include <dm.h> #include <remoteproc.h> #include <errno.h> diff --git a/drivers/remoteproc/ti_k3_dsp_rproc.c b/drivers/remoteproc/ti_k3_dsp_rproc.c index e790406324a..e90f75a188c 100644 --- a/drivers/remoteproc/ti_k3_dsp_rproc.c +++ b/drivers/remoteproc/ti_k3_dsp_rproc.c @@ -7,7 +7,6 @@ * Suman Anna <s-anna@ti.com> */ -#include <common.h> #include <dm.h> #include <log.h> #include <malloc.h> @@ -22,6 +21,7 @@ #include <linux/sizes.h> #include <linux/soc/ti/ti_sci_protocol.h> #include "ti_sci_proc.h" +#include <mach/security.h> #define KEYSTONE_RPROC_LOCAL_ADDRESS_MASK (SZ_16M - 1) @@ -128,6 +128,7 @@ static int k3_dsp_load(struct udevice *dev, ulong addr, ulong size) struct k3_dsp_privdata *dsp = dev_get_priv(dev); struct k3_dsp_boot_data *data = dsp->data; u32 boot_vector; + void *image_addr = (void *)addr; int ret; if (dsp->in_use) { @@ -149,6 +150,8 @@ static int k3_dsp_load(struct udevice *dev, ulong addr, ulong size) goto proc_release; } + ti_secure_image_post_process(&image_addr, &size); + ret = rproc_elf_load_image(dev, addr, size); if (ret < 0) { dev_err(dev, "Loading elf failed %d\n", ret); @@ -339,7 +342,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; @@ -347,7 +351,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) { @@ -459,6 +470,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 631e548dcce..ef2c1872249 100644 --- a/drivers/remoteproc/ti_k3_r5f_rproc.c +++ b/drivers/remoteproc/ti_k3_r5f_rproc.c @@ -7,7 +7,6 @@ * Suman Anna <s-anna@ti.com> */ -#include <common.h> #include <dm.h> #include <log.h> #include <malloc.h> @@ -21,6 +20,7 @@ #include <linux/kernel.h> #include <linux/soc/ti/ti_sci_protocol.h> #include "ti_sci_proc.h" +#include <mach/security.h> /* * R5F's view of this address can either be for ATCM or BTCM with the other @@ -40,6 +40,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 @@ -55,6 +57,8 @@ enum cluster_mode { CLUSTER_MODE_SPLIT = 0, CLUSTER_MODE_LOCKSTEP, + CLUSTER_MODE_SINGLECPU, + CLUSTER_MODE_SINGLECORE, }; /** @@ -65,6 +69,7 @@ enum cluster_mode { struct k3_r5f_ip_data { bool tcm_is_double; bool tcm_ecc_autoinit; + bool is_single_core; }; /** @@ -302,6 +307,7 @@ static int k3_r5f_load(struct udevice *dev, ulong addr, ulong size) u64 boot_vector; u32 ctrl, sts, cfg = 0; bool mem_auto_init; + void *image_addr = (void *)addr; int ret; dev_dbg(dev, "%s addr = 0x%lx, size = 0x%lx\n", __func__, addr, size); @@ -329,6 +335,8 @@ static int k3_r5f_load(struct udevice *dev, ulong addr, ulong size) k3_r5f_init_tcm_memories(core, mem_auto_init); + ti_secure_image_post_process(&image_addr, &size); + ret = rproc_elf_load_image(dev, addr, size); if (ret < 0) { dev_err(dev, "Loading elf failedi %d\n", ret); @@ -599,8 +607,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; } @@ -615,6 +625,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 @@ -853,11 +866,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[] = { @@ -865,6 +886,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, }, {} }; @@ -887,6 +909,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; @@ -903,6 +930,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"}, {} }; diff --git a/drivers/remoteproc/ti_power_proc.c b/drivers/remoteproc/ti_power_proc.c index f55df4a9119..cf150af4ef9 100644 --- a/drivers/remoteproc/ti_power_proc.c +++ b/drivers/remoteproc/ti_power_proc.c @@ -4,7 +4,6 @@ * Texas Instruments Incorporated - https://www.ti.com/ */ #define pr_fmt(fmt) "%s: " fmt, __func__ -#include <common.h> #include <dm.h> #include <errno.h> #include <fdtdec.h> |