diff mbox

[PATCHv3,3/3] pwm: documentation: Add 'big-endian' property for FTM PWM.

Message ID 1408332755-35102-4-git-send-email-Li.Xiubo@freescale.com
State Superseded
Headers show

Commit Message

Xiubo Li Aug. 18, 2014, 3:32 a.m. UTC
For the same FTM PWM device, which on different SoCs will in
differrent endian mode, using the same linux device driver need
one boolean properties to distingush this.

For now the FTM PWM is only applied to the ARM SoCs which are all
in LE mode.

So the DT binding for FTM PWM device endian:
SoC     |  FTM-PWM | 'big-endian' property is needed?
--------|----------|---------------------------------
Vybird  |    LE    |     No
LS1     |    BE    |     Yes
LS2     |    LE    |     No

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
---
 .../devicetree/bindings/pwm/pwm-fsl-ftm.txt        | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

Comments

Mark Rutland Aug. 18, 2014, 9:59 a.m. UTC | #1
On Mon, Aug 18, 2014 at 04:32:35AM +0100, Xiubo Li wrote:
> For the same FTM PWM device, which on different SoCs will in
> differrent endian mode, using the same linux device driver need
> one boolean properties to distingush this.
> 
> For now the FTM PWM is only applied to the ARM SoCs which are all
> in LE mode.
> 
> So the DT binding for FTM PWM device endian:
> SoC     |  FTM-PWM | 'big-endian' property is needed?
> --------|----------|---------------------------------
> Vybird  |    LE    |     No
> LS1     |    BE    |     Yes
> LS2     |    LE    |     No
> 
> Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
> ---
>  .../devicetree/bindings/pwm/pwm-fsl-ftm.txt        | 22 +++++++++++++++++++++-
>  1 file changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt b/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt
> index 0bda229..67ed8d6 100644
> --- a/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt
> +++ b/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt
> @@ -1,5 +1,23 @@
>  Freescale FlexTimer Module (FTM) PWM controller
>  
> +For the same FTM PWM device, which on different SoCs will in
> +differrent endian mode, using the same linux device driver need
> +one boolean properties to distingush this.

There is absolutely no need to mention Linux if this is truly a HW
property.

> +
> +For now the FTM PWM is only applied to the ARM SoCs which are all
> +in LE mode.
> +
> +So the DT binding for FTM PWM device endian:
> +SoC     |  FTM-PWM | 'big-endian' property is needed?
> +--------|----------|---------------------------------
> +Vybird  |    LE    |     No
> +LS1     |    BE    |     Yes
> +LS2     |    LE    |     No
> +
> +Please see "Documentation/devicetree/bindings/regmap/regmap.txt" for more
> +detail about the endianness.

Surely all we need is:

The FTM PWM device can be integrated as little-endian or big-endian.
This endianness differs per SoC:

SoC     | FTM-PWM endianness
--------+-------------------
Vybrid  | LE
LS1     | BE
LS2     | LE

> +
> +
>  Required properties:
>  - compatible: Should be "fsl,vf610-ftm-pwm".
>  - reg: Physical base address and length of the controller's registers
> @@ -16,7 +34,8 @@ Required properties:
>  - pinctrl-names: Must contain a "default" entry.
>  - pinctrl-NNN: One property must exist for each entry in pinctrl-names.
>    See pinctrl/pinctrl-bindings.txt for details of the property values.
> -
> +- big-endian: One boolean property, for all the device registers, the BE mode
> +  will be in use if it's present, or the LE mode will be in use.

- big-endian: Boolean property, required if all the FTM_PWM registers
  are big-endian rather than little-endian.

Cheers,
Mark.

>  
>  Example:
>  
> @@ -32,4 +51,5 @@ pwm0: pwm@40038000 {
>  			<&clks VF610_CLK_FTM0_EXT_FIX_EN>;
>  		pinctrl-names = "default";
>  		pinctrl-0 = <&pinctrl_pwm0_1>;
> +		big-endian;
>  };
> -- 
> 1.8.5
> 
> --
> 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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pwm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Xiubo Li Aug. 18, 2014, 12:11 p.m. UTC | #2
[...]
>>  Freescale FlexTimer Module (FTM) PWM controller
>>
>> +For the same FTM PWM device, which on different SoCs will in
>> +differrent endian mode, using the same linux device driver need
>> +one boolean properties to distingush this.
>
> There is absolutely no need to mention Linux if this is truly a HW
> property.

Okay.

[...]
>> +
>> +For now the FTM PWM is only applied to the ARM SoCs which are all
>> +in LE mode.
>> +
>> +So the DT binding for FTM PWM device endian:
>> +SoC     |  FTM-PWM | 'big-endian' property is needed?
>> +--------|----------|---------------------------------
>> +Vybird  |    LE    |     No
>> +LS1     |    BE    |     Yes
>> +LS2     |    LE    |     No
>> +
>> +Please see "Documentation/devicetree/bindings/regmap/regmap.txt" for more
>> +detail about the endianness.
>
> Surely all we need is:
>
> The FTM PWM device can be integrated as little-endian or big-endian.
> This endianness differs per SoC:
>
> SoC     | FTM-PWM endianness
> --------+-------------------
> Vybrid  | LE
> LS1     | BE
> LS2     | LE

I'll follow your advice.

[...]
>> +- big-endian: One boolean property, for all the device registers, the BE mode
>> +  will be in use if it's present, or the LE mode will be in use.
>
>- big-endian: Boolean property, required if all the FTM_PWM registers
>  are big-endian rather than little-endian.
>

See the next version.

Thanks very much for you comment and advice.

BRs
XIubo



> Cheers,
> Mark.
--
To unsubscribe from this list: send the line "unsubscribe linux-pwm" 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/pwm/pwm-fsl-ftm.txt b/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt
index 0bda229..67ed8d6 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-fsl-ftm.txt
@@ -1,5 +1,23 @@ 
 Freescale FlexTimer Module (FTM) PWM controller
 
+For the same FTM PWM device, which on different SoCs will in
+differrent endian mode, using the same linux device driver need
+one boolean properties to distingush this.
+
+For now the FTM PWM is only applied to the ARM SoCs which are all
+in LE mode.
+
+So the DT binding for FTM PWM device endian:
+SoC     |  FTM-PWM | 'big-endian' property is needed?
+--------|----------|---------------------------------
+Vybird  |    LE    |     No
+LS1     |    BE    |     Yes
+LS2     |    LE    |     No
+
+Please see "Documentation/devicetree/bindings/regmap/regmap.txt" for more
+detail about the endianness.
+
+
 Required properties:
 - compatible: Should be "fsl,vf610-ftm-pwm".
 - reg: Physical base address and length of the controller's registers
@@ -16,7 +34,8 @@  Required properties:
 - pinctrl-names: Must contain a "default" entry.
 - pinctrl-NNN: One property must exist for each entry in pinctrl-names.
   See pinctrl/pinctrl-bindings.txt for details of the property values.
-
+- big-endian: One boolean property, for all the device registers, the BE mode
+  will be in use if it's present, or the LE mode will be in use.
 
 Example:
 
@@ -32,4 +51,5 @@  pwm0: pwm@40038000 {
 			<&clks VF610_CLK_FTM0_EXT_FIX_EN>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_pwm0_1>;
+		big-endian;
 };