diff mbox

[V11,1/3] ARM: dts: Add pmu sysreg node to exynos5250 and exynos5420 dtsi files

Message ID 1385613243-3559-2-git-send-email-l.krishna@samsung.com
State Superseded, archived
Headers show

Commit Message

Leela Krishna Amudala Nov. 28, 2013, 4:34 a.m. UTC
This patch adds pmusysreg node to exynos5250 and exynos5420 dtsi files to
handle PMU register accesses in a centralized way using syscon driver

Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Tested-by: Doug Anderson <dianders@chromium.org>
---
 Documentation/devicetree/bindings/arm/samsung/pmu.txt |   16 ++++++++++++++++
 arch/arm/boot/dts/exynos5250.dtsi                     |    5 +++++
 arch/arm/boot/dts/exynos5420.dtsi                     |    5 +++++
 3 files changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/samsung/pmu.txt

Comments

Olof Johansson Dec. 2, 2013, 6:50 p.m. UTC | #1
Hi,

On Wed, Nov 27, 2013 at 8:34 PM, Leela Krishna Amudala
<l.krishna@samsung.com> wrote:
> This patch adds pmusysreg node to exynos5250 and exynos5420 dtsi files to
> handle PMU register accesses in a centralized way using syscon driver
>
> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> Reviewed-by: Tomasz Figa <t.figa@samsung.com>
> Reviewed-by: Doug Anderson <dianders@chromium.org>
> Tested-by: Doug Anderson <dianders@chromium.org>
> ---
>  Documentation/devicetree/bindings/arm/samsung/pmu.txt |   16 ++++++++++++++++
>  arch/arm/boot/dts/exynos5250.dtsi                     |    5 +++++
>  arch/arm/boot/dts/exynos5420.dtsi                     |    5 +++++
>  3 files changed, 26 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/samsung/pmu.txt
>
> diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
> new file mode 100644
> index 0000000..307e727
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
> @@ -0,0 +1,16 @@
> +SAMSUNG Exynos SoC series PMU Registers
> +
> +Properties:
> + - name : should be 'syscon';

It's common to use a non-abbreviated name, such as 'system-controller'
here. Or, given that it's referring to "pmusysreg" then maybe
something like "pmu-system-registers".

> + - compatible : should contain two values. First value must be one from following list:
> +                  - "samsung,exynos5250-pmu" - for Exynos5250 SoC,
> +                  - "samsung,exynos5420-pmu" - for Exynos5420 SoC.
> +               second value must be always "syscon".



-Olof
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Figa Dec. 2, 2013, 7:49 p.m. UTC | #2
On Monday 02 of December 2013 10:50:14 Olof Johansson wrote:
> Hi,
> 
> On Wed, Nov 27, 2013 at 8:34 PM, Leela Krishna Amudala
> <l.krishna@samsung.com> wrote:
> > This patch adds pmusysreg node to exynos5250 and exynos5420 dtsi files to
> > handle PMU register accesses in a centralized way using syscon driver
> >
> > Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> > Reviewed-by: Tomasz Figa <t.figa@samsung.com>
> > Reviewed-by: Doug Anderson <dianders@chromium.org>
> > Tested-by: Doug Anderson <dianders@chromium.org>
> > ---
> >  Documentation/devicetree/bindings/arm/samsung/pmu.txt |   16 ++++++++++++++++
> >  arch/arm/boot/dts/exynos5250.dtsi                     |    5 +++++
> >  arch/arm/boot/dts/exynos5420.dtsi                     |    5 +++++
> >  3 files changed, 26 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/arm/samsung/pmu.txt
> >
> > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
> > new file mode 100644
> > index 0000000..307e727
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
> > @@ -0,0 +1,16 @@
> > +SAMSUNG Exynos SoC series PMU Registers
> > +
> > +Properties:
> > + - name : should be 'syscon';
> 
> It's common to use a non-abbreviated name, such as 'system-controller'
> here. Or, given that it's referring to "pmusysreg" then maybe
> something like "pmu-system-registers".

