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
156 * @cluster: cached pointer to parent cluster structure
166 struct k3_r5_cluster *cluster; member
294 static int k3_r5_lockstep_reset(struct k3_r5_cluster *cluster) in k3_r5_lockstep_reset() argument
300 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
311 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
324 list_for_each_entry_continue_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
329 core = list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_lockstep_reset()
331 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_reset()
339 static int k3_r5_lockstep_release(struct k3_r5_cluster *cluster) in k3_r5_lockstep_release() argument
345 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
357 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
369 list_for_each_entry_continue(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
373 core = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_lockstep_release()
375 list_for_each_entry_from(core, &cluster->cores, elem) { in k3_r5_lockstep_release()
443 * cluster in this mode. The function uses the same reset logic as LockStep
450 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_prepare() local
464 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_prepare()
465 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_rproc_prepare()
466 k3_r5_lockstep_release(cluster) : k3_r5_split_release(core); in k3_r5_rproc_prepare()
479 if (cluster->soc_data->tcm_ecc_autoinit && !mem_init_dis) { in k3_r5_rproc_prepare()
517 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_unprepare() local
523 ret = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_unprepare()
524 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_rproc_unprepare()
525 k3_r5_lockstep_reset(cluster) : k3_r5_split_reset(core); in k3_r5_rproc_unprepare()
552 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_start() local
569 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_start()
570 list_for_each_entry_reverse(core, &cluster->cores, elem) { in k3_r5_rproc_start()
577 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, in k3_r5_rproc_start()
590 wake_up_interruptible(&cluster->core_transition); in k3_r5_rproc_start()
596 list_for_each_entry_continue(core, &cluster->cores, elem) { in k3_r5_rproc_start()
630 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_stop() local
636 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_stop()
637 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_rproc_stop()
646 core1 = list_last_entry(&cluster->cores, struct k3_r5_core, in k3_r5_rproc_stop()
663 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_rproc_stop()
804 * Each R5FSS has a cluster-level setting for configuring the processor
823 * cluster mode. Another eFUSE register bit dictates if the R5F cluster only
824 * supports a Single-CPU mode. All cluster level settings like Cluster mode and
828 * The function behavior is different based on the cluster mode. The R5F cores
838 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_configure() local
848 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_rproc_configure()
849 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_rproc_configure()
850 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_rproc_configure()
851 cluster->mode == CLUSTER_MODE_SINGLECORE) { in k3_r5_rproc_configure()
869 if (single_cpu && cluster->mode == CLUSTER_MODE_SPLIT) { in k3_r5_rproc_configure()
870 dev_err(cluster->dev, "split-mode not permitted, force configuring for single-cpu mode\n"); in k3_r5_rproc_configure()
871 cluster->mode = CLUSTER_MODE_SINGLECPU; in k3_r5_rproc_configure()
875 if (!lockstep_en && cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_configure()
876 dev_err(cluster->dev, "lockstep mode not permitted, force configuring for split-mode\n"); in k3_r5_rproc_configure()
877 cluster->mode = CLUSTER_MODE_SPLIT; in k3_r5_rproc_configure()
890 if (cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_rproc_configure()
891 cluster->mode == CLUSTER_MODE_SINGLECORE) { in k3_r5_rproc_configure()
920 if (cluster->mode == CLUSTER_MODE_LOCKSTEP) { in k3_r5_rproc_configure()
926 list_for_each_entry(temp, &cluster->cores, elem) { in k3_r5_rproc_configure()
1076 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_adjust_tcm_sizes() local
1081 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_adjust_tcm_sizes()
1082 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_adjust_tcm_sizes()
1083 cluster->mode == CLUSTER_MODE_SINGLECORE || in k3_r5_adjust_tcm_sizes()
1084 !cluster->soc_data->tcm_is_double) in k3_r5_adjust_tcm_sizes()
1087 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_adjust_tcm_sizes()
1109 * and cluster mode parsed originally from kernel DT are updated to reflect the
1115 struct k3_r5_cluster *cluster = kproc->cluster; in k3_r5_rproc_configure_mode() local
1123 enum cluster_mode mode = cluster->mode; in k3_r5_rproc_configure_mode()
1127 core0 = list_first_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_rproc_configure_mode()
1204 /* fixup TCMs, cluster & core flags to actual values in IPC-only mode */ in k3_r5_rproc_configure_mode()
1207 cluster->mode = mode; in k3_r5_rproc_configure_mode()
1220 struct k3_r5_cluster *cluster = platform_get_drvdata(pdev); in k3_r5_cluster_rproc_init() local
1229 core1 = list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_cluster_rproc_init()
1230 list_for_each_entry(core, &cluster->cores, elem) { in k3_r5_cluster_rproc_init()
1252 kproc->cluster = cluster; in k3_r5_cluster_rproc_init()
1294 if (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_cluster_rproc_init()
1295 cluster->mode == CLUSTER_MODE_SINGLECPU || in k3_r5_cluster_rproc_init()
1296 cluster->mode == CLUSTER_MODE_SINGLECORE) in k3_r5_cluster_rproc_init()
1301 * should be in higher power state than core1 in a cluster in k3_r5_cluster_rproc_init()
1309 ret = wait_event_interruptible_timeout(cluster->core_transition, in k3_r5_cluster_rproc_init()
1338 if (cluster->mode == CLUSTER_MODE_SPLIT && core == core1) { in k3_r5_cluster_rproc_init()
1349 struct k3_r5_cluster *cluster = platform_get_drvdata(data); in k3_r5_cluster_rproc_exit() local
1360 core = (cluster->mode == CLUSTER_MODE_LOCKSTEP || in k3_r5_cluster_rproc_exit()
1361 cluster->mode == CLUSTER_MODE_SINGLECPU) ? in k3_r5_cluster_rproc_exit()
1362 list_first_entry(&cluster->cores, struct k3_r5_core, elem) : in k3_r5_cluster_rproc_exit()
1363 list_last_entry(&cluster->cores, struct k3_r5_core, elem); in k3_r5_cluster_rproc_exit()
1365 list_for_each_entry_from_reverse(core, &cluster->cores, elem) { in k3_r5_cluster_rproc_exit()
1645 struct k3_r5_cluster *cluster = platform_get_drvdata(data); in k3_r5_cluster_of_exit() local
1649 list_for_each_entry_safe_reverse(core, temp, &cluster->cores, elem) { in k3_r5_cluster_of_exit()
1658 struct k3_r5_cluster *cluster = platform_get_drvdata(pdev); in k3_r5_cluster_of_init() local
1686 list_add_tail(&core->elem, &cluster->cores); in k3_r5_cluster_of_init()
1700 struct k3_r5_cluster *cluster; in k3_r5_probe() local
1711 cluster = devm_kzalloc(dev, sizeof(*cluster), GFP_KERNEL); in k3_r5_probe()
1712 if (!cluster) in k3_r5_probe()
1715 cluster->dev = dev; in k3_r5_probe()
1716 cluster->soc_data = data; in k3_r5_probe()
1717 INIT_LIST_HEAD(&cluster->cores); in k3_r5_probe()
1718 init_waitqueue_head(&cluster->core_transition); in k3_r5_probe()
1720 ret = of_property_read_u32(np, "ti,cluster-mode", &cluster->mode); in k3_r5_probe()
1722 dev_err(dev, "invalid format for ti,cluster-mode, ret = %d\n", in k3_r5_probe()
1737 cluster->mode = data->single_cpu_mode ? in k3_r5_probe()
1740 cluster->mode = CLUSTER_MODE_SINGLECORE; in k3_r5_probe()
1743 if ((cluster->mode == CLUSTER_MODE_SINGLECPU && !data->single_cpu_mode) || in k3_r5_probe()
1744 (cluster->mode == CLUSTER_MODE_SINGLECORE && !data->is_single_core)) { in k3_r5_probe()
1745 dev_err(dev, "Cluster mode = %d is not supported on this SoC\n", cluster->mode); in k3_r5_probe()
1751 dev_err(dev, "MCU cluster requires both R5F cores to be enabled but num_cores is set to = %d\n", in k3_r5_probe()
1762 platform_set_drvdata(pdev, cluster); in k3_r5_probe()