devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] clk: sunxi-ng: add missing hdmi-slow clock for H6 CCU
@ 2018-03-19  8:11 Icenowy Zheng
       [not found] ` <20180319081108.23496-1-icenowy-h8G6r0blFSE@public.gmane.org>
  2018-03-19 21:26 ` [PATCH 1/2] clk: sunxi-ng: add missing hdmi-slow clock for H6 CCU Maxime Ripard
  0 siblings, 2 replies; 4+ messages in thread
From: Icenowy Zheng @ 2018-03-19  8:11 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-clk-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Icenowy Zheng

The Allwinner H6 CCU has a "HDMI Slow Clock", which is currently missing
in the ccu-sun50i-h6 driver.

Add this missing clock to the driver.

Fixes: 542353ea ("clk: sunxi-ng: add support for the Allwinner H6 CCU")
Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
---
 drivers/clk/sunxi-ng/ccu-sun50i-h6.c      | 4 ++++
 drivers/clk/sunxi-ng/ccu-sun50i-h6.h      | 2 +-
 include/dt-bindings/clock/sun50i-h6-ccu.h | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
index d5eab49e6350..bdbfe78fe133 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
@@ -643,6 +643,8 @@ static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", hdmi_parents, 0xb00,
 				 BIT(31),	/* gate */
 				 0);
 
