Skip to content

Commit 0e1b2f1

Browse files
VDavid003krzk
authored andcommitted
clk: samsung: exynos7885: Add TREX clocks
TREX D Core and P core clocks seem to be related to the BTS (Bus Traffic Shaper) inside the Exynos7885 SoC, and are needed for the SoC to function correctly. When clocks are cut from TREX D Core, the eMMC and the framebuffer stops working properly. Other unknown things may stop working as well. When clocks are cut from TREX P Core, the system locks up needing a hard reset. Add these clocks and mark them critical so that they are always on. Signed-off-by: David Virag <virag.david003@gmail.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Link: https://lore.kernel.org/r/20220601233743.56317-5-virag.david003@gmail.com
1 parent f392db9 commit 0e1b2f1

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

drivers/clk/samsung/clk-exynos7885.c

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -571,13 +571,20 @@ CLK_OF_DECLARE(exynos7885_cmu_peri, "samsung,exynos7885-cmu-peri",
571571
/* ---- CMU_CORE ------------------------------------------------------------ */
572572

573573
/* Register Offset definitions for CMU_CORE (0x12000000) */
574-
#define PLL_CON0_MUX_CLKCMU_CORE_BUS_USER 0x0100
575-
#define PLL_CON0_MUX_CLKCMU_CORE_CCI_USER 0x0120
576-
#define PLL_CON0_MUX_CLKCMU_CORE_G3D_USER 0x0140
577-
#define CLK_CON_MUX_MUX_CLK_CORE_GIC 0x1000
578-
#define CLK_CON_DIV_DIV_CLK_CORE_BUSP 0x1800
579-
#define CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK 0x2054
580-
#define CLK_CON_GAT_GOUT_CORE_GIC400_CLK 0x2058
574+
#define PLL_CON0_MUX_CLKCMU_CORE_BUS_USER 0x0100
575+
#define PLL_CON0_MUX_CLKCMU_CORE_CCI_USER 0x0120
576+
#define PLL_CON0_MUX_CLKCMU_CORE_G3D_USER 0x0140
577+
#define CLK_CON_MUX_MUX_CLK_CORE_GIC 0x1000
578+
#define CLK_CON_DIV_DIV_CLK_CORE_BUSP 0x1800
579+
#define CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK 0x2054
580+
#define CLK_CON_GAT_GOUT_CORE_GIC400_CLK 0x2058
581+
#define CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_ACLK 0x215c
582+
#define CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_GCLK 0x2160
583+
#define CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_PCLK 0x2164
584+
#define CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_ACLK_P_CORE 0x2168
585+
#define CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_CCLK_P_CORE 0x216c
586+
#define CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_PCLK 0x2170
587+
#define CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_PCLK_P_CORE 0x2174
581588

582589
static const unsigned long core_clk_regs[] __initconst = {
583590
PLL_CON0_MUX_CLKCMU_CORE_BUS_USER,
@@ -587,6 +594,13 @@ static const unsigned long core_clk_regs[] __initconst = {
587594
CLK_CON_DIV_DIV_CLK_CORE_BUSP,
588595
CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK,
589596
CLK_CON_GAT_GOUT_CORE_GIC400_CLK,
597+
CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_ACLK,
598+
CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_GCLK,
599+
CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_PCLK,
600+
CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_ACLK_P_CORE,
601+
CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_CCLK_P_CORE,
602+
CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_PCLK,
603+
CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_PCLK_P_CORE,
590604
};
591605

592606
/* List of parent clocks for Muxes in CMU_CORE */
@@ -618,6 +632,27 @@ static const struct samsung_gate_clock core_gate_clks[] __initconst = {
618632
/* GIC (interrupt controller) clock must be always running */
619633
GATE(CLK_GOUT_GIC400_CLK, "gout_gic400_clk", "mout_core_gic",
620634
CLK_CON_GAT_GOUT_CORE_GIC400_CLK, 21, CLK_IS_CRITICAL, 0),
635+
/*
636+
* TREX D and P Core (seems to be related to "bus traffic shaper")
637+
* clocks must always be running
638+
*/
639+
GATE(CLK_GOUT_TREX_D_CORE_ACLK, "gout_trex_d_core_aclk", "mout_core_bus_user",
640+
CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_ACLK, 21, CLK_IS_CRITICAL, 0),
641+
GATE(CLK_GOUT_TREX_D_CORE_GCLK, "gout_trex_d_core_gclk", "mout_core_g3d_user",
642+
CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_GCLK, 21, CLK_IS_CRITICAL, 0),
643+
GATE(CLK_GOUT_TREX_D_CORE_PCLK, "gout_trex_d_core_pclk", "dout_core_busp",
644+
CLK_CON_GAT_GOUT_CORE_TREX_D_CORE_PCLK, 21, CLK_IS_CRITICAL, 0),
645+
GATE(CLK_GOUT_TREX_P_CORE_ACLK_P_CORE, "gout_trex_p_core_aclk_p_core",
646+
"mout_core_bus_user", CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_ACLK_P_CORE, 21,
647+
CLK_IS_CRITICAL, 0),
648+
GATE(CLK_GOUT_TREX_P_CORE_CCLK_P_CORE, "gout_trex_p_core_cclk_p_core",
649+
"mout_core_cci_user", CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_CCLK_P_CORE, 21,
650+
CLK_IS_CRITICAL, 0),
651+
GATE(CLK_GOUT_TREX_P_CORE_PCLK, "gout_trex_p_core_pclk", "dout_core_busp",
652+
CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_PCLK, 21, CLK_IS_CRITICAL, 0),
653+
GATE(CLK_GOUT_TREX_P_CORE_PCLK_P_CORE, "gout_trex_p_core_pclk_p_core",
654+
"dout_core_busp", CLK_CON_GAT_GOUT_CORE_TREX_P_CORE_PCLK_P_CORE, 21,
655+
CLK_IS_CRITICAL, 0),
621656
};
622657

623658
static const struct samsung_cmu_info core_cmu_info __initconst = {

0 commit comments

Comments
 (0)