From: Aleksandar Markovic <[email protected]>
v2->v3:
- changed documentation file location from
devicetree/bindings/misc to devicetree/bindings/power
- minor commit message improvements
- rebased to the latest code
v1->v2:
- corrected wording in commit messages and documentation text
- expanded cover letter to better explain the context of proposed
changes
- rebased to the latest code
This series is based on two patches from the larger series submitted
some time ago (30 Aug 2016):
https://www.linux-mips.org/archives/linux-mips/2016-08/msg00456.html
Both patches deal with MIPS Cluster Power Controller (CPC) support.
More specifically, they add device tree related functionalities to
that support.
This functionality is needed for further development of kernel support
for generic-based MIPS platforms that must be DT-based and will at the
same time make more extensive use of CPC.
This series is reviewed by the original author of the above-mentioned
larger series:
Reviewed-by: Paul Burton <[email protected]>
Paul Burton (2):
dt-bindings: Document mti,mips-cpc binding
MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base()
Documentation/devicetree/bindings/power/mti,mips-cpc.txt | 8 ++++++++
arch/mips/kernel/mips-cpc.c | 13 +++++++++++++
2 files changed, 21 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/mti,mips-cpc.txt
--
2.7.4
From: Paul Burton <[email protected]>
Document a binding for the MIPS Cluster Power Controller (CPC) that
allows the device tree to specify where the CPC registers are located.
Signed-off-by: Paul Burton <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
---
Documentation/devicetree/bindings/power/mti,mips-cpc.txt | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 Documentation/devicetree/bindings/power/mti,mips-cpc.txt
diff --git a/Documentation/devicetree/bindings/power/mti,mips-cpc.txt b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
new file mode 100644
index 0000000..c6b8251
--- /dev/null
+++ b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
@@ -0,0 +1,8 @@
+Binding for MIPS Cluster Power Controller (CPC).
+
+This binding allows a system to specify where the CPC registers are
+located.
+
+Required properties:
+compatible : Should be "mti,mips-cpc".
+regs: Should describe the address & size of the CPC register region.
--
2.7.4
From: Paul Burton <[email protected]>
Reading mips_cpc_base value from the DT allows each platform to
define it according to its needs. This is especially convenient
for MIPS_GENERIC kernel where this kind of information should be
determined in runtime.
Use mti,mips-cpc compatible string with just a reg property to
specify the register location for your platform.
Signed-off-by: Paul Burton <[email protected]>
Signed-off-by: Miodrag Dinic <[email protected]>
Signed-off-by: Aleksandar Markovic <[email protected]>
---
arch/mips/kernel/mips-cpc.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/mips/kernel/mips-cpc.c b/arch/mips/kernel/mips-cpc.c
index 19c88d7..fcf9af4 100644
--- a/arch/mips/kernel/mips-cpc.c
+++ b/arch/mips/kernel/mips-cpc.c
@@ -10,6 +10,8 @@
#include <linux/errno.h>
#include <linux/percpu.h>
+#include <linux/of.h>
+#include <linux/of_address.h>
#include <linux/spinlock.h>
#include <asm/mips-cps.h>
@@ -22,6 +24,17 @@ static DEFINE_PER_CPU_ALIGNED(unsigned long, cpc_core_lock_flags);
phys_addr_t __weak mips_cpc_default_phys_base(void)
{
+ struct device_node *cpc_node;
+ struct resource res;
+ int err;
+
+ cpc_node = of_find_compatible_node(of_root, NULL, "mti,mips-cpc");
+ if (cpc_node) {
+ err = of_address_to_resource(cpc_node, 0, &res);
+ if (!err)
+ return res.start;
+ }
+
return 0;
}
--
2.7.4
On Wed, Dec 27, 2017 at 03:37:51PM +0100, Aleksandar Markovic wrote:
> From: Paul Burton <[email protected]>
>
> Document a binding for the MIPS Cluster Power Controller (CPC) that
> allows the device tree to specify where the CPC registers are located.
>
> Signed-off-by: Paul Burton <[email protected]>
> Signed-off-by: Aleksandar Markovic <[email protected]>
> ---
> Documentation/devicetree/bindings/power/mti,mips-cpc.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/power/mti,mips-cpc.txt
Reviewed-by: Rob Herring <[email protected]>
On Wed, Dec 27, 2017 at 03:37:51PM +0100, Aleksandar Markovic wrote:
> From: Paul Burton <[email protected]>
>
> Document a binding for the MIPS Cluster Power Controller (CPC) that
> allows the device tree to specify where the CPC registers are located.
>
> Signed-off-by: Paul Burton <[email protected]>
> Signed-off-by: Aleksandar Markovic <[email protected]>
> ---
> Documentation/devicetree/bindings/power/mti,mips-cpc.txt | 8 ++++++++
> 1 file changed, 8 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/power/mti,mips-cpc.txt
>
> diff --git a/Documentation/devicetree/bindings/power/mti,mips-cpc.txt b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
> new file mode 100644
Is it worth adding to the MIPS GENERIC PLATFORM entry of MAINTAINERS,
given that it directly benefits it?
Cheers
James
> index 0000000..c6b8251
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
> @@ -0,0 +1,8 @@
> +Binding for MIPS Cluster Power Controller (CPC).
> +
> +This binding allows a system to specify where the CPC registers are
> +located.
> +
> +Required properties:
> +compatible : Should be "mti,mips-cpc".
> +regs: Should describe the address & size of the CPC register region.
> --
> 2.7.4
>
> On Wed, Dec 27, 2017 at 03:37:51PM +0100, Aleksandar Markovic wrote:
> > From: Paul Burton <[email protected]>
> >
> > Document a binding for the MIPS Cluster Power Controller (CPC) that
> > allows the device tree to specify where the CPC registers are located.
> >
> > Signed-off-by: Paul Burton <[email protected]>
> > Signed-off-by: Aleksandar Markovic <[email protected]>
> > ---
> > Documentation/devicetree/bindings/power/mti,mips-cpc.txt | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> > create mode 100644 Documentation/devicetree/bindings/power/mti,mips-cpc.txt
> >
> > diff --git a/Documentation/devicetree/bindings/power/mti,mips-cpc.txt b/Documentation/devicetree/bindings/power/mti,mips-cpc.txt
> > new file mode 100644
>
> Is it worth adding to the MIPS GENERIC PLATFORM entry of MAINTAINERS,
> given that it directly benefits it?
>
> Cheers
> James
If nobody objects, in the v4 of this series, as a part of this particular patch, I am going to add the line:
F: Documentation/devicetree/bindings/power/mti,mips-cpc.txt
to the following segment in MAINTAINERS file:
MIPS GENERIC PLATFORM
M: Paul Burton <[email protected]>
L: [email protected]
S: Supported
F: arch/mips/generic/
F: arch/mips/tools/generic-board-config.sh
v4 is planned to be sent by the end of the day.
Thanks,
Aleksandar