Re: [PATCH v3 01/11] dt-bindings: clock: Add Actions S900 clock bindings

2018-02-10 Thread Manivannan Sadhasivam
Hi Philippe,

On 10 February 2018 at 13:06, Philippe Ombredanne  wrote:
> Dear Manivannan,
>
> On Sat, Feb 10, 2018 at 3:41 AM, Manivannan Sadhasivam
>  wrote:
>> Add Actions Semi S900 clock bindings.
>>
>> Signed-off-by: Manivannan Sadhasivam 
>> Acked-by: Rob Herring 
>
> 
>
>> diff --git a/include/dt-bindings/clock/actions,s900-cmu.h 
>> b/include/dt-bindings/clock/actions,s900-cmu.h
>> new file mode 100644
>> index ..2fa94e19922b
>> --- /dev/null
>> +++ b/include/dt-bindings/clock/actions,s900-cmu.h
>> @@ -0,0 +1,139 @@
>> +/*
>> + * Device Tree binding constants for Actions S900 Clock Management Unit
>> + *
>> + * Copyright (c) 2014 Actions Semi Inc.
>> + * Copyright (c) 2017 Linaro Ltd.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License as published by
>> + * the Free Software Foundation; either version 2 of the License, or
>> + * (at your option) any later version.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>> + * GNU General Public License for more details.
>> + */
>
> Would you consider using the new SPDX license ids rather that this
> time-tested but rather boring legalese?
>

Very sorry! I converted all the driver code to SPDX license tag but since
this file was already Acked, I forgot to do so.

Will clean it up.

> The (still new and fresh) license documentation contributed by tglx
> --the only maintainer that I know that understands both the innards of
> Spectre and Meltdown and the beauty of reStructuredText -- is in:
> Documentation/process/license-rules.rst
>
> Practically this means replacing the above by a simple single line and
> getting rid of a whopping 8 comment lines!
>
> SPDX-License-Identifier: GPL-2.0+
>
> You get to save a few tree as a bonus if you also do the same for all
> Linaro-copyrighted files. Yes this is saving trees because I will use
> less paper each time I print a listing of the kernel source code.
> Which is something that I rarely if ever do: but somebody must do it
> somewhere for sure.
>

This is something I will consider doing it in a separate patchset.

> If I do the math: we have ~60K files in the kernel, and say we can
> remove roughly 5 lines of legalese per file on average. Each printed
> source code page is roughly 60 lines : this will mean a saving of
> about 6000 paper sheets saved on each printout! A letter-size paper
> ream is 500 pages, about 2.5 Kg and costs about ~$8.  You can extract
> about 10K to 20k sheets of paper per tree [1].
> Therefore my Fermi estimate is that using shorter legalese in the
> kernel will eventually save roughly ONE FULL smaller tree (6K pages)
> each time someone prints the kernel code: incredible, right?
>
> Thank  you for helping make the kernel a mostly legalese-free codebase
> and saving trees at the same time!
>

Thanks for the finding!

Regards,
Mani

> [1] 
> https://www.sierraclub.org/sierra/2014-4-july-august/green-life/how-much-paper-does-one-tree-produce
> --
> Cordially
> Philippe Ombredanne


Re: [PATCH v3 01/11] dt-bindings: clock: Add Actions S900 clock bindings

2018-02-09 Thread Philippe Ombredanne
Dear Manivannan,

On Sat, Feb 10, 2018 at 3:41 AM, Manivannan Sadhasivam
 wrote:
> Add Actions Semi S900 clock bindings.
>
> Signed-off-by: Manivannan Sadhasivam 
> Acked-by: Rob Herring 



> diff --git a/include/dt-bindings/clock/actions,s900-cmu.h 
> b/include/dt-bindings/clock/actions,s900-cmu.h
> new file mode 100644
> index ..2fa94e19922b
> --- /dev/null
> +++ b/include/dt-bindings/clock/actions,s900-cmu.h
> @@ -0,0 +1,139 @@
> +/*
> + * Device Tree binding constants for Actions S900 Clock Management Unit
> + *
> + * Copyright (c) 2014 Actions Semi Inc.
> + * Copyright (c) 2017 Linaro Ltd.
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */

Would you consider using the new SPDX license ids rather that this
time-tested but rather boring legalese?

The (still new and fresh) license documentation contributed by tglx
--the only maintainer that I know that understands both the innards of
Spectre and Meltdown and the beauty of reStructuredText -- is in:
Documentation/process/license-rules.rst

Practically this means replacing the above by a simple single line and
getting rid of a whopping 8 comment lines!

SPDX-License-Identifier: GPL-2.0+

You get to save a few tree as a bonus if you also do the same for all
Linaro-copyrighted files. Yes this is saving trees because I will use
less paper each time I print a listing of the kernel source code.
Which is something that I rarely if ever do: but somebody must do it
somewhere for sure.

