-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'actions-arm-soc+sps-for-4.13' of git://git.kernel.org/pub/…
…scm/linux/kernel/git/afaerber/linux-actions into next/soc Pull "Actions Semi ARM SoC for v4.13 #2" from Andreas Färber: This adds SMP code to bring up the remaining S500 CPU cores by reusing a helper factored out of the SPS power domains driver. * tag 'actions-arm-soc+sps-for-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/afaerber/linux-actions: ARM: owl: smp: Implement SPS power-gating for CPU2 and CPU3 soc: actions: owl-sps: Factor out owl_sps_set_pg() for power-gating soc: actions: Add Owl SPS dt-bindings: power: Add Owl SPS power domains
- Loading branch information
Showing
11 changed files
with
377 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
Documentation/devicetree/bindings/power/actions,owl-sps.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Actions Semi Owl Smart Power System (SPS) | ||
|
||
Required properties: | ||
- compatible : "actions,s500-sps" for S500 | ||
- reg : Offset and length of the register set for the device. | ||
- #power-domain-cells : Must be 1. | ||
See macros in: | ||
include/dt-bindings/power/owl-s500-powergate.h for S500 | ||
|
||
|
||
Example: | ||
|
||
sps: power-controller@b01b0100 { | ||
compatible = "actions,s500-sps"; | ||
reg = <0xb01b0100 0x100>; | ||
#power-domain-cells = <1>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
if ARCH_ACTIONS || COMPILE_TEST | ||
|
||
config OWL_PM_DOMAINS_HELPER | ||
bool | ||
|
||
config OWL_PM_DOMAINS | ||
bool "Actions Semi SPS power domains" | ||
depends on PM | ||
select OWL_PM_DOMAINS_HELPER | ||
select PM_GENERIC_DOMAINS | ||
help | ||
Say 'y' here to enable support for Smart Power System (SPS) | ||
power-gating on Actions Semiconductor S500 SoC. | ||
If unsure, say 'n'. | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
obj-$(CONFIG_OWL_PM_DOMAINS_HELPER) += owl-sps-helper.o | ||
obj-$(CONFIG_OWL_PM_DOMAINS) += owl-sps.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Actions Semi Owl Smart Power System (SPS) shared helpers | ||
* | ||
* Copyright 2012 Actions Semi Inc. | ||
* Author: Actions Semi, Inc. | ||
* | ||
* Copyright (c) 2017 Andreas Färber | ||
* | ||
* This program is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at your | ||
* option) any later version. | ||
*/ | ||
|
||
#include <linux/delay.h> | ||
#include <linux/io.h> | ||
|
||
#define OWL_SPS_PG_CTL 0x0 | ||
|
||
int owl_sps_set_pg(void __iomem *base, u32 pwr_mask, u32 ack_mask, bool enable) | ||
{ | ||
u32 val; | ||
bool ack; | ||
int timeout; | ||
|
||
val = readl(base + OWL_SPS_PG_CTL); | ||
ack = val & ack_mask; | ||
if (ack == enable) | ||
return 0; | ||
|
||
if (enable) | ||
val |= pwr_mask; | ||
else | ||
val &= ~pwr_mask; | ||
|
||
writel(val, base + OWL_SPS_PG_CTL); | ||
|
||
for (timeout = 5000; timeout > 0; timeout -= 50) { | ||
val = readl(base + OWL_SPS_PG_CTL); | ||
if ((val & ack_mask) == (enable ? ack_mask : 0)) | ||
break; | ||
udelay(50); | ||
} | ||
if (timeout <= 0) | ||
return -ETIMEDOUT; | ||
|
||
udelay(10); | ||
|
||
return 0; | ||
} | ||
EXPORT_SYMBOL_GPL(owl_sps_set_pg); |
Oops, something went wrong.