diff mbox

[v2,1/6] ARM: dts: r8a73a4: Add INTC-SYS clock to device tree

Message ID 1488819491-26097-2-git-send-email-geert+renesas@glider.be (mailing list archive)
State Accepted
Commit c11333cc2e7ebe41e2aa4fa353abafa1f21a0662
Delegated to: Simon Horman
Headers show

Commit Message

Geert Uytterhoeven March 6, 2017, 4:58 p.m. UTC
Link the ARM GIC to the INTC-SYS module clock and the C4 power domain,
so it can be power managed using that clock in the future.

Note that currently the GIC-400 driver doesn't support module clocks nor
Runtime PM, so this must be handled as a critical clock.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
v2:
  - Add missing "power-domains" property,
  - Add clock-names property,
  - Drop RFC status,
  - Change one-line summary prefix to match current arm-soc practices,
  - s/GIC driver/GIC-400 driver/,
  - Document critical clock dependency.
---
 arch/arm/boot/dts/r8a73a4.dtsi            | 13 +++++++++----
 include/dt-bindings/clock/r8a73a4-clock.h |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

Comments

Sergei Shtylyov March 7, 2017, 9:27 a.m. UTC | #1
Hello!

On 3/6/2017 7:58 PM, Geert Uytterhoeven wrote:

> Link the ARM GIC to the INTC-SYS module clock and the C4 power domain,
> so it can be power managed using that clock in the future.
>
> Note that currently the GIC-400 driver doesn't support module clocks nor
> Runtime PM, so this must be handled as a critical clock.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> v2:
>   - Add missing "power-domains" property,
>   - Add clock-names property,
>   - Drop RFC status,
>   - Change one-line summary prefix to match current arm-soc practices,
>   - s/GIC driver/GIC-400 driver/,
>   - Document critical clock dependency.
> ---
>  arch/arm/boot/dts/r8a73a4.dtsi            | 13 +++++++++----
>  include/dt-bindings/clock/r8a73a4-clock.h |  1 +
>  2 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi
> index 6fb7eaba91262edf..1f5c9f6dddba9366 100644
> --- a/arch/arm/boot/dts/r8a73a4.dtsi
> +++ b/arch/arm/boot/dts/r8a73a4.dtsi
> @@ -467,6 +467,9 @@
>  			<0 0xf1004000 0 0x2000>,
>  			<0 0xf1006000 0 0x2000>;
>  		interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
> +		clocks = <&mstp4_clks R8A73A4_CLK_INTC_SYS>;
> +		clock-names = "clk";

    Do we really need such "clock-names"?

[...]

MBR, Sergei
Geert Uytterhoeven March 7, 2017, 9:49 a.m. UTC | #2
Hi Sergei,

On Tue, Mar 7, 2017 at 10:27 AM, Sergei Shtylyov
<sergei.shtylyov@cogentembedded.com> wrote:
> On 3/6/2017 7:58 PM, Geert Uytterhoeven wrote:
>> Link the ARM GIC to the INTC-SYS module clock and the C4 power domain,
>> so it can be power managed using that clock in the future.
>>
>> Note that currently the GIC-400 driver doesn't support module clocks nor
>> Runtime PM, so this must be handled as a critical clock.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>> v2:
>>   - Add missing "power-domains" property,
>>   - Add clock-names property,
>>   - Drop RFC status,
>>   - Change one-line summary prefix to match current arm-soc practices,
>>   - s/GIC driver/GIC-400 driver/,
>>   - Document critical clock dependency.
>> ---
>>  arch/arm/boot/dts/r8a73a4.dtsi            | 13 +++++++++----
>>  include/dt-bindings/clock/r8a73a4-clock.h |  1 +
>>  2 files changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm/boot/dts/r8a73a4.dtsi
>> b/arch/arm/boot/dts/r8a73a4.dtsi
>> index 6fb7eaba91262edf..1f5c9f6dddba9366 100644
>> --- a/arch/arm/boot/dts/r8a73a4.dtsi
>> +++ b/arch/arm/boot/dts/r8a73a4.dtsi
>> @@ -467,6 +467,9 @@
>>                         <0 0xf1004000 0 0x2000>,
>>                         <0 0xf1006000 0 0x2000>;
>>                 interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) |
>> IRQ_TYPE_LEVEL_HIGH)>;
>> +               clocks = <&mstp4_clks R8A73A4_CLK_INTC_SYS>;
>> +               clock-names = "clk";
>
>    Do we really need such "clock-names"?

Yes. The ARM/GIC maintainers objected against not using clock-names, as
some GIC variants have multiple clocks.
Hence commit afbbd23381767aec ("irqchip/gic: Document optional Clock and
Power Domain properties") was born...

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox

Patch

diff --git a/arch/arm/boot/dts/r8a73a4.dtsi b/arch/arm/boot/dts/r8a73a4.dtsi
index 6fb7eaba91262edf..1f5c9f6dddba9366 100644
--- a/arch/arm/boot/dts/r8a73a4.dtsi
+++ b/arch/arm/boot/dts/r8a73a4.dtsi
@@ -467,6 +467,9 @@ 
 			<0 0xf1004000 0 0x2000>,
 			<0 0xf1006000 0 0x2000>;
 		interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
+		clocks = <&mstp4_clks R8A73A4_CLK_INTC_SYS>;
+		clock-names = "clk";
+		power-domains = <&pd_c4>;
 	};
 
 	bsc: bus@fec10000 {
@@ -725,16 +728,18 @@ 
 		mstp4_clks: mstp4_clks@e6150140 {
 			compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks";
 			reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>;
-			clocks = <&main_div2_clk>, <&main_div2_clk>,
+			clocks = <&main_div2_clk>, <&cpg_clocks R8A73A4_CLK_ZS>,
+				 <&main_div2_clk>,
 				 <&cpg_clocks R8A73A4_CLK_HP>,
 				 <&cpg_clocks R8A73A4_CLK_HP>;
 			#clock-cells = <1>;
 			clock-indices = <
-				R8A73A4_CLK_IRQC R8A73A4_CLK_IIC5
-				R8A73A4_CLK_IIC4 R8A73A4_CLK_IIC3
+				R8A73A4_CLK_IRQC R8A73A4_CLK_INTC_SYS
+				R8A73A4_CLK_IIC5 R8A73A4_CLK_IIC4
+				R8A73A4_CLK_IIC3
 			>;
 			clock-output-names =
-				"irqc", "iic5", "iic4", "iic3";
+				"irqc", "intc-sys", "iic5", "iic4", "iic3";
 		};
 		mstp5_clks: mstp5_clks@e6150144 {
 			compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks";
diff --git a/include/dt-bindings/clock/r8a73a4-clock.h b/include/dt-bindings/clock/r8a73a4-clock.h
index dd11ecdf837e8e65..4b36681572570c15 100644
--- a/include/dt-bindings/clock/r8a73a4-clock.h
+++ b/include/dt-bindings/clock/r8a73a4-clock.h
@@ -54,6 +54,7 @@ 
 #define R8A73A4_CLK_IIC3	11
 #define R8A73A4_CLK_IIC4	10
 #define R8A73A4_CLK_IIC5	9
+#define R8A73A4_CLK_INTC_SYS	8
 #define R8A73A4_CLK_IRQC	7
 
 /* MSTP5 */