If I do the math: we have ~60K files in the kernel, and say we can
remove roughly 5 lines of legalese per file on average. Each printed
source code page is roughly 60 lines : this will mean a saving of
about 6000 paper sheets saved on each printout! A letter-size paper
ream is 500 pages, about 2.5 Kg and costs about ~$8.  You can extract
about 10K to 20k sheets of paper per tree [1].
Therefore my Fermi estimate is that using shorter legalese in the
kernel will eventually save roughly ONE FULL smaller tree (6K pages)
each time someone prints the kernel code: incredible, right?

Thank  you for helping make the kernel a mostly legalese-free codebase
and saving trees at the same time!

[1] 
https://www.sierraclub.org/sierra/2014-4-july-august/green-life/how-much-paper-does-one-tree-produce
-- 
Cordially
Philippe Ombredanne


[PATCH v3 01/11] dt-bindings: clock: Add Actions S900 clock bindings

2018-02-09 Thread Manivannan Sadhasivam
Add Actions Semi S900 clock bindings.

Signed-off-by: Manivannan Sadhasivam 
Acked-by: Rob Herring 
---
 .../devicetree/bindings/clock/actions,s900-cmu.txt |  47 +++
 include/dt-bindings/clock/actions,s900-cmu.h   | 139 +
 2 files changed, 186 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/actions,s900-cmu.txt
 create mode 100644 include/dt-bindings/clock/actions,s900-cmu.h

diff --git a/Documentation/devicetree/bindings/clock/actions,s900-cmu.txt 
b/Documentation/devicetree/bindings/clock/actions,s900-cmu.txt
new file mode 100644
index ..93e4fb827cd6
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/actions,s900-cmu.txt
@@ -0,0 +1,47 @@
+* Actions S900 Clock Management Unit (CMU)
+
+The Actions S900 clock management unit generates and supplies clock to various
+controllers within the SoC. The clock binding described here is applicable to
+S900 SoC.
+
+Required Properties:
+
+- compatible: should be "actions,s900-cmu"
+- reg: physical base address of the controller and length of memory mapped
+  region.
+- clocks: Reference to the parent clocks ("hosc", "losc")
+- #clock-cells: should be 1.
+
+Each clock is assigned an identifier, and client nodes can use this identifier
+to specify the clock which they consume.
+
+All available clocks are defined as preprocessor macros in
+dt-bindings/clock/actions,s900-cmu.h header and can be used in device
+tree sources.
+
+External clocks:
+
+The hosc clock used as input for the plls is generated outside the SoC. It is
+expected that it is defined using standard clock bindings as "hosc".
+
+Actions S900 CMU also requires one more clock:
+ - "losc" - internal low frequency oscillator
+
+Example: Clock Management Unit node:
+
+cmu: clock-controller@e016 {
+compatible = "actions,s900-cmu";
+reg = <0x0 0xe016 0x0 0x1000>;
+clocks = <&hosc>, <&losc>;
+#clock-cells = <1>;
+};
+
+Example: UART controller node that consumes clock generated by the clock
+management unit:
+
+uart: serial@e012a000 {
+compatible = "actions,s900-uart", "actions,owl-uart";
+reg = <0x0 0xe012a000 0x0 0x2000>;
+interrupts = ;
+clocks = <&cmu CLK_UART5>;
+};
diff --git a/include/dt-bindings/clock/actions,s900-cmu.h 
b/include/dt-bindings/clock/actions,s900-cmu.h
new file mode 100644
index ..2fa94e19922b
--- /dev/null
+++ b/include/dt-bindings/clock/actions,s900-cmu.h
@@ -0,0 +1,139 @@
+/*
+ * Device Tree binding constants for Actions S900 Clock Management Unit
+ *
+ * Copyright (c) 2014 Actions Semi Inc.
+ * Copyright (c) 2017 Linaro Ltd.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#ifndef __DT_BINDINGS_CLOCK_S900_CMU_H
+#define __DT_BINDINGS_CLOCK_S900_CMU_H
+
+#define CLK_NONE   0
+
+/* fixed rate clocks */
+#define CLK_LOSC   1
+#define CLK_HOSC   2
+
+/* pll clocks */
+#define CLK_CORE_PLL   3
+#define CLK_DEV_PLL4
+#define CLK_DDR_PLL5
+#define CLK_NAND_PLL   6
+#define CLK_DISPLAY_PLL7
+#define CLK_DSI_PLL8
+#define CLK_ASSIST_PLL 9
+#define CLK_AUDIO_PLL  10
+
+/* system clock */
+#define CLK_CPU15
+#define CLK_DEV16
+#define CLK_NOC17
+#define CLK_NOC_MUX18
+#define CLK_NOC_DIV19
+#define CLK_AHB20
+#define CLK_APB21
+#define CLK_DMAC   22
+
+/* peripheral device clock */
+#define CLK_GPIO   23
+
+#define CLK_BISP   24
+#define CLK_CSI0   25
+#define CLK_CSI1   26
+
+#define CLK_DE027
+#define CLK_DE128
+#define CLK_DE229
+#define CLK_DE330
+#define CLK_DSI32
+
+#define CLK_GPU33
+#define CLK_GPU_CORE   34
+#define CLK_GPU_MEM35
+#define CLK_GPU_SYS36
+
+#define CLK_HDE37
+#define CLK_I2C0