Hmm, it's two syscons vs two system-controllers in existing device trees.
I agree that system-controller sounds much better as a name for this class
of devices. I don't remember why I initially suggested syscon, though.
Possibly based on those two existing device trees using this name.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Anderson Dec. 5, 2013, 6:26 p.m. UTC | #3
Leela Krishna,

On Mon, Dec 2, 2013 at 11:49 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On Monday 02 of December 2013 10:50:14 Olof Johansson wrote:
>> Hi,
>>
>> On Wed, Nov 27, 2013 at 8:34 PM, Leela Krishna Amudala
>> <l.krishna@samsung.com> wrote:
>> > This patch adds pmusysreg node to exynos5250 and exynos5420 dtsi files to
>> > handle PMU register accesses in a centralized way using syscon driver
>> >
>> > Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
>> > Reviewed-by: Tomasz Figa <t.figa@samsung.com>
>> > Reviewed-by: Doug Anderson <dianders@chromium.org>
>> > Tested-by: Doug Anderson <dianders@chromium.org>
>> > ---
>> >  Documentation/devicetree/bindings/arm/samsung/pmu.txt |   16 ++++++++++++++++
>> >  arch/arm/boot/dts/exynos5250.dtsi                     |    5 +++++
>> >  arch/arm/boot/dts/exynos5420.dtsi                     |    5 +++++
>> >  3 files changed, 26 insertions(+)
>> >  create mode 100644 Documentation/devicetree/bindings/arm/samsung/pmu.txt
>> >
>> > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
>> > new file mode 100644
>> > index 0000000..307e727
>> > --- /dev/null
>> > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
>> > @@ -0,0 +1,16 @@
>> > +SAMSUNG Exynos SoC series PMU Registers
>> > +
>> > +Properties:
>> > + - name : should be 'syscon';
>>
>> It's common to use a non-abbreviated name, such as 'system-controller'
>> here. Or, given that it's referring to "pmusysreg" then maybe
>> something like "pmu-system-registers".
>
> Hmm, it's two syscons vs two system-controllers in existing device trees.
> I agree that system-controller sounds much better as a name for this class
> of devices. I don't remember why I initially suggested syscon, though.
> Possibly based on those two existing device trees using this name.

I'd vote for using "pmu-system-registers".  We end up using the
"syscon" subsystem but really we're describing pmu registers.

I'd even say that you don't need to formally specify the "name" in the
bindings (though I'm not up with all the latest device tree
requirements).  ...still you'd want to use "pmu-system-registers" in
the DTS changes.

Can you spin up a v12?

Thanks!

-Doug
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Figa Dec. 5, 2013, 6:30 p.m. UTC | #4
On Thursday 05 of December 2013 10:26:18 Doug Anderson wrote:
> Leela Krishna,
> 
> On Mon, Dec 2, 2013 at 11:49 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> > On Monday 02 of December 2013 10:50:14 Olof Johansson wrote:
> >> Hi,
> >>
> >> On Wed, Nov 27, 2013 at 8:34 PM, Leela Krishna Amudala
> >> <l.krishna@samsung.com> wrote:
> >> > This patch adds pmusysreg node to exynos5250 and exynos5420 dtsi files to
> >> > handle PMU register accesses in a centralized way using syscon driver
> >> >
> >> > Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
> >> > Reviewed-by: Tomasz Figa <t.figa@samsung.com>
> >> > Reviewed-by: Doug Anderson <dianders@chromium.org>
> >> > Tested-by: Doug Anderson <dianders@chromium.org>
> >> > ---
> >> >  Documentation/devicetree/bindings/arm/samsung/pmu.txt |   16 ++++++++++++++++
> >> >  arch/arm/boot/dts/exynos5250.dtsi                     |    5 +++++
> >> >  arch/arm/boot/dts/exynos5420.dtsi                     |    5 +++++
> >> >  3 files changed, 26 insertions(+)
> >> >  create mode 100644 Documentation/devicetree/bindings/arm/samsung/pmu.txt
> >> >
> >> > diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
> >> > new file mode 100644
> >> > index 0000000..307e727
> >> > --- /dev/null
> >> > +++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
> >> > @@ -0,0 +1,16 @@
> >> > +SAMSUNG Exynos SoC series PMU Registers
> >> > +
> >> > +Properties:
> >> > + - name : should be 'syscon';
> >>
> >> It's common to use a non-abbreviated name, such as 'system-controller'
> >> here. Or, given that it's referring to "pmusysreg" then maybe
> >> something like "pmu-system-registers".
> >
> > Hmm, it's two syscons vs two system-controllers in existing device trees.
> > I agree that system-controller sounds much better as a name for this class
> > of devices. I don't remember why I initially suggested syscon, though.
> > Possibly based on those two existing device trees using this name.
> 
> I'd vote for using "pmu-system-registers".  We end up using the
> "syscon" subsystem but really we're describing pmu registers.
> 
> I'd even say that you don't need to formally specify the "name" in the
> bindings (though I'm not up with all the latest device tree
> requirements).  ...still you'd want to use "pmu-system-registers" in
> the DTS changes.