+static SUNXI_CCU_GATE(hdmi_slow_clk, "hdmi-slow", "osc24M", 0xb04, BIT(31), 0);
+
 static const char * const hdmi_cec_parents[] = { "osc32k", "pll-periph0-2x" };
 static const struct ccu_mux_fixed_prediv hdmi_cec_predivs[] = {
 	{ .index = 1, .div = 36621 },
@@ -876,6 +878,7 @@ static struct ccu_common *sun50i_h6_ccu_clks[] = {
 	&pcie_aux_clk.common,
 	&bus_pcie_clk.common,
 	&hdmi_clk.common,
+	&hdmi_slow_clk.common,
 	&hdmi_cec_clk.common,
 	&bus_hdmi_clk.common,
 	&bus_tcon_top_clk.common,
@@ -1017,6 +1020,7 @@ static struct clk_hw_onecell_data sun50i_h6_hw_clks = {
 		[CLK_PCIE_AUX]		= &pcie_aux_clk.common.hw,
 		[CLK_BUS_PCIE]		= &bus_pcie_clk.common.hw,
 		[CLK_HDMI]		= &hdmi_clk.common.hw,
+		[CLK_HDMI_SLOW]		= &hdmi_slow_clk.common.hw,
 		[CLK_HDMI_CEC]		= &hdmi_cec_clk.common.hw,
 		[CLK_BUS_HDMI]		= &bus_hdmi_clk.common.hw,
 		[CLK_BUS_TCON_TOP]	= &bus_tcon_top_clk.common.hw,
diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.h b/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
index ad6da4aa733c..ef499a7d45f2 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
@@ -51,6 +51,6 @@
 
 #define CLK_BUS_DRAM		60
 
-#define CLK_NUMBER		137
+#define CLK_NUMBER		(CLK_HDMI_SLOW + 1)
 
 #endif /* _CCU_SUN50I_H6_H_ */
diff --git a/include/dt-bindings/clock/sun50i-h6-ccu.h b/include/dt-bindings/clock/sun50i-h6-ccu.h
index 6045735a2821..205d09d3dc72 100644
--- a/include/dt-bindings/clock/sun50i-h6-ccu.h
+++ b/include/dt-bindings/clock/sun50i-h6-ccu.h
@@ -107,6 +107,7 @@
 #define CLK_PCIE_AUX		121
 #define CLK_BUS_PCIE		122
 #define CLK_HDMI		123
+#define CLK_HDMI_SLOW		137
 #define CLK_HDMI_CEC		124
 #define CLK_BUS_HDMI		125
 #define CLK_BUS_TCON_TOP	126
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] arm64: allwinner: h6: temporarily drop the usage of CCU headers in DTSI
       [not found] ` <20180319081108.23496-1-icenowy-h8G6r0blFSE@public.gmane.org>
@ 2018-03-19  8:11   ` Icenowy Zheng
  2018-03-19 21:27     ` Maxime Ripard
  0 siblings, 1 reply; 4+ messages in thread
From: Icenowy Zheng @ 2018-03-19  8:11 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-clk-u79uwXL29TY76Z2rM5mHXA,
	linux-sunxi-/JYPxA39Uh5TLH3MbocFFw, Icenowy Zheng

As the CCU driver will be merged in different tree with the device tree,
temporarily drop the usage of CCU headers in the DTSI file, and replace
macros with the corresponding numbers.

After they are both merged into Linus' tree, it can be switched back to
use the CCU headers.

Signed-off-by: Icenowy Zheng <icenowy-h8G6r0blFSE@public.gmane.org>
---
 arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
index 4debc3962830..56563150d61a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
@@ -4,8 +4,6 @@
  */
 
 #include <dt-bindings/interrupt-controller/arm-gic.h>
-#include <dt-bindings/clock/sun50i-h6-ccu.h>
-#include <dt-bindings/reset/sun50i-h6-ccu.h>
 
 / {
 	interrupt-parent = <&gic>;
@@ -117,7 +115,7 @@
 				     <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
-			clocks = <&ccu CLK_APB1>, <&osc24M>, <&osc32k>;
+			clocks = <&ccu 26>, <&osc24M>, <&osc32k>;
 			clock-names = "apb", "hosc", "losc";
 			gpio-controller;
 			#gpio-cells = <3>;
@@ -136,8 +134,8 @@
 			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
-			clocks = <&ccu CLK_BUS_UART0>;
-			resets = <&ccu RST_BUS_UART0>;
+			clocks = <&ccu 70>;
+			resets = <&ccu 21>;
 			status = "disabled";
 		};
 
@@ -147,8 +145,8 @@
 			interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
-			clocks = <&ccu CLK_BUS_UART1>;
-			resets = <&ccu RST_BUS_UART1>;
+			clocks = <&ccu 71>;
+			resets = <&ccu 22>;
 			status = "disabled";
 		};
 
@@ -158,8 +156,8 @@
 			interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
-			clocks = <&ccu CLK_BUS_UART2>;
-			resets = <&ccu RST_BUS_UART2>;
+			clocks = <&ccu 72>;
+			resets = <&ccu 23>;
 			status = "disabled";
 		};
 
@@ -169,8 +167,8 @@
 			interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
 			reg-shift = <2>;
 			reg-io-width = <4>;
-			clocks = <&ccu CLK_BUS_UART3>;
-			resets = <&ccu RST_BUS_UART3>;
+			clocks = <&ccu 73>;
+			resets = <&ccu 24>;
 			status = "disabled";
 		};
 	};
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] clk: sunxi-ng: add missing hdmi-slow clock for H6 CCU
  2018-03-19  8:11 [PATCH 1/2] clk: sunxi-ng: add missing hdmi-slow clock for H6 CCU Icenowy Zheng
       [not found] ` <20180319081108.23496-1-icenowy-h8G6r0blFSE@public.gmane.org>
@ 2018-03-19 21:26 ` Maxime Ripard
  1 sibling, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2018-03-19 21:26 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Chen-Yu Tsai, linux-arm-kernel, devicetree, linux-kernel,
	linux-clk, linux-sunxi

[-- Attachment #1: Type: text/plain, Size: 2887 bytes --]

On Mon, Mar 19, 2018 at 04:11:07PM +0800, Icenowy Zheng wrote:
> The Allwinner H6 CCU has a "HDMI Slow Clock", which is currently missing
> in the ccu-sun50i-h6 driver.
> 
> Add this missing clock to the driver.
> 
> Fixes: 542353ea ("clk: sunxi-ng: add support for the Allwinner H6 CCU")
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
>  drivers/clk/sunxi-ng/ccu-sun50i-h6.c      | 4 ++++
>  drivers/clk/sunxi-ng/ccu-sun50i-h6.h      | 2 +-
>  include/dt-bindings/clock/sun50i-h6-ccu.h | 1 +
>  3 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
> index d5eab49e6350..bdbfe78fe133 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
> @@ -643,6 +643,8 @@ static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", hdmi_parents, 0xb00,
>  				 BIT(31),	/* gate */
>  				 0);
>  
> +static SUNXI_CCU_GATE(hdmi_slow_clk, "hdmi-slow", "osc24M", 0xb04, BIT(31), 0);
> +
>  static const char * const hdmi_cec_parents[] = { "osc32k", "pll-periph0-2x" };
>  static const struct ccu_mux_fixed_prediv hdmi_cec_predivs[] = {
>  	{ .index = 1, .div = 36621 },
> @@ -876,6 +878,7 @@ static struct ccu_common *sun50i_h6_ccu_clks[] = {
>  	&pcie_aux_clk.common,
>  	&bus_pcie_clk.common,
>  	&hdmi_clk.common,
> +	&hdmi_slow_clk.common,
>  	&hdmi_cec_clk.common,
>  	&bus_hdmi_clk.common,
>  	&bus_tcon_top_clk.common,
> @@ -1017,6 +1020,7 @@ static struct clk_hw_onecell_data sun50i_h6_hw_clks = {
>  		[CLK_PCIE_AUX]		= &pcie_aux_clk.common.hw,
>  		[CLK_BUS_PCIE]		= &bus_pcie_clk.common.hw,
>  		[CLK_HDMI]		= &hdmi_clk.common.hw,
> +		[CLK_HDMI_SLOW]		= &hdmi_slow_clk.common.hw,
>  		[CLK_HDMI_CEC]		= &hdmi_cec_clk.common.hw,
>  		[CLK_BUS_HDMI]		= &bus_hdmi_clk.common.hw,
>  		[CLK_BUS_TCON_TOP]	= &bus_tcon_top_clk.common.hw,
> diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.h b/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
> index ad6da4aa733c..ef499a7d45f2 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
> +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.h
> @@ -51,6 +51,6 @@
>  
>  #define CLK_BUS_DRAM		60
>  
> -#define CLK_NUMBER		137
> +#define CLK_NUMBER		(CLK_HDMI_SLOW + 1)
>  
>  #endif /* _CCU_SUN50I_H6_H_ */
> diff --git a/include/dt-bindings/clock/sun50i-h6-ccu.h b/include/dt-bindings/clock/sun50i-h6-ccu.h
> index 6045735a2821..205d09d3dc72 100644
> --- a/include/dt-bindings/clock/sun50i-h6-ccu.h
> +++ b/include/dt-bindings/clock/sun50i-h6-ccu.h
> @@ -107,6 +107,7 @@
>  #define CLK_PCIE_AUX		121
>  #define CLK_BUS_PCIE		122
>  #define CLK_HDMI		123
> +#define CLK_HDMI_SLOW		137

It's not been in a release yet, so we can just change the other IDs.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] arm64: allwinner: h6: temporarily drop the usage of CCU headers in DTSI
  2018-03-19  8:11   ` [PATCH 2/2] arm64: allwinner: h6: temporarily drop the usage of CCU headers in DTSI Icenowy Zheng
@ 2018-03-19 21:27     ` Maxime Ripard
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Ripard @ 2018-03-19 21:27 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: devicetree, linux-sunxi, linux-kernel, Chen-Yu Tsai, linux-clk,
	linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 2735 bytes --]

On Mon, Mar 19, 2018 at 04:11:08PM +0800, Icenowy Zheng wrote:
> As the CCU driver will be merged in different tree with the device tree,
> temporarily drop the usage of CCU headers in the DTSI file, and replace
> macros with the corresponding numbers.
> 
> After they are both merged into Linus' tree, it can be switched back to
> use the CCU headers.
> 
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 20 +++++++++-----------
>  1 file changed, 9 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> index 4debc3962830..56563150d61a 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi
> @@ -4,8 +4,6 @@
>   */
>  
>  #include <dt-bindings/interrupt-controller/arm-gic.h>
> -#include <dt-bindings/clock/sun50i-h6-ccu.h>
> -#include <dt-bindings/reset/sun50i-h6-ccu.h>
>  
>  / {
>  	interrupt-parent = <&gic>;
> @@ -117,7 +115,7 @@
>  				     <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>,
>  				     <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
>  				     <GIC_SPI 59 IRQ_TYPE_LEVEL_HIGH>;
> -			clocks = <&ccu CLK_APB1>, <&osc24M>, <&osc32k>;
> +			clocks = <&ccu 26>, <&osc24M>, <&osc32k>;
>  			clock-names = "apb", "hosc", "losc";
>  			gpio-controller;
>  			#gpio-cells = <3>;
> @@ -136,8 +134,8 @@
>  			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
>  			reg-shift = <2>;
>  			reg-io-width = <4>;
> -			clocks = <&ccu CLK_BUS_UART0>;
> -			resets = <&ccu RST_BUS_UART0>;
> +			clocks = <&ccu 70>;
> +			resets = <&ccu 21>;
>  			status = "disabled";
>  		};
>  
> @@ -147,8 +145,8 @@
>  			interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
>  			reg-shift = <2>;
>  			reg-io-width = <4>;
> -			clocks = <&ccu CLK_BUS_UART1>;
> -			resets = <&ccu RST_BUS_UART1>;
> +			clocks = <&ccu 71>;
> +			resets = <&ccu 22>;
>  			status = "disabled";
>  		};
>  
> @@ -158,8 +156,8 @@
>  			interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
>  			reg-shift = <2>;
>  			reg-io-width = <4>;
> -			clocks = <&ccu CLK_BUS_UART2>;
> -			resets = <&ccu RST_BUS_UART2>;
> +			clocks = <&ccu 72>;
> +			resets = <&ccu 23>;
>  			status = "disabled";
>  		};
>  
> @@ -169,8 +167,8 @@
>  			interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
>  			reg-shift = <2>;
>  			reg-io-width = <4>;
> -			clocks = <&ccu CLK_BUS_UART3>;
> -			resets = <&ccu RST_BUS_UART3>;
> +			clocks = <&ccu 73>;
> +			resets = <&ccu 24>;

Thanks, I squashed a similar patch earlier.

Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-03-19 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19  8:11 [PATCH 1/2] clk: sunxi-ng: add missing hdmi-slow clock for H6 CCU Icenowy Zheng
     [not found] ` <20180319081108.23496-1-icenowy-h8G6r0blFSE@public.gmane.org>
2018-03-19  8:11   ` [PATCH 2/2] arm64: allwinner: h6: temporarily drop the usage of CCU headers in DTSI Icenowy Zheng
2018-03-19 21:27     ` Maxime Ripard
2018-03-19 21:26 ` [PATCH 1/2] clk: sunxi-ng: add missing hdmi-slow clock for H6 CCU Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).