Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1653683 > unrolled thread

Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K

Started byRob Herring <robh@kernel.org>
First post2017-05-31 00:30 +0200
Last post2017-06-01 19:40 +0200
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio  controllers on Armada 7K/8K Rob Herring <robh@kernel.org> - 2017-05-31 00:30 +0200
    Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K Gregory CLEMENT <gregory.clement@free-electrons.com> - 2017-05-31 12:10 +0200
      Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K Gregory CLEMENT <gregory.clement@free-electrons.com> - 2017-06-01 19:40 +0200

#1653683 — Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K

FromRob Herring <robh@kernel.org>
Date2017-05-31 00:30 +0200
SubjectRe: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K
Message-ID<tMXOi-4I0-9@gated-at.bofh.it>
On Fri, May 19, 2017 at 06:09:22PM +0200, Gregory CLEMENT wrote:
> Document the device tree binding for the gpio controllers found on the
> Marvell Armada 7K and Armada 8K SoCs.
> 
> Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
> ---
>  Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt  | 20 ++++++++++++++++++++
>  Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt | 24 +++++++++++++++++++++++-
>  Documentation/devicetree/bindings/gpio/gpio-mvebu.txt                      | 24 +++++++++++++++++-------
>  3 files changed, 60 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt b/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
> index 4228d158fb31..0b887440e08a 100644
> --- a/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
> +++ b/Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
> @@ -64,6 +64,17 @@ mpp17	17	gpio
>  mpp18	18	gpio
>  mpp19	19	gpio, uart0(rxd), sdio(pw_off)
>  
> +GPIO:
> +-----
> +For common binding part and usage, refer to
> +Documentation/devicetree/bindings/gpio/gpio-mvebu.txt.
> +
> +Required properties:
> +
> +- compatible: "marvell,armada-8k-gpio"
> +
> +- offset: offset address inside the syscon block
> +
>  Example:
>  ap_syscon: system-controller@6f4000 {
>  	compatible = "syscon", "simple-mfd";
> @@ -77,4 +88,13 @@ ap_syscon: system-controller@6f4000 {
>  	ap_pinctrl: pinctrl {
>  		compatible = "marvell,ap806-pinctrl";
>  	};
> +
> +	ap_gpio: gpio {
> +		compatible = "marvell,armada-8k-gpio";
> +		offset = <0x1040>;
> +		ngpios = <19>;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +		gpio-ranges = <&ap_pinctrl 0 0 19>;
> +	};
>  };
> diff --git a/Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt b/Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
> index 733beac7724e..655c114ef584 100644
> --- a/Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
> +++ b/Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
> @@ -149,6 +149,18 @@ mpp60	60	gpio, mss_gpio6, ptp(pulse), tdm(dtx), au(i2smclk), spi0(csn1), uart0(r
>  mpp61	61	gpio, mss_gpio5, ptp(clk), tdm(pclk), au(i2sextclk), spi0(csn2), uart0(txd), uart2(txd), sata1(present_act), ge(mdio), sdio(d3)
>  mpp62	62	gpio, mss_gpio4, synce1(clk), ptp(pclk_out), sata1(present_act), spi0(csn3), uart0(rxd), uart2(rxd), sata0(present_act), ge(mdc)
>  
> +GPIO:
> +-----
> +
> +For common binding part and usage, refer to
> +Documentation/devicetree/bindings/gpio/gpio-mvebu.txt.
> +
> +Required properties:
> +
> +- compatible: "marvell,armada-8k-gpio"
> +
> +- offset: offset address inside the syscon block
> +
>  Example:
>  
>  cpm_syscon0: system-controller@440000 {
> @@ -163,5 +175,15 @@ cpm_syscon0: system-controller@440000 {
>  	cpm_pinctrl: pinctrl {
>  		compatible = "marvell,armada-8k-cpm-pinctrl";
>  	};
> -};
>  
> +	cpm_gpio1: gpio@100 {
> +		compatible = "marvell,armada-8k-gpio";
> +		offset = <0x100>;
> +		ngpios = <32>;
> +		gpio-controller;
> +		#gpio-cells = <2>;
> +		gpio-ranges = <&cpm_pinctrl 0 0 32>;
> +		status = "disabled";
> +	};
> +
> +};
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
> index 42c3bb2d53e8..2c5304ff467c 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
> +++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.txt
> @@ -2,17 +2,27 @@
>  
>  Required properties:
>  
> -- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio"
> -  or "marvell,armadaxp-gpio". "marvell,orion-gpio" should be used for
> -  Orion, Kirkwood, Dove, Discovery (except MV78200) and Armada
> -  370. "marvell,mv78200-gpio" should be used for the Discovery
> -  MV78200. "marvel,armadaxp-gpio" should be used for all Armada XP
> -  SoCs (MV78230, MV78260, MV78460).
> +- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio",
> +  "marvell,armadaxp-gpio" or "marvell,armada-8k-gpio".
> +
> +    "marvell,orion-gpio" should be used for Orion, Kirkwood, Dove,
> +    Discovery (except MV78200) and Armada 370. "marvell,mv78200-gpio"
> +    should be used for the Discovery MV78200.
> +
> +    "marvel,armadaxp-gpio" should be used for all Armada XP SoCs
> +    (MV78230, MV78260, MV78460).
> +
> +    "marvell,armada-8k-gpio" should be used for the Armada 7K and 8K
> +    SoCs (either from AP or CP), see
> +    Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
> +    and
> +    Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
> +    for specific details about the offset property.
>  
>  - reg: Address and length of the register set for the device. Only one
>    entry is expected, except for the "marvell,armadaxp-gpio" variant
>    for which two entries are expected: one for the general registers,
> -  one for the per-cpu registers.
> +  one for the per-cpu registers. Not used for marvell,armada-8k-gpio.

Why can't use you use reg instead of offset?

Rob

[toc] | [next] | [standalone]


#1654087 — Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2017-05-31 12:10 +0200
SubjectRe: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K
Message-ID<tN8JI-3mG-17@gated-at.bofh.it>
In reply to#1653683
Hi Rob,
 
 On mer., mai 31 2017, Rob Herring <robh@kernel.org> wrote:
>>  
>>  Required properties:
>>  
>> -- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio"
>> -  or "marvell,armadaxp-gpio". "marvell,orion-gpio" should be used for
>> -  Orion, Kirkwood, Dove, Discovery (except MV78200) and Armada
>> -  370. "marvell,mv78200-gpio" should be used for the Discovery
>> -  MV78200. "marvel,armadaxp-gpio" should be used for all Armada XP
>> -  SoCs (MV78230, MV78260, MV78460).
>> +- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio",
>> +  "marvell,armadaxp-gpio" or "marvell,armada-8k-gpio".
>> +
>> +    "marvell,orion-gpio" should be used for Orion, Kirkwood, Dove,
>> +    Discovery (except MV78200) and Armada 370. "marvell,mv78200-gpio"
>> +    should be used for the Discovery MV78200.
>> +
>> +    "marvel,armadaxp-gpio" should be used for all Armada XP SoCs
>> +    (MV78230, MV78260, MV78460).
>> +
>> +    "marvell,armada-8k-gpio" should be used for the Armada 7K and 8K
>> +    SoCs (either from AP or CP), see
>> +    Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
>> +    and
>> +    Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
>> +    for specific details about the offset property.
>>  
>>  - reg: Address and length of the register set for the device. Only one
>>    entry is expected, except for the "marvell,armadaxp-gpio" variant
>>    for which two entries are expected: one for the general registers,
>> -  one for the per-cpu registers.
>> +  one for the per-cpu registers. Not used for marvell,armada-8k-gpio.
>
> Why can't use you use reg instead of offset?

I looked for how the other syscon user did, and I found the offset
usage. So I assumed it was the way to do it. But if you wan I can use a
reg property.

Gregory

>
> Rob

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

[toc] | [prev] | [next] | [standalone]


#1655618 — Re: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K

FromGregory CLEMENT <gregory.clement@free-electrons.com>
Date2017-06-01 19:40 +0200
SubjectRe: [PATCH 3/6] gpio: dt-bindings: Add documentation for gpio controllers on Armada 7K/8K
Message-ID<tNCeJ-5B8-5@gated-at.bofh.it>
In reply to#1654087
Hi Rob,
 
 On mer., mai 31 2017, Gregory CLEMENT <gregory.clement@free-electrons.com> wrote:

> Hi Rob,
>  
>  On mer., mai 31 2017, Rob Herring <robh@kernel.org> wrote:
>>>  
>>>  Required properties:
>>>  
>>> -- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio"
>>> -  or "marvell,armadaxp-gpio". "marvell,orion-gpio" should be used for
>>> -  Orion, Kirkwood, Dove, Discovery (except MV78200) and Armada
>>> -  370. "marvell,mv78200-gpio" should be used for the Discovery
>>> -  MV78200. "marvel,armadaxp-gpio" should be used for all Armada XP
>>> -  SoCs (MV78230, MV78260, MV78460).
>>> +- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio",
>>> +  "marvell,armadaxp-gpio" or "marvell,armada-8k-gpio".
>>> +
>>> +    "marvell,orion-gpio" should be used for Orion, Kirkwood, Dove,
>>> +    Discovery (except MV78200) and Armada 370. "marvell,mv78200-gpio"
>>> +    should be used for the Discovery MV78200.
>>> +
>>> +    "marvel,armadaxp-gpio" should be used for all Armada XP SoCs
>>> +    (MV78230, MV78260, MV78460).
>>> +
>>> +    "marvell,armada-8k-gpio" should be used for the Armada 7K and 8K
>>> +    SoCs (either from AP or CP), see
>>> +    Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
>>> +    and
>>> +    Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
>>> +    for specific details about the offset property.
>>>  
>>>  - reg: Address and length of the register set for the device. Only one
>>>    entry is expected, except for the "marvell,armadaxp-gpio" variant
>>>    for which two entries are expected: one for the general registers,
>>> -  one for the per-cpu registers.
>>> +  one for the per-cpu registers. Not used for marvell,armada-8k-gpio.
>>
>> Why can't use you use reg instead of offset?
>
> I looked for how the other syscon user did, and I found the offset
> usage. So I assumed it was the way to do it. But if you wan I can use a
> reg property.

I had a closer looked to the binding when syscon is used with several
subnodes. And actually the reg usage is very uncommon, I only find it in
drivers/regulator/pbias-regulator.c but for legacy.

I am not sure that we have any benefit with this reg property: we won't
use the length of the register and we need to add a range property in
the parent node.

An other way to pass this information is to have a different compatible
string which will match the different offset available. In this case the
reg property won't be used in a syscon node. However, while it makes
sens for the difference between AP806 and CP110, it would be strange to
have a different compatible string for gpio bank 1 and gpio bank 2.

So, in the end I would prefer to use the offset. From my point of view
it is better to not use the reg property for two different purposes:
mmio address vs offset in a syscon.

But if you think that from the point of view of the device tree
compliance we have to use the reg property, of course I will change it.

Thanks,

Gregory

>
> Gregory
>
>>
>> Rob
>
> -- 
> Gregory Clement, Free Electrons
> Kernel, drivers, real-time and embedded Linux
> development, consulting, training and support.
> http://free-electrons.com
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web