diff options
author | Vincent Donnefort <vdonnefort@gmail.com> | 2015-10-23 06:59:58 -0400 |
---|---|---|
committer | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2015-10-23 11:34:37 -0400 |
commit | 9d2ea95a599a80b08cc802f044626ea2701aade9 (patch) | |
tree | a2b63533bdcf5dea8d9560ef6a38b071ea99bcc5 | |
parent | 4904dbda41c860fd117b20f3c48adb2780eee37e (diff) |
ARM: mvebu: add broken-idle option
The broken-idle option can be activated from the coherency-fabric DT
node. This property allows to disable the idle capability, when the
hardware doesn't support it, like the Seagate Personal Cloud boards.
Signed-off-by: Vincent Donnefort <vdonnefort@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
-rw-r--r-- | Documentation/devicetree/bindings/arm/coherency-fabric.txt | 5 | ||||
-rw-r--r-- | arch/arm/mach-mvebu/pmsu.c | 29 |
2 files changed, 31 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/arm/coherency-fabric.txt b/Documentation/devicetree/bindings/arm/coherency-fabric.txt index 8dd46617c889..9b5c3f620e65 100644 --- a/Documentation/devicetree/bindings/arm/coherency-fabric.txt +++ b/Documentation/devicetree/bindings/arm/coherency-fabric.txt | |||
@@ -27,6 +27,11 @@ Required properties: | |||
27 | * For "marvell,armada-380-coherency-fabric", only one pair is needed | 27 | * For "marvell,armada-380-coherency-fabric", only one pair is needed |
28 | for the per-CPU fabric registers. | 28 | for the per-CPU fabric registers. |
29 | 29 | ||
30 | Optional properties: | ||
31 | |||
32 | - broken-idle: boolean to set when the Idle mode is not supported by the | ||
33 | hardware. | ||
34 | |||
30 | Examples: | 35 | Examples: |
31 | 36 | ||
32 | coherency-fabric@d0020200 { | 37 | coherency-fabric@d0020200 { |
diff --git a/arch/arm/mach-mvebu/pmsu.c b/arch/arm/mach-mvebu/pmsu.c index e8fdb9ceedf0..867ec3385eb5 100644 --- a/arch/arm/mach-mvebu/pmsu.c +++ b/arch/arm/mach-mvebu/pmsu.c | |||
@@ -379,6 +379,16 @@ static struct notifier_block mvebu_v7_cpu_pm_notifier = { | |||
379 | 379 | ||
380 | static struct platform_device mvebu_v7_cpuidle_device; | 380 | static struct platform_device mvebu_v7_cpuidle_device; |
381 | 381 | ||
382 | static int broken_idle(struct device_node *np) | ||
383 | { | ||
384 | if (of_property_read_bool(np, "broken-idle")) { | ||
385 | pr_warn("CPU idle is currently broken: disabling\n"); | ||
386 | return 1; | ||
387 | } | ||
388 | |||
389 | return 0; | ||
390 | } | ||
391 | |||
382 | static __init int armada_370_cpuidle_init(void) | 392 | static __init int armada_370_cpuidle_init(void) |
383 | { | 393 | { |
384 | struct device_node *np; | 394 | struct device_node *np; |
@@ -387,7 +397,9 @@ static __init int armada_370_cpuidle_init(void) | |||
387 | np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); | 397 | np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); |
388 | if (!np) | 398 | if (!np) |
389 | return -ENODEV; | 399 | return -ENODEV; |
390 | of_node_put(np); | 400 | |
401 | if (broken_idle(np)) | ||
402 | goto end; | ||
391 | 403 | ||
392 | /* | 404 | /* |
393 | * On Armada 370, there is "a slow exit process from the deep | 405 | * On Armada 370, there is "a slow exit process from the deep |
@@ -406,6 +418,8 @@ static __init int armada_370_cpuidle_init(void) | |||
406 | mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend; | 418 | mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend; |
407 | mvebu_v7_cpuidle_device.name = "cpuidle-armada-370"; | 419 | mvebu_v7_cpuidle_device.name = "cpuidle-armada-370"; |
408 | 420 | ||
421 | end: | ||
422 | of_node_put(np); | ||
409 | return 0; | 423 | return 0; |
410 | } | 424 | } |
411 | 425 | ||
@@ -422,6 +436,10 @@ static __init int armada_38x_cpuidle_init(void) | |||
422 | "marvell,armada-380-coherency-fabric"); | 436 | "marvell,armada-380-coherency-fabric"); |
423 | if (!np) | 437 | if (!np) |
424 | return -ENODEV; | 438 | return -ENODEV; |
439 | |||
440 | if (broken_idle(np)) | ||
441 | goto end; | ||
442 | |||
425 | of_node_put(np); | 443 | of_node_put(np); |
426 | 444 | ||
427 | np = of_find_compatible_node(NULL, NULL, | 445 | np = of_find_compatible_node(NULL, NULL, |
@@ -430,7 +448,6 @@ static __init int armada_38x_cpuidle_init(void) | |||
430 | return -ENODEV; | 448 | return -ENODEV; |
431 | mpsoc_base = of_iomap(np, 0); | 449 | mpsoc_base = of_iomap(np, 0); |
432 | BUG_ON(!mpsoc_base); | 450 | BUG_ON(!mpsoc_base); |
433 | of_node_put(np); | ||
434 | 451 | ||
435 | /* Set up reset mask when powering down the cpus */ | 452 | /* Set up reset mask when powering down the cpus */ |
436 | reg = readl(mpsoc_base + MPCORE_RESET_CTL); | 453 | reg = readl(mpsoc_base + MPCORE_RESET_CTL); |
@@ -450,6 +467,8 @@ static __init int armada_38x_cpuidle_init(void) | |||
450 | mvebu_v7_cpuidle_device.dev.platform_data = armada_38x_cpu_suspend; | 467 | mvebu_v7_cpuidle_device.dev.platform_data = armada_38x_cpu_suspend; |
451 | mvebu_v7_cpuidle_device.name = "cpuidle-armada-38x"; | 468 | mvebu_v7_cpuidle_device.name = "cpuidle-armada-38x"; |
452 | 469 | ||
470 | end: | ||
471 | of_node_put(np); | ||
453 | return 0; | 472 | return 0; |
454 | } | 473 | } |
455 | 474 | ||
@@ -460,12 +479,16 @@ static __init int armada_xp_cpuidle_init(void) | |||
460 | np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); | 479 | np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); |
461 | if (!np) | 480 | if (!np) |
462 | return -ENODEV; | 481 | return -ENODEV; |
463 | of_node_put(np); | 482 | |
483 | if (broken_idle(np)) | ||
484 | goto end; | ||
464 | 485 | ||
465 | mvebu_cpu_resume = armada_370_xp_cpu_resume; | 486 | mvebu_cpu_resume = armada_370_xp_cpu_resume; |
466 | mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend; | 487 | mvebu_v7_cpuidle_device.dev.platform_data = armada_370_xp_cpu_suspend; |
467 | mvebu_v7_cpuidle_device.name = "cpuidle-armada-xp"; | 488 | mvebu_v7_cpuidle_device.name = "cpuidle-armada-xp"; |
468 | 489 | ||
490 | end: | ||
491 | of_node_put(np); | ||
469 | return 0; | 492 | return 0; |
470 | } | 493 | } |
471 | 494 | ||