Well, since the name should specify the class of device, I would say that
pmu-system-registers is too specific. If we want to change this, I'd say
we should go with system-controller.

As for name specification inside the binding, I agree that binding should
not require the main node to be named specifically. If we want to have
another version anyway, let's drop this.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Anderson Dec. 5, 2013, 6:35 p.m. UTC | #5
Tomasz,

On Thu, Dec 5, 2013 at 10:30 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
>> I'd vote for using "pmu-system-registers".  We end up using the
>> "syscon" subsystem but really we're describing pmu registers.
>>
>> I'd even say that you don't need to formally specify the "name" in the
>> bindings (though I'm not up with all the latest device tree
>> requirements).  ...still you'd want to use "pmu-system-registers" in
>> the DTS changes.
>
> Well, since the name should specify the class of device, I would say that
> pmu-system-registers is too specific. If we want to change this, I'd say
> we should go with system-controller.

...but the "compatible" is "samsung,exynos5250-pmu", "syscon", right?
That means that the class of the device is "exynos5250-pmu", right?
It is also compatible with the generic "syscon" class of devices.

> As for name specification inside the binding, I agree that binding should
> not require the main node to be named specifically. If we want to have
> another version anyway, let's drop this.

That sounds good to me.  So drop the "name" part in the bindings file
and then apply this discussion to patch #3 in this series (the one
that touches the .dtsi files).

-Doug
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Tomasz Figa Dec. 5, 2013, 6:59 p.m. UTC | #6
On Thursday 05 of December 2013 10:35:20 Doug Anderson wrote:
> Tomasz,
> 
> On Thu, Dec 5, 2013 at 10:30 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> >> I'd vote for using "pmu-system-registers".  We end up using the
> >> "syscon" subsystem but really we're describing pmu registers.
> >>
> >> I'd even say that you don't need to formally specify the "name" in the
> >> bindings (though I'm not up with all the latest device tree
> >> requirements).  ...still you'd want to use "pmu-system-registers" in
> >> the DTS changes.
> >
> > Well, since the name should specify the class of device, I would say that
> > pmu-system-registers is too specific. If we want to change this, I'd say
> > we should go with system-controller.
> 
> ...but the "compatible" is "samsung,exynos5250-pmu", "syscon", right?
> That means that the class of the device is "exynos5250-pmu", right?

Nope. "samsung,exynos5250-pmu" is the specific device (or hardware
programming interface) this device is compatible with.

With class I mean the generic kind of device, such as system-controller,
i2c, pinctrl, display, etc., as specified by sections 2.2.1 and 2.2.2 of
ePAPR.

Anyway, node names are just a matter of coding style, as they don't have
any semantical meaning in most cases (such as this one).

> It is also compatible with the generic "syscon" class of devices.

It is also compatible with the generic "syscon" programming interface,
which represents a set of loosely related registers that control various
aspects of other IP blocks.

Best regards,
Tomasz

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Doug Anderson Dec. 5, 2013, 7:02 p.m. UTC | #7
Tomasz,

