Skip to content

Commit

Permalink
clk: samsung: exynos5433: Add support for runtime PM
Browse files Browse the repository at this point in the history
Add runtime pm support for all clock controller units (CMU), which belong
to power domains and require special handling during on/off operations.
Typically special values has to be written to MUX registers to change
internal clocks parents to OSC clock before turning power off. During such
operation all clocks, which enter CMU has to be enabled to let MUX to
stabilize. Also for each CMU there is one special parent clock, which has
to be enabled all the time when any access to CMU registers is being done.

This patch solves most of the mysterious external abort and freeze issues
caused by a lack of proper parent CMU clock enabled or incorrect turn off
procedure.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
Link: lkml.kernel.org/r/1503302703-13801-4-git-send-email-m.szyprowski@samsung.com
  • Loading branch information
mszyprow authored and mturquette committed Sep 7, 2017
1 parent d2f18d7 commit 523d3de
Show file tree
Hide file tree
Showing 3 changed files with 346 additions and 85 deletions.
16 changes: 16 additions & 0 deletions Documentation/devicetree/bindings/clock/exynos5433-clock.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ Required Properties:
- aclk_cam1_400
- aclk_cam1_552

Optional properties:
- power-domains: a phandle to respective power domain node as described by
generic PM domain bindings (see power/power_domain.txt for more
information).

Each clock is assigned an identifier and client nodes can use this identifier
to specify the clock which they consume.

Expand Down Expand Up @@ -270,6 +275,7 @@ Example 2: Examples of clock controller nodes are listed below.
clocks = <&xxti>,
<&cmu_top CLK_ACLK_G2D_266>,
<&cmu_top CLK_ACLK_G2D_400>;
power-domains = <&pd_g2d>;
};

cmu_disp: clock-controller@13b90000 {
Expand All @@ -295,6 +301,7 @@ Example 2: Examples of clock controller nodes are listed below.
<&cmu_mif CLK_SCLK_DECON_ECLK_DISP>,
<&cmu_mif CLK_SCLK_DECON_TV_VCLK_DISP>,
<&cmu_mif CLK_ACLK_DISP_333>;
power-domains = <&pd_disp>;
};

cmu_aud: clock-controller@114c0000 {
Expand All @@ -304,6 +311,7 @@ Example 2: Examples of clock controller nodes are listed below.

clock-names = "oscclk", "fout_aud_pll";
clocks = <&xxti>, <&cmu_top CLK_FOUT_AUD_PLL>;
power-domains = <&pd_aud>;
};

cmu_bus0: clock-controller@13600000 {
Expand Down Expand Up @@ -340,6 +348,7 @@ Example 2: Examples of clock controller nodes are listed below.

clock-names = "oscclk", "aclk_g3d_400";
clocks = <&xxti>, <&cmu_top CLK_ACLK_G3D_400>;
power-domains = <&pd_g3d>;
};

cmu_gscl: clock-controller@13cf0000 {
Expand All @@ -353,6 +362,7 @@ Example 2: Examples of clock controller nodes are listed below.
clocks = <&xxti>,
<&cmu_top CLK_ACLK_GSCL_111>,
<&cmu_top CLK_ACLK_GSCL_333>;
power-domains = <&pd_gscl>;
};

cmu_apollo: clock-controller@11900000 {
Expand Down Expand Up @@ -384,6 +394,7 @@ Example 2: Examples of clock controller nodes are listed below.
clocks = <&xxti>,
<&cmu_top CLK_SCLK_JPEG_MSCL>,
<&cmu_top CLK_ACLK_MSCL_400>;
power-domains = <&pd_mscl>;
};

cmu_mfc: clock-controller@15280000 {
Expand All @@ -393,6 +404,7 @@ Example 2: Examples of clock controller nodes are listed below.

clock-names = "oscclk", "aclk_mfc_400";
clocks = <&xxti>, <&cmu_top CLK_ACLK_MFC_400>;
power-domains = <&pd_mfc>;
};

cmu_hevc: clock-controller@14f80000 {
Expand All @@ -402,6 +414,7 @@ Example 2: Examples of clock controller nodes are listed below.

clock-names = "oscclk", "aclk_hevc_400";
clocks = <&xxti>, <&cmu_top CLK_ACLK_HEVC_400>;
power-domains = <&pd_hevc>;
};

cmu_isp: clock-controller@146d0000 {
Expand All @@ -415,6 +428,7 @@ Example 2: Examples of clock controller nodes are listed below.
clocks = <&xxti>,
<&cmu_top CLK_ACLK_ISP_DIS_400>,
<&cmu_top CLK_ACLK_ISP_400>;
power-domains = <&pd_isp>;
};

cmu_cam0: clock-controller@120d0000 {
Expand All @@ -430,6 +444,7 @@ Example 2: Examples of clock controller nodes are listed below.
<&cmu_top CLK_ACLK_CAM0_333>,
<&cmu_top CLK_ACLK_CAM0_400>,
<&cmu_top CLK_ACLK_CAM0_552>;
power-domains = <&pd_cam0>;
};

cmu_cam1: clock-controller@145d0000 {
Expand All @@ -451,6 +466,7 @@ Example 2: Examples of clock controller nodes are listed below.
<&cmu_top CLK_ACLK_CAM1_333>,
<&cmu_top CLK_ACLK_CAM1_400>,
<&cmu_top CLK_ACLK_CAM1_552>;
power-domains = <&pd_cam1>;
};

Example 3: UART controller node that consumes the clock generated by the clock
Expand Down
Loading

0 comments on commit 523d3de

Please sign in to comment.