Lines Matching full:cluster
73 * All cluster mode values are not applicable on all SoCs. The following
102 * struct k3_r5_cluster - K3 R5F Cluster structure
104 * @mode: Mode to configure the Cluster - Split or LockStep
105 * @cores: list of R5 cores within the cluster
152 * @cluster: cached pointer to parent cluster structure
162 struct k3_r5_cluster *cluster; member
282 static int k3_r5_lockstep_reset(struct k3_r5_cluster *cluster) in k3_r5_lockstep_reset() argument
288 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
299 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
312 list_for_each_entry_continue_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
317 core = list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_lockstep_reset()
319 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
327 static int k3_r5_lockstep_release(struct k3_r5_cluster *cluster) in k3_r5_lockstep_release() argument
333 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
345 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
357 list_for_each_entry_continue(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
361 core = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_lockstep_release()
363 list_for_each_entry_from(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
434 * cluster in this mode. The function uses the same reset logic as LockStep
441 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_prepare() local
455 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_prepare()
456 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_rproc_prepare()
457 k3_r5_lockstep_release(cluster) : k3_r5_split_release(core); in k3_r5_rproc_prepare()
470 if (cluster->soc_data->tcm_ecc_autoinit && !mem_init_dis) { in k3_r5_rproc_prepare()
508 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_unprepare() local
514 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_unprepare()
515 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_rproc_unprepare()
516 k3_r5_lockstep_reset(cluster) : k3_r5_split_reset(core); in k3_r5_rproc_unprepare()
543 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_start() local
564 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_start()
565 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_rproc_start()
579 list_for_each_entry_continue(core, &cluster->cores, elem) { in k3_r5_rproc_start()
615 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_stop() local
620 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_stop()
621 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_rproc_stop()
639 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_rproc_stop()
800 * Each R5FSS has a cluster-level setting for configuring the processor
819 * cluster mode. Another eFUSE register bit dictates if the R5F cluster only
820 * supports a Single-CPU mode. All cluster level settings like Cluster mode and
824 * The function behavior is different based on the cluster mode. The R5F cores
834 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_configure() local
844 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_rproc_configure()
845 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_configure()
846 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_rproc_configure()
847 cluster->mode == CLUSTER_MODE_SINGLECORE) { in k3_r5_rproc_configure()
865 if (single_cpu && cluster->mode == CLUSTER_MODE_SPLIT) { in k3_r5_rproc_configure()
866 dev_err(cluster->dev, "split-mode not permitted, force configuring for single-cpu mode\n"); in k3_r5_rproc_configure()
867 cluster->mode = CLUSTER_MODE_SINGLECPU; in k3_r5_rproc_configure()
871 if (!lockstep_en && cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_configure()
872 dev_err(cluster->dev, "lockstep mode not permitted, force configuring for split-mode\n"); in k3_r5_rproc_configure()
873 cluster->mode = CLUSTER_MODE_SPLIT; in k3_r5_rproc_configure()
886 if (cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_rproc_configure()
887 cluster->mode == CLUSTER_MODE_SINGLECORE) { in k3_r5_rproc_configure()
916 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_configure()
922 list_for_each_entry(temp, &cluster->cores, elem) { in k3_r5_rproc_configure()
1072 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_adjust_tcm_sizes() local
1077 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_adjust_tcm_sizes()
1078 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_adjust_tcm_sizes()
1079 cluster->mode == CLUSTER_MODE_SINGLECORE || in k3_r5_adjust_tcm_sizes()
1080 !cluster->soc_data->tcm_is_double) in k3_r5_adjust_tcm_sizes()
1083 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_adjust_tcm_sizes()
1105 * and cluster mode parsed originally from kernel DT are updated to reflect the
1111 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_configure_mode() local
1119 enum cluster_mode mode = cluster->mode; in k3_r5_rproc_configure_mode()
1122 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_rproc_configure_mode()
1193 /* fixup TCMs, cluster & core flags to actual values in IPC-only mode */ in k3_r5_rproc_configure_mode()
1196 cluster->mode = mode; in k3_r5_rproc_configure_mode()
1209 struct k3_r5_cluster *cluster = platform_get_drvdata(pdev); in k3_r5_cluster_rproc_init() local
1218 core1 = list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_cluster_rproc_init()
1219 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_cluster_rproc_init()
1241 kproc->cluster = cluster; in k3_r5_cluster_rproc_init()
1279 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_cluster_rproc_init()
1280 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_cluster_rproc_init()
1281 cluster->mode == CLUSTER_MODE_SINGLECORE) in k3_r5_cluster_rproc_init()
1305 if (cluster->mode == CLUSTER_MODE_SPLIT && core == core1) { in k3_r5_cluster_rproc_init()
1316 struct k3_r5_cluster *cluster = platform_get_drvdata(data); in k3_r5_cluster_rproc_exit() local
1327 core = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_cluster_rproc_exit()
1328 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_cluster_rproc_exit()
1329 list_first_entry(&cluster->cores, struct k3_r5_core, elem) : in k3_r5_cluster_rproc_exit()
1330 list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_cluster_rproc_exit()
1332 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_cluster_rproc_exit()
1639 struct k3_r5_cluster *cluster = platform_get_drvdata(data); in k3_r5_cluster_of_exit() local
1643 list_for_each_entry_safe_reverse(core, temp, &cluster->cores, elem) { in k3_r5_cluster_of_exit()
1652 struct k3_r5_cluster *cluster = platform_get_drvdata(pdev); in k3_r5_cluster_of_init() local
1680 list_add_tail(&core->elem, &cluster->cores); in k3_r5_cluster_of_init()
1694 struct k3_r5_cluster *cluster; in k3_r5_probe() local
1705 cluster = devm_kzalloc(dev, sizeof(*cluster), GFP_KERNEL); in k3_r5_probe()
1706 if (!cluster) in k3_r5_probe()
1709 cluster->dev = dev; in k3_r5_probe()
1710 cluster->soc_data = data; in k3_r5_probe()
1711 INIT_LIST_HEAD(&cluster->cores); in k3_r5_probe()
1713 ret = of_property_read_u32(np, "ti,cluster-mode", &cluster->mode); in k3_r5_probe()
1715 dev_err(dev, "invalid format for ti,cluster-mode, ret = %d\n", in k3_r5_probe()
1730 cluster->mode = data->single_cpu_mode ? in k3_r5_probe()
1733 cluster->mode = CLUSTER_MODE_SINGLECORE; in k3_r5_probe()
1736 if ((cluster->mode == CLUSTER_MODE_SINGLECPU && !data->single_cpu_mode) || in k3_r5_probe()
1737 (cluster->mode == CLUSTER_MODE_SINGLECORE && !data->is_single_core)) { in k3_r5_probe()
1738 dev_err(dev, "Cluster mode = %d is not supported on this SoC\n", cluster->mode); in k3_r5_probe()
1744 dev_err(dev, "MCU cluster requires both R5F cores to be enabled but num_cores is set to = %d\n", in k3_r5_probe()
1755 platform_set_drvdata(pdev, cluster); in k3_r5_probe()