Skip to content

Commit 82a4277

Browse files
tnmyshmathieupoirier
authored andcommitted
remoteproc: xlnx: Allow single core use in split mode
When operating in split mode, it is a valid usecase to have only one core enabled in the cluster. Remove exact core count expecatation from the driver. Signed-off-by: Tanmay Shah <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mathieu Poirier <[email protected]>
1 parent f6588de commit 82a4277

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

drivers/remoteproc/xlnx_r5_remoteproc.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,19 +1329,23 @@ static int zynqmp_r5_cluster_init(struct zynqmp_r5_cluster *cluster)
13291329

13301330
/*
13311331
* Number of cores is decided by number of child nodes of
1332-
* r5f subsystem node in dts. If Split mode is used in dts
1333-
* 2 child nodes are expected.
1332+
* r5f subsystem node in dts.
1333+
* In split mode maximum two child nodes are expected.
1334+
* However, only single core can be enabled too.
1335+
* Driver can handle following configuration in split mode:
1336+
* 1) core0 enabled, core1 disabled
1337+
* 2) core0 disabled, core1 enabled
1338+
* 3) core0 and core1 both are enabled.
1339+
* For now, no more than two cores are expected per cluster
1340+
* in split mode.
13341341
* In lockstep mode if two child nodes are available,
13351342
* only use first child node and consider it as core0
13361343
* and ignore core1 dt node.
13371344
*/
13381345
core_count = of_get_available_child_count(dev_node);
1339-
if (core_count == 0) {
1346+
if (core_count == 0 || core_count > 2) {
13401347
dev_err(dev, "Invalid number of r5 cores %d", core_count);
13411348
return -EINVAL;
1342-
} else if (cluster_mode == SPLIT_MODE && core_count != 2) {
1343-
dev_err(dev, "Invalid number of r5 cores for split mode\n");
1344-
return -EINVAL;
13451349
} else if (cluster_mode == LOCKSTEP_MODE && core_count == 2) {
13461350
dev_warn(dev, "Only r5 core0 will be used\n");
13471351
core_count = 1;

0 commit comments

Comments
 (0)