On Thu, Dec 5, 2013 at 10:59 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
> On Thursday 05 of December 2013 10:35:20 Doug Anderson wrote:
>> Tomasz,
>>
>> On Thu, Dec 5, 2013 at 10:30 AM, Tomasz Figa <tomasz.figa@gmail.com> wrote:
>> >> I'd vote for using "pmu-system-registers".  We end up using the
>> >> "syscon" subsystem but really we're describing pmu registers.
>> >>
>> >> I'd even say that you don't need to formally specify the "name" in the
>> >> bindings (though I'm not up with all the latest device tree
>> >> requirements).  ...still you'd want to use "pmu-system-registers" in
>> >> the DTS changes.
>> >
>> > Well, since the name should specify the class of device, I would say that
>> > pmu-system-registers is too specific. If we want to change this, I'd say
>> > we should go with system-controller.
>>
>> ...but the "compatible" is "samsung,exynos5250-pmu", "syscon", right?
>> That means that the class of the device is "exynos5250-pmu", right?
>
> Nope. "samsung,exynos5250-pmu" is the specific device (or hardware
> programming interface) this device is compatible with.
>
> With class I mean the generic kind of device, such as system-controller,
> i2c, pinctrl, display, etc., as specified by sections 2.2.1 and 2.2.2 of
> ePAPR.
>
> Anyway, node names are just a matter of coding style, as they don't have
> any semantical meaning in most cases (such as this one).
>
>> It is also compatible with the generic "syscon" class of devices.
>
> It is also compatible with the generic "syscon" programming interface,
> which represents a set of loosely related registers that control various
> aspects of other IP blocks.

OK.  I will certainly cede to your superior knowledge of device tree
conventions.

Leela Krishna: unless someone else comes up with a convincing
argument, it sounds like the dts files should have the name
"system-controller" and the bindings change should remove all
references to the name.

-Doug
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/Documentation/devicetree/bindings/arm/samsung/pmu.txt b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
new file mode 100644
index 0000000..307e727
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/samsung/pmu.txt
@@ -0,0 +1,16 @@ 
+SAMSUNG Exynos SoC series PMU Registers
+
+Properties:
+ - name : should be 'syscon';
+ - compatible : should contain two values. First value must be one from following list:
+		   - "samsung,exynos5250-pmu" - for Exynos5250 SoC,
+		   - "samsung,exynos5420-pmu" - for Exynos5420 SoC.
+		second value must be always "syscon".
+
+ - reg : offset and length of the register set.
+
+Example :
+pmu_syscon: syscon@10040000 {
+	compatible = "samsung,exynos5250-pmu", "syscon";
+	reg = <0x10040000 0x5000>;
+};
diff --git a/arch/arm/boot/dts/exynos5250.dtsi b/arch/arm/boot/dts/exynos5250.dtsi
index 9db5047..2f264ad 100644
--- a/arch/arm/boot/dts/exynos5250.dtsi
+++ b/arch/arm/boot/dts/exynos5250.dtsi
@@ -163,6 +163,11 @@ 
 		interrupts = <0 47 0>;
 	};
 
+	pmu_syscon: syscon@10040000 {
+		compatible = "samsung,exynos5250-pmu", "syscon";
+		reg = <0x10040000 0x5000>;
+	};
+
 	watchdog {
 		clocks = <&clock 336>;
 		clock-names = "watchdog";
diff --git a/arch/arm/boot/dts/exynos5420.dtsi b/arch/arm/boot/dts/exynos5420.dtsi
index 09aa06c..06e97a7 100644
--- a/arch/arm/boot/dts/exynos5420.dtsi
+++ b/arch/arm/boot/dts/exynos5420.dtsi
@@ -310,4 +310,9 @@ 
 		clocks = <&clock 431>, <&clock 143>;
 		clock-names = "mixer", "sclk_hdmi";
 	};
+
+	pmu_syscon: syscon@10040000 {
+		compatible = "samsung,exynos5420-pmu", "syscon";
+		reg = <0x10040000 0x5000>;
+	};
 };