clk: sunxi-ng: Add support for A83T's PRCM
Subsystems (3)
v2 cover clk: sunxi-ng: Add support for A83T's PRCM
Hi everyone,
This is the remaining parts of my A83T PRCM support series, along with changes requested by Maxime.
Patch 1 updates the device tree bindings for the PRCM, adding pll-periph to the list of required clocks
Patch 2 adds a device node for the PRCM on the A83T SoC, updated from v1 to include the pll-periph clock.
Patch 3 exports the PLL_PERIPH0 clock from the CCU on the H3/H5, for consumption by the PRCM.
Patch 4 adds the pll-periph clock to the PRCM device node on the H3/H5.
Patch 5 / 6 are the same as 3 / 4, but for the A64.
Excerpt from v1 cover letter:
This series adds support for the A83T's PRCM to the existing sun8i-r-ccu driver. When the sun8i-r-ccu driver was introduced, indices were reserved for all the possible clocks and resets of the sun8i family. In patch 2 we simply pick existing clocks, and implement ones that are different or missing.
Differences from other sun8i implementations include different clock parent names, due to the A83T not having a proper 32.768 kHz oscillator, and different predividers for the IR clock.
Still to come are support for R_PIO and RSB on the A83T.
Regards
ChenYu
Chen-Yu Tsai (6):
dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
ARM: sun8i: a83t: Add device node for PRCM
clk: sunxi-ng: h3: Export PLL_PERIPH0 clock for the PRCM
ARM: sunxi: h3-h5: Add PLL_PERIPH0 clock to the R_CCU
clk: sunxi-ng: a64: Export PLL_PERIPH0 clock for the PRCM
arm64: allwinner: a64: Add PLL_PERIPH0 clock to the R_CCU
Documentation/devicetree/bindings/clock/sunxi-ccu.txt | 7 ++++--- arch/arm/boot/dts/sun8i-a83t.dtsi | 10 ++++++++++ arch/arm/boot/dts/sunxi-h3-h5.dtsi | 5 +++-- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++-- drivers/clk/sunxi-ng/ccu-sun50i-a64.h | 4 +++- drivers/clk/sunxi-ng/ccu-sun8i-h3.h | 4 +++- include/dt-bindings/clock/sun50i-a64-ccu.h | 2 ++ include/dt-bindings/clock/sun8i-h3-ccu.h | 2 ++ 8 files changed, 30 insertions(+), 9 deletions(-)
Signature · 1 line
2.11.0
PATCH v2 1/6 dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
The AR100 clock in the PRCM has parents, one of which is pll-periph from the main CCU.
Add it to the list of required clocks for the PRCM CCU.
--- Documentation/devicetree/bindings/clock/sunxi-ccu.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/clock/sunxi-ccu.txt +4 -3
@@ -25,7 +25,8 @@ Required properties : - #clock-cells : must contain 1 - #reset-cells : must contain 1 -For the PRCM CCUs on A83T/H3/A64, one more clock is needed: +For the PRCM CCUs on A83T/H3/A64, two more clock is needed: +- "pll-periph": the SoC's peripheral PLL from the main CCU - "iosc": the SoC's internal frequency oscillator Example for generic CCU:
@@ -42,8 +43,8 @@ Example for PRCM CCU: r_ccu: clock at 01f01400 { compatible = "allwinner,sun50i-a64-r-ccu"; reg = <0x01f01400 0x100>; - clocks = <&osc24M>, <&osc32k>, <&iosc>; - clock-names = "hosc", "losc", "iosc"; + clocks = <&osc24M>, <&osc32k>, <&iosc>, <&ccu CLK_PLL_PERIPH0>; + clock-names = "hosc", "losc", "iosc", "pll-periph"; #clock-cells = <1>; #reset-cells = <1>; };
Signature · 1 line
2.11.0
PATCH v2 1/6 dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
Hi!
Dne sreda, 31. maj 2017 ob 09:58:19 CEST je Chen-Yu Tsai napisal(a):
Quoted 16 lines
The AR100 clock in the PRCM has parents, one of which is pll-periph from the main CCU.
Add it to the list of required clocks for the PRCM CCU.
Signed-off-by Chen-Yu Tsai <[email protected]>--- Documentation/devicetree/bindings/clock/sunxi-ccu.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)(quoted diff) +0
-0
b/Documentation/devicetree/bindings/clock/sunxi-ccu.txtindex095a5807d874..966345972d83100644
Documentation/devicetree/bindings/clock/sunxi-ccu.txt Required properties : · line 28
Quoted 5 lines
Documentation/devicetree/bindings/clock/sunxi-ccu.txt +1
-1@@ -25,7 +25,8 @@ Required properties : - #clock-cells : must contain 1 - #reset-cells : must contain 1 -For the PRCM CCUs on A83T/H3/A64, one more clock is needed: +For the PRCM CCUs on A83T/H3/A64, two more clock is needed:
nit: s/clock is/clocks are/
Best regards,
Jernej
Quoted 23 lines
Documentation/devicetree/bindings/clock/sunxi-ccu.txt +3
-3+- "pll-periph": the SoC's peripheral PLL from the main CCU - "iosc": the SoC's internal frequency oscillator Example for generic CCU:@@ -42,8 +43,8 @@ Example for PRCM CCU: r_ccu: clock at 01f01400 { compatible = "allwinner,sun50i-a64-r-ccu"; reg = <0x01f01400 0x100>; - clocks = <&osc24M>, <&osc32k>, <&iosc>; - clock-names = "hosc", "losc", "iosc"; + clocks = <&osc24M>, <&osc32k>, <&iosc>, <&ccu CLK_PLL_PERIPH0>; + clock-names = "hosc", "losc", "iosc", "pll-periph"; #clock-cells = <1>; #reset-cells = <1>; }; --2.11.0
--
You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Rob Herring
maintainerPATCH v2 1/6 dt-bindings: clock: sunxi-ccu: Add pll-periph to PRCM's needed clocks
In reply to Chen-Yu TsaiQuoted 9 lines · Chen-Yu Tsai
The AR100 clock in the PRCM has parents, one of which is pll-periph from the main CCU.
Add it to the list of required clocks for the PRCM CCU.
Signed-off-by Chen-Yu Tsai <[email protected]>--- Documentation/devicetree/bindings/clock/sunxi-ccu.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
PATCH v2 2/6 ARM: sun8i: a83t: Add device node for PRCM
In reply to Chen-Yu TsaiThe A83T's PRCM has the same set of clocks and resets as the A64. However, a few dividers are different. And due to the lack of a low speed 32.768 kHz oscillator, a few of the clock parents are different.
The PRCM also has controls for various power domains. These are not supported yet, neither in software nor in the device tree binding.
--- arch/arm/boot/dts/sun8i-a83t.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/sun8i-a83t.dtsi +10 -0
@@ -270,5 +270,15 @@ #interrupt-cells = <3>; interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(8) | IRQ_TYPE_LEVEL_HIGH)>; }; + + r_ccu: clock at 1f01400 { + compatible = "allwinner,sun8i-a83t-r-ccu"; + reg = <0x01f01400 0x400>; + clocks = <&osc24M>, <&osc16Md512>, <&osc16M>, + <&ccu 6>; + clock-names = "hosc", "losc", "iosc", "pll-periph"; + #clock-cells = <1>; + #reset-cells = <1>; + }; }; };
Signature · 1 line
2.11.0
PATCH v2 3/6 clk: sunxi-ng: h3: Export PLL_PERIPH0 clock for the PRCM
In reply to Chen-Yu TsaiThe PRCM takes PLL_PERIPH0 as one of its parents for the AR100 clock. As such we need to be able to describe this relationship in the device tree.
Export the PLL_PERIPH0 clock so we can reference it in the PRCM node.
--- drivers/clk/sunxi-ng/ccu-sun8i-h3.h | 4 +++- include/dt-bindings/clock/sun8i-h3-ccu.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun8i-h3.h +3 -1
@@ -29,7 +29,9 @@#define CLK_PLL_VIDEO 6#define CLK_PLL_VE 7#define CLK_PLL_DDR 8 -#define CLK_PLL_PERIPH0 9 + +/* PLL_PERIPH0 exported for PRCM */ +#define CLK_PLL_PERIPH0_2X 10#define CLK_PLL_GPU 11#define CLK_PLL_PERIPH1 12
include/dt-bindings/clock/sun8i-h3-ccu.h +2 -0
@@ -43,6 +43,8 @@#ifndef _DT_BINDINGS_CLK_SUN8I_H3_H_#define _DT_BINDINGS_CLK_SUN8I_H3_H_ +#define CLK_PLL_PERIPH0 9 +#define CLK_CPUX 14#define CLK_BUS_CE 20
Signature · 1 line
2.11.0
PATCH v2 4/6 ARM: sunxi: h3-h5: Add PLL_PERIPH0 clock to the R_CCU
In reply to Chen-Yu TsaiThe AR100 clock within the R_CCU (PRCM) has the PLL_PERIPH0 as one of its parents.
This adds the reference in the device tree describing this relationship. This patch uses a raw number for the clock index to ease merging by avoiding cross tree dependencies.
--- arch/arm/boot/dts/sunxi-h3-h5.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/boot/dts/sunxi-h3-h5.dtsi +3 -2
@@ -560,8 +560,9 @@ r_ccu: clock at 1f01400 { compatible = "allwinner,sun8i-h3-r-ccu"; reg = <0x01f01400 0x100>; - clocks = <&osc24M>, <&osc32k>, <&iosc>; - clock-names = "hosc", "losc", "iosc"; + clocks = <&osc24M>, <&osc32k>, <&iosc>, + <&ccu 9>; + clock-names = "hosc", "losc", "iosc", "pll-periph"; #clock-cells = <1>; #reset-cells = <1>; };
Signature · 1 line
2.11.0
PATCH v2 5/6 clk: sunxi-ng: a64: Export PLL_PERIPH0 clock for the PRCM
In reply to Chen-Yu TsaiThe PRCM takes PLL_PERIPH0 as one of its parents for the AR100 clock. As such we need to be able to describe this relationship in the device tree.
Export the PLL_PERIPH0 clock so we can reference it in the PRCM node.
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.h | 4 +++- include/dt-bindings/clock/sun50i-a64-ccu.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun50i-a64.h +3 -1
@@ -31,7 +31,9 @@#define CLK_PLL_VIDEO0_2X 8#define CLK_PLL_VE 9#define CLK_PLL_DDR0 10 -#define CLK_PLL_PERIPH0 11 + +/* PLL_PERIPH0 exported for PRCM */ +#define CLK_PLL_PERIPH0_2X 12#define CLK_PLL_PERIPH1 13#define CLK_PLL_PERIPH1_2X 14
include/dt-bindings/clock/sun50i-a64-ccu.h +2 -0
@@ -43,6 +43,8 @@#ifndef _DT_BINDINGS_CLK_SUN50I_A64_H_#define _DT_BINDINGS_CLK_SUN50I_A64_H_ +#define CLK_PLL_PERIPH0 11 +#define CLK_BUS_MIPI_DSI 28#define CLK_BUS_CE 29#define CLK_BUS_DMA 30
Signature · 1 line
2.11.0
PATCH v2 6/6 arm64: allwinner: a64: Add PLL_PERIPH0 clock to the R_CCU
In reply to Chen-Yu TsaiThe AR100 clock within the R_CCU (PRCM) has the PLL_PERIPH0 as one of its parents.
This adds the reference in the device tree describing this relationship. This patch uses a raw number for the clock index to ease merging by avoiding cross tree dependencies.
--- arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 -2
@@ -448,8 +448,9 @@ r_ccu: clock at 1f01400 { compatible = "allwinner,sun50i-a64-r-ccu"; reg = <0x01f01400 0x100>; - clocks = <&osc24M>, <&osc32k>, <&iosc>; - clock-names = "hosc", "losc", "iosc"; + clocks = <&osc24M>, <&osc32k>, <&iosc>, + <&ccu 11>; + clock-names = "hosc", "losc", "iosc", "pll-periph"; #clock-cells = <1>; #reset-cells = <1>; };
Signature · 1 line
2.11.0
Maxime Ripard
Appliedv2 cover clk: sunxi-ng: Add support for A83T's PRCM
In reply to Chen-Yu TsaiQuoted 11 lines · Chen-Yu Tsai
Hi everyone,
This is the remaining parts of my A83T PRCM support series, along with changes requested by Maxime.
Patch 1 updates the device tree bindings for the PRCM, adding pll-periph to the list of required clocks
Patch 2 adds a device node for the PRCM on the A83T SoC, updated from v1 to include the pll-periph clock.
Quoted 6 lines
Patch 3 exports the
PLL_PERIPH0clock from the CCU on the H3/H5, for consumption by the PRCM.Patch 4 adds the pll-periph clock to the PRCM device node on the H3/H5.
Patch 5 / 6 are the same as 3 / 4, but for the A64.
Applied, thanks!
Maxime
Signature · 10 lines
Maxime Ripard, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20170531/c6714919/attachment.sig>