Lines Matching full:cluster
72 * All cluster mode values are not applicable on all SoCs. The following
97 * struct k3_r5_cluster - K3 R5F Cluster structure
99 * @mode: Mode to configure the Cluster - Split or LockStep
100 * @cores: list of R5 cores within the cluster
147 * @cluster: cached pointer to parent cluster structure
157 struct k3_r5_cluster *cluster; member
277 static int k3_r5_lockstep_reset(struct k3_r5_cluster *cluster) in k3_r5_lockstep_reset() argument
283 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
294 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
307 list_for_each_entry_continue_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
312 core = list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_lockstep_reset()
314 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
322 static int k3_r5_lockstep_release(struct k3_r5_cluster *cluster) in k3_r5_lockstep_release() argument
328 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
340 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
352 list_for_each_entry_continue(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
356 core = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_lockstep_release()
358 list_for_each_entry_from(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
429 * cluster in this mode. The function uses the same reset logic as LockStep
436 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_prepare() local
450 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_prepare()
451 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_rproc_prepare()
452 k3_r5_lockstep_release(cluster) : k3_r5_split_release(core); in k3_r5_rproc_prepare()
465 if (cluster->soc_data->tcm_ecc_autoinit && !mem_init_dis) { in k3_r5_rproc_prepare()
503 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_unprepare() local
509 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_unprepare()
510 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_rproc_unprepare()
511 k3_r5_lockstep_reset(cluster) : k3_r5_split_reset(core); in k3_r5_rproc_unprepare()
538 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_start() local
559 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_start()
560 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_rproc_start()
574 list_for_each_entry_continue(core, &cluster->cores, elem) { in k3_r5_rproc_start()
610 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_stop() local
615 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_stop()
616 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_rproc_stop()
634 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_rproc_stop()
795 * Each R5FSS has a cluster-level setting for configuring the processor
814 * cluster mode. Another eFUSE register bit dictates if the R5F cluster only
815 * supports a Single-CPU mode. All cluster level settings like Cluster mode and
819 * The function behavior is different based on the cluster mode. The R5F cores
829 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_configure() local
839 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_rproc_configure()
840 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_configure()
841 cluster->mode == CLUSTER_MODE_SINGLECPU) { in k3_r5_rproc_configure()
856 if (cluster->soc_data->single_cpu_mode) { in k3_r5_rproc_configure()
859 if (single_cpu && cluster->mode == CLUSTER_MODE_SPLIT) { in k3_r5_rproc_configure()
860 dev_err(cluster->dev, "split-mode not permitted, force configuring for single-cpu mode\n"); in k3_r5_rproc_configure()
861 cluster->mode = CLUSTER_MODE_SINGLECPU; in k3_r5_rproc_configure()
868 if (!lockstep_en && cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_configure()
869 dev_err(cluster->dev, "lockstep mode not permitted, force configuring for split-mode\n"); in k3_r5_rproc_configure()
870 cluster->mode = CLUSTER_MODE_SPLIT; in k3_r5_rproc_configure()
878 if (cluster->soc_data->single_cpu_mode) { in k3_r5_rproc_configure()
885 if (cluster->mode == CLUSTER_MODE_SINGLECPU) in k3_r5_rproc_configure()
914 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_configure()
920 list_for_each_entry(temp, &cluster->cores, elem) { in k3_r5_rproc_configure()
1070 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_adjust_tcm_sizes() local
1075 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_adjust_tcm_sizes()
1076 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_adjust_tcm_sizes()
1077 !cluster->soc_data->tcm_is_double) in k3_r5_adjust_tcm_sizes()
1080 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_adjust_tcm_sizes()
1102 * and cluster mode parsed originally from kernel DT are updated to reflect the
1108 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_configure_mode() local
1119 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_rproc_configure_mode()
1150 if (cluster->soc_data->single_cpu_mode) { in k3_r5_rproc_configure_mode()
1189 /* fixup TCMs, cluster & core flags to actual values in IPC-only mode */ in k3_r5_rproc_configure_mode()
1192 cluster->mode = mode; in k3_r5_rproc_configure_mode()
1205 struct k3_r5_cluster *cluster = platform_get_drvdata(pdev); in k3_r5_cluster_rproc_init() local
1214 core1 = list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_cluster_rproc_init()
1215 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_cluster_rproc_init()
1237 kproc->cluster = cluster; in k3_r5_cluster_rproc_init()
1273 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_cluster_rproc_init()
1274 cluster->mode == CLUSTER_MODE_SINGLECPU) in k3_r5_cluster_rproc_init()
1298 if (cluster->mode == CLUSTER_MODE_SPLIT && core == core1) { in k3_r5_cluster_rproc_init()
1309 struct k3_r5_cluster *cluster = platform_get_drvdata(data); in k3_r5_cluster_rproc_exit() local
1320 core = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_cluster_rproc_exit()
1321 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_cluster_rproc_exit()
1322 list_first_entry(&cluster->cores, struct k3_r5_core, elem) : in k3_r5_cluster_rproc_exit()
1323 list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_cluster_rproc_exit()
1325 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_cluster_rproc_exit()
1632 struct k3_r5_cluster *cluster = platform_get_drvdata(data); in k3_r5_cluster_of_exit() local
1636 list_for_each_entry_safe_reverse(core, temp, &cluster->cores, elem) { in k3_r5_cluster_of_exit()
1645 struct k3_r5_cluster *cluster = platform_get_drvdata(pdev); in k3_r5_cluster_of_init() local
1673 list_add_tail(&core->elem, &cluster->cores); in k3_r5_cluster_of_init()
1687 struct k3_r5_cluster *cluster; in k3_r5_probe() local
1698 cluster = devm_kzalloc(dev, sizeof(*cluster), GFP_KERNEL); in k3_r5_probe()
1699 if (!cluster) in k3_r5_probe()
1702 cluster->dev = dev; in k3_r5_probe()
1707 cluster->mode = data->single_cpu_mode ? in k3_r5_probe()
1709 cluster->soc_data = data; in k3_r5_probe()
1710 INIT_LIST_HEAD(&cluster->cores); in k3_r5_probe()
1712 ret = of_property_read_u32(np, "ti,cluster-mode", &cluster->mode); in k3_r5_probe()
1714 dev_err(dev, "invalid format for ti,cluster-mode, ret = %d\n", in k3_r5_probe()
1721 dev_err(dev, "MCU cluster requires both R5F cores to be enabled, num_cores = %d\n", in k3_r5_probe()
1726 platform_set_drvdata(pdev, cluster); in k3_r5_probe()