linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] MIPS: Augment CPC support
@ 2017-12-15 16:51 Aleksandar Markovic
  2017-12-15 16:51 ` [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding Aleksandar Markovic
  2017-12-15 16:52 ` [PATCH 2/2] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() Aleksandar Markovic
  0 siblings, 2 replies; 5+ messages in thread
From: Aleksandar Markovic @ 2017-12-15 16:51 UTC (permalink / raw)
  To: linux-mips
  Cc: Aleksandar Markovic, Dengcheng Zhu, Douglas Leung, Goran Ferenc,
	James Hogan, linux-kernel, Matt Redfearn, Miodrag Dinic,
	Paul Burton, Petar Jovanovic, Raghu Gandham, Ralf Baechle,
	Thomas Gleixner

From: Aleksandar Markovic <aleksandar.markovic@mips.com>

This series is based on two patches from the 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.

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/misc/mti,mips-cpc.txt |  8 ++++++++
 arch/mips/kernel/mips-cpc.c                             | 13 +++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/mti,mips-cpc.txt

-- 
2.7.4

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding
  2017-12-15 16:51 [PATCH 0/2] MIPS: Augment CPC support Aleksandar Markovic
@ 2017-12-15 16:51 ` Aleksandar Markovic
  2017-12-16 18:26   ` Rob Herring
  2017-12-15 16:52 ` [PATCH 2/2] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() Aleksandar Markovic
  1 sibling, 1 reply; 5+ messages in thread
From: Aleksandar Markovic @ 2017-12-15 16:51 UTC (permalink / raw)
  To: linux-mips
  Cc: Paul Burton, Aleksandar Markovic, devicetree, Douglas Leung,
	Goran Ferenc, James Hogan, linux-kernel, Mark Rutland,
	Miodrag Dinic, Petar Jovanovic, Raghu Gandham, Rob Herring

From: Paul Burton <paul.burton@mips.com>

Document a binding for the MIPS Cluster Power Controller (CPC) which
simply allows the device tree to specify where the CPC registers should
be mapped.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
---
 Documentation/devicetree/bindings/misc/mti,mips-cpc.txt | 8 ++++++++
 1 file changed, 8 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/misc/mti,mips-cpc.txt

diff --git a/Documentation/devicetree/bindings/misc/mti,mips-cpc.txt b/Documentation/devicetree/bindings/misc/mti,mips-cpc.txt
new file mode 100644
index 0000000..92eb08f
--- /dev/null
+++ b/Documentation/devicetree/bindings/misc/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 should be
+mapped using device tree.
+
+Required properties:
+compatible : Should be "mti,mips-cpc".
+regs: Should describe the address & size of the CPC register region.
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base()
  2017-12-15 16:51 [PATCH 0/2] MIPS: Augment CPC support Aleksandar Markovic
  2017-12-15 16:51 ` [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding Aleksandar Markovic
@ 2017-12-15 16:52 ` Aleksandar Markovic
  1 sibling, 0 replies; 5+ messages in thread
From: Aleksandar Markovic @ 2017-12-15 16:52 UTC (permalink / raw)
  To: linux-mips
  Cc: Paul Burton, Miodrag Dinic, Aleksandar Markovic, Dengcheng Zhu,
	Douglas Leung, Goran Ferenc, James Hogan, linux-kernel,
	Matt Redfearn, Petar Jovanovic, Raghu Gandham, Ralf Baechle

From: Paul Burton <paul.burton@mips.com>

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 mappings for your platform.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Signed-off-by: Miodrag Dinic <miodrag.dinic@mips.com>
Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding
  2017-12-15 16:51 ` [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding Aleksandar Markovic
@ 2017-12-16 18:26   ` Rob Herring
  2017-12-18 15:38     ` Aleksandar Markovic
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2017-12-16 18:26 UTC (permalink / raw)
  To: Aleksandar Markovic
  Cc: linux-mips, Paul Burton, Aleksandar Markovic, devicetree,
	Douglas Leung, Goran Ferenc, James Hogan, linux-kernel,
	Mark Rutland, Miodrag Dinic, Petar Jovanovic, Raghu Gandham

On Fri, Dec 15, 2017 at 05:51:59PM +0100, Aleksandar Markovic wrote:
> From: Paul Burton <paul.burton@mips.com>
> 
> Document a binding for the MIPS Cluster Power Controller (CPC) which
> simply allows the device tree to specify where the CPC registers should
> be mapped.
> 
> Signed-off-by: Paul Burton <paul.burton@mips.com>
> Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
> ---
>  Documentation/devicetree/bindings/misc/mti,mips-cpc.txt | 8 ++++++++
>  1 file changed, 8 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/misc/mti,mips-cpc.txt
> 
> diff --git a/Documentation/devicetree/bindings/misc/mti,mips-cpc.txt b/Documentation/devicetree/bindings/misc/mti,mips-cpc.txt
> new file mode 100644
> index 0000000..92eb08f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/misc/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 should be
> +mapped using device tree.

Not really where you map registers, but where they are located.

> +
> +Required properties:
> +compatible : Should be "mti,mips-cpc".

Only one version of the block?

> +regs: Should describe the address & size of the CPC register region.
> -- 
> 2.7.4
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding
  2017-12-16 18:26   ` Rob Herring
@ 2017-12-18 15:38     ` Aleksandar Markovic
  0 siblings, 0 replies; 5+ messages in thread
From: Aleksandar Markovic @ 2017-12-18 15:38 UTC (permalink / raw)
  To: Rob Herring, Aleksandar Markovic
  Cc: linux-mips, Paul Burton, devicetree, Douglas Leung, Goran Ferenc,
	James Hogan, linux-kernel, Mark Rutland, Miodrag Dinic,
	Petar Jovanovic, Raghu Gandham

> From: Rob Herring [robh@kernel.org]
> Sent: Saturday, December 16, 2017 7:26 PM
> To: Aleksandar Markovic
> Subject: Re: [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding
>
> On Fri, Dec 15, 2017 at 05:51:59PM +0100, Aleksandar Markovic wrote:
> > From: Paul Burton <paul.burton@mips.com>
> >
> > Document a binding for the MIPS Cluster Power Controller (CPC) which
> > simply allows the device tree to specify where the CPC registers should
> > be mapped.
> >
> > Signed-off-by: Paul Burton <paul.burton@mips.com>
> > Signed-off-by: Aleksandar Markovic <aleksandar.markovic@mips.com>
> > ---
> >  Documentation/devicetree/bindings/misc/mti,mips-cpc.txt | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/misc/mti,mips-cpc.txt
> >
..
> > +++ b/Documentation/devicetree/bindings/misc/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 should be
> > +mapped using device tree.
> 
> Not really where you map registers, but where they are located.
> 

This will be corrected in the next version.

> > +
> > +Required properties:
> > +compatible : Should be "mti,mips-cpc".
> 
> Only one version of the block?
> 

I am not clear what you mean by "version of the block". I you meant
number of allowed values for *compatible* property, yes, we want and
need just one such value (string).

> > +regs: Should describe the address & size of the CPC register region.
> > --

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-12-18 15:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-15 16:51 [PATCH 0/2] MIPS: Augment CPC support Aleksandar Markovic
2017-12-15 16:51 ` [PATCH 1/2] dt-bindings: Document mti,mips-cpc binding Aleksandar Markovic
2017-12-16 18:26   ` Rob Herring
2017-12-18 15:38     ` Aleksandar Markovic
2017-12-15 16:52 ` [PATCH 2/2] MIPS: CPC: Map registers using DT in mips_cpc_default_phys_base() Aleksandar Markovic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).