]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
remoteproc: k3-r5: Add support for single cpu mode
authorHari Nagalla <hnagalla@ti.com>
Wed, 13 Aug 2025 21:47:05 +0000 (16:47 -0500)
committerTom Rini <trini@konsulko.com>
Thu, 21 Aug 2025 16:02:52 +0000 (10:02 -0600)
Add early boot support for AM64 single cpu mode configuration.
In single CPU mode the 2nd core of the R5F cluster can't be used or
unavailable.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
drivers/remoteproc/ti_k3_r5f_rproc.c

index 3a25ef6bf8780c1b48109e62bb7750b89fe306ea..48401bc6eb67b0d0bf673b8db033f9165353e495 100644 (file)
@@ -233,7 +233,7 @@ static int k3_r5f_prepare(struct udevice *dev)
 
        dev_dbg(dev, "%s\n", __func__);
 
-       if (cluster->mode == CLUSTER_MODE_LOCKSTEP)
+       if ((cluster->mode == CLUSTER_MODE_LOCKSTEP) || (cluster->mode == CLUSTER_MODE_SINGLECPU))
                ret = k3_r5f_lockstep_release(cluster);
        else
                ret = k3_r5f_split_release(core);
@@ -269,6 +269,13 @@ static int k3_r5f_core_sanity_check(struct k3_r5f_core *core)
                return -EINVAL;
        }
 
+       if (cluster->mode == CLUSTER_MODE_SINGLECPU && !is_primary_core(core)) {
+               dev_err(core->dev,
+                       "Invalid op: Trying to start secondary core %d in single CPU mode\n",
+                       core->tsp.proc_id);
+               return -EINVAL;
+       }
+
        if (cluster->mode == CLUSTER_MODE_SPLIT && !is_primary_core(core)) {
                if (!core->cluster->cores[0]->in_use) {
                        dev_err(core->dev,
@@ -768,7 +775,7 @@ static void k3_r5f_core_adjust_tcm_sizes(struct k3_r5f_core *core)
 {
        struct k3_r5f_cluster *cluster = core->cluster;
 
-       if (cluster->mode == CLUSTER_MODE_LOCKSTEP)
+       if ((cluster->mode == CLUSTER_MODE_LOCKSTEP) || (cluster->mode == CLUSTER_MODE_SINGLECPU))
                return;
 
        if (!core->ipdata->tcm_is_double)