145bd8166SDavid Virag // SPDX-License-Identifier: GPL-2.0-only 245bd8166SDavid Virag /* 345bd8166SDavid Virag * Copyright (C) 2021 Dávid Virág <virag.david003@gmail.com> 445bd8166SDavid Virag * Author: Dávid Virág <virag.david003@gmail.com> 545bd8166SDavid Virag * 645bd8166SDavid Virag * Common Clock Framework support for Exynos7885 SoC. 745bd8166SDavid Virag */ 845bd8166SDavid Virag 945bd8166SDavid Virag #include <linux/clk.h> 1045bd8166SDavid Virag #include <linux/clk-provider.h> 1145bd8166SDavid Virag #include <linux/of.h> 1245bd8166SDavid Virag #include <linux/of_device.h> 1345bd8166SDavid Virag #include <linux/platform_device.h> 1445bd8166SDavid Virag 1545bd8166SDavid Virag #include <dt-bindings/clock/exynos7885.h> 1645bd8166SDavid Virag 1745bd8166SDavid Virag #include "clk.h" 1845bd8166SDavid Virag #include "clk-exynos-arm64.h" 1945bd8166SDavid Virag 2045bd8166SDavid Virag /* ---- CMU_TOP ------------------------------------------------------------- */ 2145bd8166SDavid Virag 2245bd8166SDavid Virag /* Register Offset definitions for CMU_TOP (0x12060000) */ 2345bd8166SDavid Virag #define PLL_LOCKTIME_PLL_SHARED0 0x0000 2445bd8166SDavid Virag #define PLL_LOCKTIME_PLL_SHARED1 0x0004 2545bd8166SDavid Virag #define PLL_CON0_PLL_SHARED0 0x0100 2645bd8166SDavid Virag #define PLL_CON0_PLL_SHARED1 0x0120 2745bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_CORE_BUS 0x1014 2845bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_CORE_CCI 0x1018 2945bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_CORE_G3D 0x101c 30*f392db97SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_FSYS_BUS 0x1028 31*f392db97SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_CARD 0x102c 32*f392db97SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_EMBD 0x1030 33*f392db97SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_SDIO 0x1034 34*f392db97SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_FSYS_USB30DRD 0x1038 3545bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_BUS 0x1058 3645bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_SPI0 0x105c 3745bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_SPI1 0x1060 3845bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_UART0 0x1064 3945bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_UART1 0x1068 4045bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_UART2 0x106c 4145bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_USI0 0x1070 4245bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_USI1 0x1074 4345bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLKCMU_PERI_USI2 0x1078 4445bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_CORE_BUS 0x181c 4545bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_CORE_CCI 0x1820 4645bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_CORE_G3D 0x1824 47*f392db97SDavid Virag #define CLK_CON_DIV_CLKCMU_FSYS_BUS 0x1844 48*f392db97SDavid Virag #define CLK_CON_DIV_CLKCMU_FSYS_MMC_CARD 0x1848 49*f392db97SDavid Virag #define CLK_CON_DIV_CLKCMU_FSYS_MMC_EMBD 0x184c 50*f392db97SDavid Virag #define CLK_CON_DIV_CLKCMU_FSYS_MMC_SDIO 0x1850 51*f392db97SDavid Virag #define CLK_CON_DIV_CLKCMU_FSYS_USB30DRD 0x1854 5245bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_BUS 0x1874 5345bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_SPI0 0x1878 5445bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_SPI1 0x187c 5545bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_UART0 0x1880 5645bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_UART1 0x1884 5745bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_UART2 0x1888 5845bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_USI0 0x188c 5945bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_USI1 0x1890 6045bd8166SDavid Virag #define CLK_CON_DIV_CLKCMU_PERI_USI2 0x1894 6145bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED0_DIV2 0x189c 6245bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED0_DIV3 0x18a0 6345bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED0_DIV4 0x18a4 6445bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED0_DIV5 0x18a8 6545bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED1_DIV2 0x18ac 6645bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED1_DIV3 0x18b0 6745bd8166SDavid Virag #define CLK_CON_DIV_PLL_SHARED1_DIV4 0x18b4 6845bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMUC_PERI_UART1 0x2004 6945bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_CORE_BUS 0x201c 7045bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_CORE_CCI 0x2020 7145bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_CORE_G3D 0x2024 72*f392db97SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_FSYS_BUS 0x2044 73*f392db97SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_CARD 0x2048 74*f392db97SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_EMBD 0x204c 75*f392db97SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_SDIO 0x2050 76*f392db97SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_FSYS_USB30DRD 0x2054 7745bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_BUS 0x207c 7845bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_SPI0 0x2080 7945bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_SPI1 0x2084 8045bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_UART0 0x2088 8145bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_UART2 0x208c 8245bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_USI0 0x2090 8345bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_USI1 0x2094 8445bd8166SDavid Virag #define CLK_CON_GAT_GATE_CLKCMU_PERI_USI2 0x2098 8545bd8166SDavid Virag 8645bd8166SDavid Virag static const unsigned long top_clk_regs[] __initconst = { 8745bd8166SDavid Virag PLL_LOCKTIME_PLL_SHARED0, 8845bd8166SDavid Virag PLL_LOCKTIME_PLL_SHARED1, 8945bd8166SDavid Virag PLL_CON0_PLL_SHARED0, 9045bd8166SDavid Virag PLL_CON0_PLL_SHARED1, 9145bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_CORE_BUS, 9245bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_CORE_CCI, 9345bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_CORE_G3D, 94*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_BUS, 95*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_CARD, 96*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_EMBD, 97*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_SDIO, 98*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_USB30DRD, 9945bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_BUS, 10045bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_SPI0, 10145bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_SPI1, 10245bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_UART0, 10345bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_UART1, 10445bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_UART2, 10545bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_USI0, 10645bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_USI1, 10745bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_USI2, 10845bd8166SDavid Virag CLK_CON_DIV_CLKCMU_CORE_BUS, 10945bd8166SDavid Virag CLK_CON_DIV_CLKCMU_CORE_CCI, 11045bd8166SDavid Virag CLK_CON_DIV_CLKCMU_CORE_G3D, 111*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_BUS, 112*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_MMC_CARD, 113*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_MMC_EMBD, 114*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_MMC_SDIO, 115*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_USB30DRD, 11645bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_BUS, 11745bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_SPI0, 11845bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_SPI1, 11945bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_UART0, 12045bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_UART1, 12145bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_UART2, 12245bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_USI0, 12345bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_USI1, 12445bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_USI2, 12545bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV2, 12645bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV3, 12745bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV4, 12845bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV5, 12945bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED1_DIV2, 13045bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED1_DIV3, 13145bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED1_DIV4, 13245bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMUC_PERI_UART1, 13345bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_CORE_BUS, 13445bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_CORE_CCI, 13545bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_CORE_G3D, 136*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_BUS, 137*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_CARD, 138*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_EMBD, 139*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_SDIO, 140*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_USB30DRD, 14145bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_BUS, 14245bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_SPI0, 14345bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_SPI1, 14445bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_UART0, 14545bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_UART2, 14645bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_USI0, 14745bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_USI1, 14845bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_USI2, 14945bd8166SDavid Virag }; 15045bd8166SDavid Virag 15145bd8166SDavid Virag static const struct samsung_pll_clock top_pll_clks[] __initconst = { 15245bd8166SDavid Virag PLL(pll_1417x, CLK_FOUT_SHARED0_PLL, "fout_shared0_pll", "oscclk", 15345bd8166SDavid Virag PLL_LOCKTIME_PLL_SHARED0, PLL_CON0_PLL_SHARED0, 15445bd8166SDavid Virag NULL), 15545bd8166SDavid Virag PLL(pll_1417x, CLK_FOUT_SHARED1_PLL, "fout_shared1_pll", "oscclk", 15645bd8166SDavid Virag PLL_LOCKTIME_PLL_SHARED1, PLL_CON0_PLL_SHARED1, 15745bd8166SDavid Virag NULL), 15845bd8166SDavid Virag }; 15945bd8166SDavid Virag 16045bd8166SDavid Virag /* List of parent clocks for Muxes in CMU_TOP: for CMU_CORE */ 16145bd8166SDavid Virag PNAME(mout_core_bus_p) = { "dout_shared0_div2", "dout_shared1_div2", 16245bd8166SDavid Virag "dout_shared0_div3", "dout_shared0_div3" }; 16345bd8166SDavid Virag PNAME(mout_core_cci_p) = { "dout_shared0_div2", "dout_shared1_div2", 16445bd8166SDavid Virag "dout_shared0_div3", "dout_shared0_div3" }; 16545bd8166SDavid Virag PNAME(mout_core_g3d_p) = { "dout_shared0_div2", "dout_shared1_div2", 16645bd8166SDavid Virag "dout_shared0_div3", "dout_shared0_div3" }; 16745bd8166SDavid Virag 16845bd8166SDavid Virag /* List of parent clocks for Muxes in CMU_TOP: for CMU_PERI */ 16945bd8166SDavid Virag PNAME(mout_peri_bus_p) = { "dout_shared0_div4", "dout_shared1_div4" }; 17045bd8166SDavid Virag PNAME(mout_peri_spi0_p) = { "oscclk", "dout_shared0_div4" }; 17145bd8166SDavid Virag PNAME(mout_peri_spi1_p) = { "oscclk", "dout_shared0_div4" }; 17245bd8166SDavid Virag PNAME(mout_peri_uart0_p) = { "oscclk", "dout_shared0_div4" }; 17345bd8166SDavid Virag PNAME(mout_peri_uart1_p) = { "oscclk", "dout_shared0_div4" }; 17445bd8166SDavid Virag PNAME(mout_peri_uart2_p) = { "oscclk", "dout_shared0_div4" }; 17545bd8166SDavid Virag PNAME(mout_peri_usi0_p) = { "oscclk", "dout_shared0_div4" }; 17645bd8166SDavid Virag PNAME(mout_peri_usi1_p) = { "oscclk", "dout_shared0_div4" }; 17745bd8166SDavid Virag PNAME(mout_peri_usi2_p) = { "oscclk", "dout_shared0_div4" }; 17845bd8166SDavid Virag 179*f392db97SDavid Virag /* List of parent clocks for Muxes in CMU_TOP: for CMU_FSYS */ 180*f392db97SDavid Virag PNAME(mout_fsys_bus_p) = { "dout_shared0_div2", "dout_shared1_div2" }; 181*f392db97SDavid Virag PNAME(mout_fsys_mmc_card_p) = { "dout_shared0_div2", "dout_shared1_div2" }; 182*f392db97SDavid Virag PNAME(mout_fsys_mmc_embd_p) = { "dout_shared0_div2", "dout_shared1_div2" }; 183*f392db97SDavid Virag PNAME(mout_fsys_mmc_sdio_p) = { "dout_shared0_div2", "dout_shared1_div2" }; 184*f392db97SDavid Virag PNAME(mout_fsys_usb30drd_p) = { "dout_shared0_div4", "dout_shared1_div4" }; 185*f392db97SDavid Virag 18645bd8166SDavid Virag static const struct samsung_mux_clock top_mux_clks[] __initconst = { 18745bd8166SDavid Virag /* CORE */ 18845bd8166SDavid Virag MUX(CLK_MOUT_CORE_BUS, "mout_core_bus", mout_core_bus_p, 18945bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_CORE_BUS, 0, 2), 19045bd8166SDavid Virag MUX(CLK_MOUT_CORE_CCI, "mout_core_cci", mout_core_cci_p, 19145bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_CORE_CCI, 0, 2), 19245bd8166SDavid Virag MUX(CLK_MOUT_CORE_G3D, "mout_core_g3d", mout_core_g3d_p, 19345bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_CORE_G3D, 0, 2), 19445bd8166SDavid Virag 19545bd8166SDavid Virag /* PERI */ 19645bd8166SDavid Virag MUX(CLK_MOUT_PERI_BUS, "mout_peri_bus", mout_peri_bus_p, 19745bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_BUS, 0, 1), 19845bd8166SDavid Virag MUX(CLK_MOUT_PERI_SPI0, "mout_peri_spi0", mout_peri_spi0_p, 19945bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_SPI0, 0, 1), 20045bd8166SDavid Virag MUX(CLK_MOUT_PERI_SPI1, "mout_peri_spi1", mout_peri_spi1_p, 20145bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_SPI1, 0, 1), 20245bd8166SDavid Virag MUX(CLK_MOUT_PERI_UART0, "mout_peri_uart0", mout_peri_uart0_p, 20345bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_UART0, 0, 1), 20445bd8166SDavid Virag MUX(CLK_MOUT_PERI_UART1, "mout_peri_uart1", mout_peri_uart1_p, 20545bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_UART1, 0, 1), 20645bd8166SDavid Virag MUX(CLK_MOUT_PERI_UART2, "mout_peri_uart2", mout_peri_uart2_p, 20745bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_UART2, 0, 1), 20845bd8166SDavid Virag MUX(CLK_MOUT_PERI_USI0, "mout_peri_usi0", mout_peri_usi0_p, 20945bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_USI0, 0, 1), 21045bd8166SDavid Virag MUX(CLK_MOUT_PERI_USI1, "mout_peri_usi1", mout_peri_usi1_p, 21145bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_USI1, 0, 1), 21245bd8166SDavid Virag MUX(CLK_MOUT_PERI_USI2, "mout_peri_usi2", mout_peri_usi2_p, 21345bd8166SDavid Virag CLK_CON_MUX_MUX_CLKCMU_PERI_USI2, 0, 1), 214*f392db97SDavid Virag 215*f392db97SDavid Virag /* FSYS */ 216*f392db97SDavid Virag MUX(CLK_MOUT_FSYS_BUS, "mout_fsys_bus", mout_fsys_bus_p, 217*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_BUS, 0, 1), 218*f392db97SDavid Virag MUX(CLK_MOUT_FSYS_MMC_CARD, "mout_fsys_mmc_card", mout_fsys_mmc_card_p, 219*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_CARD, 0, 1), 220*f392db97SDavid Virag MUX(CLK_MOUT_FSYS_MMC_EMBD, "mout_fsys_mmc_embd", mout_fsys_mmc_embd_p, 221*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_EMBD, 0, 1), 222*f392db97SDavid Virag MUX(CLK_MOUT_FSYS_MMC_SDIO, "mout_fsys_mmc_sdio", mout_fsys_mmc_sdio_p, 223*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_MMC_SDIO, 0, 1), 224*f392db97SDavid Virag MUX(CLK_MOUT_FSYS_USB30DRD, "mout_fsys_usb30drd", mout_fsys_usb30drd_p, 225*f392db97SDavid Virag CLK_CON_MUX_MUX_CLKCMU_FSYS_USB30DRD, 0, 1), 22645bd8166SDavid Virag }; 22745bd8166SDavid Virag 22845bd8166SDavid Virag static const struct samsung_div_clock top_div_clks[] __initconst = { 22945bd8166SDavid Virag /* TOP */ 23045bd8166SDavid Virag DIV(CLK_DOUT_SHARED0_DIV2, "dout_shared0_div2", "fout_shared0_pll", 23145bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV2, 0, 1), 23245bd8166SDavid Virag DIV(CLK_DOUT_SHARED0_DIV3, "dout_shared0_div3", "fout_shared0_pll", 23345bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV3, 0, 2), 23445bd8166SDavid Virag DIV(CLK_DOUT_SHARED0_DIV4, "dout_shared0_div4", "fout_shared0_pll", 23545bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV4, 0, 1), 23645bd8166SDavid Virag DIV(CLK_DOUT_SHARED0_DIV5, "dout_shared0_div5", "fout_shared0_pll", 23745bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED0_DIV5, 0, 3), 23845bd8166SDavid Virag DIV(CLK_DOUT_SHARED1_DIV2, "dout_shared1_div2", "fout_shared1_pll", 23945bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED1_DIV2, 0, 1), 24045bd8166SDavid Virag DIV(CLK_DOUT_SHARED1_DIV3, "dout_shared1_div3", "fout_shared1_pll", 24145bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED1_DIV3, 0, 2), 24245bd8166SDavid Virag DIV(CLK_DOUT_SHARED1_DIV4, "dout_shared1_div4", "fout_shared1_pll", 24345bd8166SDavid Virag CLK_CON_DIV_PLL_SHARED1_DIV4, 0, 1), 24445bd8166SDavid Virag 24545bd8166SDavid Virag /* CORE */ 24645bd8166SDavid Virag DIV(CLK_DOUT_CORE_BUS, "dout_core_bus", "gout_core_bus", 24745bd8166SDavid Virag CLK_CON_DIV_CLKCMU_CORE_BUS, 0, 3), 24845bd8166SDavid Virag DIV(CLK_DOUT_CORE_CCI, "dout_core_cci", "gout_core_cci", 24945bd8166SDavid Virag CLK_CON_DIV_CLKCMU_CORE_CCI, 0, 3), 25045bd8166SDavid Virag DIV(CLK_DOUT_CORE_G3D, "dout_core_g3d", "gout_core_g3d", 25145bd8166SDavid Virag CLK_CON_DIV_CLKCMU_CORE_G3D, 0, 3), 25245bd8166SDavid Virag 25345bd8166SDavid Virag /* PERI */ 25445bd8166SDavid Virag DIV(CLK_DOUT_PERI_BUS, "dout_peri_bus", "gout_peri_bus", 25545bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_BUS, 0, 4), 25645bd8166SDavid Virag DIV(CLK_DOUT_PERI_SPI0, "dout_peri_spi0", "gout_peri_spi0", 25745bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_SPI0, 0, 6), 25845bd8166SDavid Virag DIV(CLK_DOUT_PERI_SPI1, "dout_peri_spi1", "gout_peri_spi1", 25945bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_SPI1, 0, 6), 26045bd8166SDavid Virag DIV(CLK_DOUT_PERI_UART0, "dout_peri_uart0", "gout_peri_uart0", 26145bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_UART0, 0, 4), 26245bd8166SDavid Virag DIV(CLK_DOUT_PERI_UART1, "dout_peri_uart1", "gout_peri_uart1", 26345bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_UART1, 0, 4), 26445bd8166SDavid Virag DIV(CLK_DOUT_PERI_UART2, "dout_peri_uart2", "gout_peri_uart2", 26545bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_UART2, 0, 4), 26645bd8166SDavid Virag DIV(CLK_DOUT_PERI_USI0, "dout_peri_usi0", "gout_peri_usi0", 26745bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_USI0, 0, 4), 26845bd8166SDavid Virag DIV(CLK_DOUT_PERI_USI1, "dout_peri_usi1", "gout_peri_usi1", 26945bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_USI1, 0, 4), 27045bd8166SDavid Virag DIV(CLK_DOUT_PERI_USI2, "dout_peri_usi2", "gout_peri_usi2", 27145bd8166SDavid Virag CLK_CON_DIV_CLKCMU_PERI_USI2, 0, 4), 272*f392db97SDavid Virag 273*f392db97SDavid Virag /* FSYS */ 274*f392db97SDavid Virag DIV(CLK_DOUT_FSYS_BUS, "dout_fsys_bus", "gout_fsys_bus", 275*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_BUS, 0, 4), 276*f392db97SDavid Virag DIV(CLK_DOUT_FSYS_MMC_CARD, "dout_fsys_mmc_card", "gout_fsys_mmc_card", 277*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_MMC_CARD, 0, 9), 278*f392db97SDavid Virag DIV(CLK_DOUT_FSYS_MMC_EMBD, "dout_fsys_mmc_embd", "gout_fsys_mmc_embd", 279*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_MMC_EMBD, 0, 9), 280*f392db97SDavid Virag DIV(CLK_DOUT_FSYS_MMC_SDIO, "dout_fsys_mmc_sdio", "gout_fsys_mmc_sdio", 281*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_MMC_SDIO, 0, 9), 282*f392db97SDavid Virag DIV(CLK_DOUT_FSYS_USB30DRD, "dout_fsys_usb30drd", "gout_fsys_usb30drd", 283*f392db97SDavid Virag CLK_CON_DIV_CLKCMU_FSYS_USB30DRD, 0, 4), 28445bd8166SDavid Virag }; 28545bd8166SDavid Virag 28645bd8166SDavid Virag static const struct samsung_gate_clock top_gate_clks[] __initconst = { 28745bd8166SDavid Virag /* CORE */ 28845bd8166SDavid Virag GATE(CLK_GOUT_CORE_BUS, "gout_core_bus", "mout_core_bus", 28945bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_CORE_BUS, 21, 0, 0), 29045bd8166SDavid Virag GATE(CLK_GOUT_CORE_CCI, "gout_core_cci", "mout_core_cci", 29145bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_CORE_CCI, 21, 0, 0), 29245bd8166SDavid Virag GATE(CLK_GOUT_CORE_G3D, "gout_core_g3d", "mout_core_g3d", 29345bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_CORE_G3D, 21, 0, 0), 29445bd8166SDavid Virag 29545bd8166SDavid Virag /* PERI */ 29645bd8166SDavid Virag GATE(CLK_GOUT_PERI_BUS, "gout_peri_bus", "mout_peri_bus", 29745bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_BUS, 21, 0, 0), 29845bd8166SDavid Virag GATE(CLK_GOUT_PERI_SPI0, "gout_peri_spi0", "mout_peri_spi0", 29945bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_SPI0, 21, 0, 0), 30045bd8166SDavid Virag GATE(CLK_GOUT_PERI_SPI1, "gout_peri_spi1", "mout_peri_spi1", 30145bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_SPI1, 21, 0, 0), 30245bd8166SDavid Virag GATE(CLK_GOUT_PERI_UART0, "gout_peri_uart0", "mout_peri_uart0", 30345bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_UART0, 21, 0, 0), 30445bd8166SDavid Virag GATE(CLK_GOUT_PERI_UART1, "gout_peri_uart1", "mout_peri_uart1", 30545bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMUC_PERI_UART1, 21, 0, 0), 30645bd8166SDavid Virag GATE(CLK_GOUT_PERI_UART2, "gout_peri_uart2", "mout_peri_uart2", 30745bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_UART2, 21, 0, 0), 30845bd8166SDavid Virag GATE(CLK_GOUT_PERI_USI0, "gout_peri_usi0", "mout_peri_usi0", 30945bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_USI0, 21, 0, 0), 31045bd8166SDavid Virag GATE(CLK_GOUT_PERI_USI1, "gout_peri_usi1", "mout_peri_usi1", 31145bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_USI1, 21, 0, 0), 31245bd8166SDavid Virag GATE(CLK_GOUT_PERI_USI2, "gout_peri_usi2", "mout_peri_usi2", 31345bd8166SDavid Virag CLK_CON_GAT_GATE_CLKCMU_PERI_USI2, 21, 0, 0), 314*f392db97SDavid Virag 315*f392db97SDavid Virag /* FSYS */ 316*f392db97SDavid Virag GATE(CLK_GOUT_FSYS_BUS, "gout_fsys_bus", "mout_fsys_bus", 317*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_BUS, 21, 0, 0), 318*f392db97SDavid Virag GATE(CLK_GOUT_FSYS_MMC_CARD, "gout_fsys_mmc_card", "mout_fsys_mmc_card", 319*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_CARD, 21, 0, 0), 320*f392db97SDavid Virag GATE(CLK_GOUT_FSYS_MMC_EMBD, "gout_fsys_mmc_embd", "mout_fsys_mmc_embd", 321*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_EMBD, 21, 0, 0), 322*f392db97SDavid Virag GATE(CLK_GOUT_FSYS_MMC_SDIO, "gout_fsys_mmc_sdio", "mout_fsys_mmc_sdio", 323*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_MMC_SDIO, 21, 0, 0), 324*f392db97SDavid Virag GATE(CLK_GOUT_FSYS_USB30DRD, "gout_fsys_usb30drd", "mout_fsys_usb30drd", 325*f392db97SDavid Virag CLK_CON_GAT_GATE_CLKCMU_FSYS_USB30DRD, 21, 0, 0), 32645bd8166SDavid Virag }; 32745bd8166SDavid Virag 32845bd8166SDavid Virag static const struct samsung_cmu_info top_cmu_info __initconst = { 32945bd8166SDavid Virag .pll_clks = top_pll_clks, 33045bd8166SDavid Virag .nr_pll_clks = ARRAY_SIZE(top_pll_clks), 33145bd8166SDavid Virag .mux_clks = top_mux_clks, 33245bd8166SDavid Virag .nr_mux_clks = ARRAY_SIZE(top_mux_clks), 33345bd8166SDavid Virag .div_clks = top_div_clks, 33445bd8166SDavid Virag .nr_div_clks = ARRAY_SIZE(top_div_clks), 33545bd8166SDavid Virag .gate_clks = top_gate_clks, 33645bd8166SDavid Virag .nr_gate_clks = ARRAY_SIZE(top_gate_clks), 33745bd8166SDavid Virag .nr_clk_ids = TOP_NR_CLK, 33845bd8166SDavid Virag .clk_regs = top_clk_regs, 33945bd8166SDavid Virag .nr_clk_regs = ARRAY_SIZE(top_clk_regs), 34045bd8166SDavid Virag }; 34145bd8166SDavid Virag 34245bd8166SDavid Virag static void __init exynos7885_cmu_top_init(struct device_node *np) 34345bd8166SDavid Virag { 34445bd8166SDavid Virag exynos_arm64_register_cmu(NULL, np, &top_cmu_info); 34545bd8166SDavid Virag } 34645bd8166SDavid Virag 34745bd8166SDavid Virag /* Register CMU_TOP early, as it's a dependency for other early domains */ 34845bd8166SDavid Virag CLK_OF_DECLARE(exynos7885_cmu_top, "samsung,exynos7885-cmu-top", 34945bd8166SDavid Virag exynos7885_cmu_top_init); 35045bd8166SDavid Virag 35145bd8166SDavid Virag /* ---- CMU_PERI ------------------------------------------------------------ */ 35245bd8166SDavid Virag 35345bd8166SDavid Virag /* Register Offset definitions for CMU_PERI (0x10010000) */ 35445bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_BUS_USER 0x0100 35545bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_SPI0_USER 0x0120 35645bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_SPI1_USER 0x0140 35745bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_UART0_USER 0x0160 35845bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_UART1_USER 0x0180 35945bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_UART2_USER 0x01a0 36045bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_USI0_USER 0x01c0 36145bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_USI1_USER 0x01e0 36245bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_PERI_USI2_USER 0x0200 36345bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_GPIO_TOP_PCLK 0x2024 36445bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_HSI2C_0_PCLK 0x2028 36545bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_HSI2C_1_PCLK 0x202c 36645bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_HSI2C_2_PCLK 0x2030 36745bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_HSI2C_3_PCLK 0x2034 36845bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_0_PCLK 0x2038 36945bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_1_PCLK 0x203c 37045bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_2_PCLK 0x2040 37145bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_3_PCLK 0x2044 37245bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_4_PCLK 0x2048 37345bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_5_PCLK 0x204c 37445bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_6_PCLK 0x2050 37545bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_I2C_7_PCLK 0x2054 37645bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_PWM_MOTOR_PCLK 0x2058 37745bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_SPI_0_PCLK 0x205c 37845bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_SPI_0_EXT_CLK 0x2060 37945bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_SPI_1_PCLK 0x2064 38045bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_SPI_1_EXT_CLK 0x2068 38145bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_UART_0_EXT_UCLK 0x206c 38245bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_UART_0_PCLK 0x2070 38345bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_UART_1_EXT_UCLK 0x2074 38445bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_UART_1_PCLK 0x2078 38545bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_UART_2_EXT_UCLK 0x207c 38645bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_UART_2_PCLK 0x2080 38745bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_USI0_PCLK 0x2084 38845bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_USI0_SCLK 0x2088 38945bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_USI1_PCLK 0x208c 39045bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_USI1_SCLK 0x2090 39145bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_USI2_PCLK 0x2094 39245bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_USI2_SCLK 0x2098 39345bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_MCT_PCLK 0x20a0 39445bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_SYSREG_PERI_PCLK 0x20b0 39545bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_WDT_CLUSTER0_PCLK 0x20b4 39645bd8166SDavid Virag #define CLK_CON_GAT_GOUT_PERI_WDT_CLUSTER1_PCLK 0x20b8 39745bd8166SDavid Virag 39845bd8166SDavid Virag static const unsigned long peri_clk_regs[] __initconst = { 39945bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_BUS_USER, 40045bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_SPI0_USER, 40145bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_SPI1_USER, 40245bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_UART0_USER, 40345bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_UART1_USER, 40445bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_UART2_USER, 40545bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_USI0_USER, 40645bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_USI1_USER, 40745bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_USI2_USER, 40845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_GPIO_TOP_PCLK, 40945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_0_PCLK, 41045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_1_PCLK, 41145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_2_PCLK, 41245bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_3_PCLK, 41345bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_0_PCLK, 41445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_1_PCLK, 41545bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_2_PCLK, 41645bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_3_PCLK, 41745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_4_PCLK, 41845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_5_PCLK, 41945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_6_PCLK, 42045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_7_PCLK, 42145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_PWM_MOTOR_PCLK, 42245bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_0_PCLK, 42345bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_0_EXT_CLK, 42445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_1_PCLK, 42545bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_1_EXT_CLK, 42645bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_0_EXT_UCLK, 42745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_0_PCLK, 42845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_1_EXT_UCLK, 42945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_1_PCLK, 43045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_2_EXT_UCLK, 43145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_2_PCLK, 43245bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI0_PCLK, 43345bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI0_SCLK, 43445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI1_PCLK, 43545bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI1_SCLK, 43645bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI2_PCLK, 43745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI2_SCLK, 43845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_MCT_PCLK, 43945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SYSREG_PERI_PCLK, 44045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_WDT_CLUSTER0_PCLK, 44145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_WDT_CLUSTER1_PCLK, 44245bd8166SDavid Virag }; 44345bd8166SDavid Virag 44445bd8166SDavid Virag /* List of parent clocks for Muxes in CMU_PERI */ 44545bd8166SDavid Virag PNAME(mout_peri_bus_user_p) = { "oscclk", "dout_peri_bus" }; 44645bd8166SDavid Virag PNAME(mout_peri_spi0_user_p) = { "oscclk", "dout_peri_spi0" }; 44745bd8166SDavid Virag PNAME(mout_peri_spi1_user_p) = { "oscclk", "dout_peri_spi1" }; 44845bd8166SDavid Virag PNAME(mout_peri_uart0_user_p) = { "oscclk", "dout_peri_uart0" }; 44945bd8166SDavid Virag PNAME(mout_peri_uart1_user_p) = { "oscclk", "dout_peri_uart1" }; 45045bd8166SDavid Virag PNAME(mout_peri_uart2_user_p) = { "oscclk", "dout_peri_uart2" }; 45145bd8166SDavid Virag PNAME(mout_peri_usi0_user_p) = { "oscclk", "dout_peri_usi0" }; 45245bd8166SDavid Virag PNAME(mout_peri_usi1_user_p) = { "oscclk", "dout_peri_usi1" }; 45345bd8166SDavid Virag PNAME(mout_peri_usi2_user_p) = { "oscclk", "dout_peri_usi2" }; 45445bd8166SDavid Virag 45545bd8166SDavid Virag static const struct samsung_mux_clock peri_mux_clks[] __initconst = { 45645bd8166SDavid Virag MUX(CLK_MOUT_PERI_BUS_USER, "mout_peri_bus_user", mout_peri_bus_user_p, 45745bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_BUS_USER, 4, 1), 45845bd8166SDavid Virag MUX(CLK_MOUT_PERI_SPI0_USER, "mout_peri_spi0_user", mout_peri_spi0_user_p, 45945bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_SPI0_USER, 4, 1), 46045bd8166SDavid Virag MUX(CLK_MOUT_PERI_SPI1_USER, "mout_peri_spi1_user", mout_peri_spi1_user_p, 46145bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_PERI_SPI1_USER, 4, 1), 46245bd8166SDavid Virag MUX(CLK_MOUT_PERI_UART0_USER, "mout_peri_uart0_user", 46345bd8166SDavid Virag mout_peri_uart0_user_p, PLL_CON0_MUX_CLKCMU_PERI_UART0_USER, 4, 1), 46445bd8166SDavid Virag MUX(CLK_MOUT_PERI_UART1_USER, "mout_peri_uart1_user", 46545bd8166SDavid Virag mout_peri_uart1_user_p, PLL_CON0_MUX_CLKCMU_PERI_UART1_USER, 4, 1), 46645bd8166SDavid Virag MUX(CLK_MOUT_PERI_UART2_USER, "mout_peri_uart2_user", 46745bd8166SDavid Virag mout_peri_uart2_user_p, PLL_CON0_MUX_CLKCMU_PERI_UART2_USER, 4, 1), 46845bd8166SDavid Virag MUX(CLK_MOUT_PERI_USI0_USER, "mout_peri_usi0_user", 46945bd8166SDavid Virag mout_peri_usi0_user_p, PLL_CON0_MUX_CLKCMU_PERI_USI0_USER, 4, 1), 47045bd8166SDavid Virag MUX(CLK_MOUT_PERI_USI1_USER, "mout_peri_usi1_user", 47145bd8166SDavid Virag mout_peri_usi1_user_p, PLL_CON0_MUX_CLKCMU_PERI_USI1_USER, 4, 1), 47245bd8166SDavid Virag MUX(CLK_MOUT_PERI_USI2_USER, "mout_peri_usi2_user", 47345bd8166SDavid Virag mout_peri_usi2_user_p, PLL_CON0_MUX_CLKCMU_PERI_USI2_USER, 4, 1), 47445bd8166SDavid Virag }; 47545bd8166SDavid Virag 47645bd8166SDavid Virag static const struct samsung_gate_clock peri_gate_clks[] __initconst = { 47745bd8166SDavid Virag /* TODO: Should be enabled in GPIO driver (or made CLK_IS_CRITICAL) */ 47845bd8166SDavid Virag GATE(CLK_GOUT_GPIO_TOP_PCLK, "gout_gpio_top_pclk", 47945bd8166SDavid Virag "mout_peri_bus_user", 48045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_GPIO_TOP_PCLK, 21, CLK_IGNORE_UNUSED, 0), 48145bd8166SDavid Virag GATE(CLK_GOUT_HSI2C0_PCLK, "gout_hsi2c0_pclk", "mout_peri_bus_user", 48245bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_0_PCLK, 21, 0, 0), 48345bd8166SDavid Virag GATE(CLK_GOUT_HSI2C1_PCLK, "gout_hsi2c1_pclk", "mout_peri_bus_user", 48445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_1_PCLK, 21, 0, 0), 48545bd8166SDavid Virag GATE(CLK_GOUT_HSI2C2_PCLK, "gout_hsi2c2_pclk", "mout_peri_bus_user", 48645bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_2_PCLK, 21, 0, 0), 48745bd8166SDavid Virag GATE(CLK_GOUT_HSI2C3_PCLK, "gout_hsi2c3_pclk", "mout_peri_bus_user", 48845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_HSI2C_3_PCLK, 21, 0, 0), 48945bd8166SDavid Virag GATE(CLK_GOUT_I2C0_PCLK, "gout_i2c0_pclk", "mout_peri_bus_user", 49045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_0_PCLK, 21, 0, 0), 49145bd8166SDavid Virag GATE(CLK_GOUT_I2C1_PCLK, "gout_i2c1_pclk", "mout_peri_bus_user", 49245bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_1_PCLK, 21, 0, 0), 49345bd8166SDavid Virag GATE(CLK_GOUT_I2C2_PCLK, "gout_i2c2_pclk", "mout_peri_bus_user", 49445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_2_PCLK, 21, 0, 0), 49545bd8166SDavid Virag GATE(CLK_GOUT_I2C3_PCLK, "gout_i2c3_pclk", "mout_peri_bus_user", 49645bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_3_PCLK, 21, 0, 0), 49745bd8166SDavid Virag GATE(CLK_GOUT_I2C4_PCLK, "gout_i2c4_pclk", "mout_peri_bus_user", 49845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_4_PCLK, 21, 0, 0), 49945bd8166SDavid Virag GATE(CLK_GOUT_I2C5_PCLK, "gout_i2c5_pclk", "mout_peri_bus_user", 50045bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_5_PCLK, 21, 0, 0), 50145bd8166SDavid Virag GATE(CLK_GOUT_I2C6_PCLK, "gout_i2c6_pclk", "mout_peri_bus_user", 50245bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_6_PCLK, 21, 0, 0), 50345bd8166SDavid Virag GATE(CLK_GOUT_I2C7_PCLK, "gout_i2c7_pclk", "mout_peri_bus_user", 50445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_I2C_7_PCLK, 21, 0, 0), 50545bd8166SDavid Virag GATE(CLK_GOUT_PWM_MOTOR_PCLK, "gout_pwm_motor_pclk", 50645bd8166SDavid Virag "mout_peri_bus_user", 50745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_PWM_MOTOR_PCLK, 21, 0, 0), 50845bd8166SDavid Virag GATE(CLK_GOUT_SPI0_PCLK, "gout_spi0_pclk", "mout_peri_bus_user", 50945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_0_PCLK, 21, 0, 0), 51045bd8166SDavid Virag GATE(CLK_GOUT_SPI0_EXT_CLK, "gout_spi0_ipclk", "mout_peri_spi0_user", 51145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_0_EXT_CLK, 21, 0, 0), 51245bd8166SDavid Virag GATE(CLK_GOUT_SPI1_PCLK, "gout_spi1_pclk", "mout_peri_bus_user", 51345bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_1_PCLK, 21, 0, 0), 51445bd8166SDavid Virag GATE(CLK_GOUT_SPI1_EXT_CLK, "gout_spi1_ipclk", "mout_peri_spi1_user", 51545bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SPI_1_EXT_CLK, 21, 0, 0), 51645bd8166SDavid Virag GATE(CLK_GOUT_UART0_EXT_UCLK, "gout_uart0_ext_uclk", "mout_peri_uart0_user", 51745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_0_EXT_UCLK, 21, 0, 0), 51845bd8166SDavid Virag GATE(CLK_GOUT_UART0_PCLK, "gout_uart0_pclk", "mout_peri_bus_user", 51945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_0_PCLK, 21, 0, 0), 52045bd8166SDavid Virag GATE(CLK_GOUT_UART1_EXT_UCLK, "gout_uart1_ext_uclk", "mout_peri_uart1_user", 52145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_1_EXT_UCLK, 21, 0, 0), 52245bd8166SDavid Virag GATE(CLK_GOUT_UART1_PCLK, "gout_uart1_pclk", "mout_peri_bus_user", 52345bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_1_PCLK, 21, 0, 0), 52445bd8166SDavid Virag GATE(CLK_GOUT_UART2_EXT_UCLK, "gout_uart2_ext_uclk", "mout_peri_uart2_user", 52545bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_2_EXT_UCLK, 21, 0, 0), 52645bd8166SDavid Virag GATE(CLK_GOUT_UART2_PCLK, "gout_uart2_pclk", "mout_peri_bus_user", 52745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_UART_2_PCLK, 21, 0, 0), 52845bd8166SDavid Virag GATE(CLK_GOUT_USI0_PCLK, "gout_usi0_pclk", "mout_peri_bus_user", 52945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI0_PCLK, 21, 0, 0), 53045bd8166SDavid Virag GATE(CLK_GOUT_USI0_SCLK, "gout_usi0_sclk", "mout_peri_usi0_user", 53145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI0_SCLK, 21, 0, 0), 53245bd8166SDavid Virag GATE(CLK_GOUT_USI1_PCLK, "gout_usi1_pclk", "mout_peri_bus_user", 53345bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI1_PCLK, 21, 0, 0), 53445bd8166SDavid Virag GATE(CLK_GOUT_USI1_SCLK, "gout_usi1_sclk", "mout_peri_usi1_user", 53545bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI1_SCLK, 21, 0, 0), 53645bd8166SDavid Virag GATE(CLK_GOUT_USI2_PCLK, "gout_usi2_pclk", "mout_peri_bus_user", 53745bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI2_PCLK, 21, 0, 0), 53845bd8166SDavid Virag GATE(CLK_GOUT_USI2_SCLK, "gout_usi2_sclk", "mout_peri_usi2_user", 53945bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_USI2_SCLK, 21, 0, 0), 54045bd8166SDavid Virag GATE(CLK_GOUT_MCT_PCLK, "gout_mct_pclk", "mout_peri_bus_user", 54145bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_MCT_PCLK, 21, 0, 0), 54245bd8166SDavid Virag GATE(CLK_GOUT_SYSREG_PERI_PCLK, "gout_sysreg_peri_pclk", 54345bd8166SDavid Virag "mout_peri_bus_user", 54445bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_SYSREG_PERI_PCLK, 21, 0, 0), 54545bd8166SDavid Virag GATE(CLK_GOUT_WDT0_PCLK, "gout_wdt0_pclk", "mout_peri_bus_user", 54645bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_WDT_CLUSTER0_PCLK, 21, 0, 0), 54745bd8166SDavid Virag GATE(CLK_GOUT_WDT1_PCLK, "gout_wdt1_pclk", "mout_peri_bus_user", 54845bd8166SDavid Virag CLK_CON_GAT_GOUT_PERI_WDT_CLUSTER1_PCLK, 21, 0, 0), 54945bd8166SDavid Virag }; 55045bd8166SDavid Virag 55145bd8166SDavid Virag static const struct samsung_cmu_info peri_cmu_info __initconst = { 55245bd8166SDavid Virag .mux_clks = peri_mux_clks, 55345bd8166SDavid Virag .nr_mux_clks = ARRAY_SIZE(peri_mux_clks), 55445bd8166SDavid Virag .gate_clks = peri_gate_clks, 55545bd8166SDavid Virag .nr_gate_clks = ARRAY_SIZE(peri_gate_clks), 55645bd8166SDavid Virag .nr_clk_ids = PERI_NR_CLK, 55745bd8166SDavid Virag .clk_regs = peri_clk_regs, 55845bd8166SDavid Virag .nr_clk_regs = ARRAY_SIZE(peri_clk_regs), 55945bd8166SDavid Virag .clk_name = "dout_peri_bus", 56045bd8166SDavid Virag }; 56145bd8166SDavid Virag 56245bd8166SDavid Virag static void __init exynos7885_cmu_peri_init(struct device_node *np) 56345bd8166SDavid Virag { 56445bd8166SDavid Virag exynos_arm64_register_cmu(NULL, np, &peri_cmu_info); 56545bd8166SDavid Virag } 56645bd8166SDavid Virag 56745bd8166SDavid Virag /* Register CMU_PERI early, as it's needed for MCT timer */ 56845bd8166SDavid Virag CLK_OF_DECLARE(exynos7885_cmu_peri, "samsung,exynos7885-cmu-peri", 56945bd8166SDavid Virag exynos7885_cmu_peri_init); 57045bd8166SDavid Virag 57145bd8166SDavid Virag /* ---- CMU_CORE ------------------------------------------------------------ */ 57245bd8166SDavid Virag 57345bd8166SDavid Virag /* Register Offset definitions for CMU_CORE (0x12000000) */ 57445bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_CORE_BUS_USER 0x0100 57545bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_CORE_CCI_USER 0x0120 57645bd8166SDavid Virag #define PLL_CON0_MUX_CLKCMU_CORE_G3D_USER 0x0140 57745bd8166SDavid Virag #define CLK_CON_MUX_MUX_CLK_CORE_GIC 0x1000 57845bd8166SDavid Virag #define CLK_CON_DIV_DIV_CLK_CORE_BUSP 0x1800 57945bd8166SDavid Virag #define CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK 0x2054 58045bd8166SDavid Virag #define CLK_CON_GAT_GOUT_CORE_GIC400_CLK 0x2058 58145bd8166SDavid Virag 58245bd8166SDavid Virag static const unsigned long core_clk_regs[] __initconst = { 58345bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_CORE_BUS_USER, 58445bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_CORE_CCI_USER, 58545bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_CORE_G3D_USER, 58645bd8166SDavid Virag CLK_CON_MUX_MUX_CLK_CORE_GIC, 58745bd8166SDavid Virag CLK_CON_DIV_DIV_CLK_CORE_BUSP, 58845bd8166SDavid Virag CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK, 58945bd8166SDavid Virag CLK_CON_GAT_GOUT_CORE_GIC400_CLK, 59045bd8166SDavid Virag }; 59145bd8166SDavid Virag 59245bd8166SDavid Virag /* List of parent clocks for Muxes in CMU_CORE */ 59345bd8166SDavid Virag PNAME(mout_core_bus_user_p) = { "oscclk", "dout_core_bus" }; 59445bd8166SDavid Virag PNAME(mout_core_cci_user_p) = { "oscclk", "dout_core_cci" }; 59545bd8166SDavid Virag PNAME(mout_core_g3d_user_p) = { "oscclk", "dout_core_g3d" }; 59645bd8166SDavid Virag PNAME(mout_core_gic_p) = { "dout_core_busp", "oscclk" }; 59745bd8166SDavid Virag 59845bd8166SDavid Virag static const struct samsung_mux_clock core_mux_clks[] __initconst = { 59945bd8166SDavid Virag MUX(CLK_MOUT_CORE_BUS_USER, "mout_core_bus_user", mout_core_bus_user_p, 60045bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_CORE_BUS_USER, 4, 1), 60145bd8166SDavid Virag MUX(CLK_MOUT_CORE_CCI_USER, "mout_core_cci_user", mout_core_cci_user_p, 60245bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_CORE_CCI_USER, 4, 1), 60345bd8166SDavid Virag MUX(CLK_MOUT_CORE_G3D_USER, "mout_core_g3d_user", mout_core_g3d_user_p, 60445bd8166SDavid Virag PLL_CON0_MUX_CLKCMU_CORE_G3D_USER, 4, 1), 60545bd8166SDavid Virag MUX(CLK_MOUT_CORE_GIC, "mout_core_gic", mout_core_gic_p, 60645bd8166SDavid Virag CLK_CON_MUX_MUX_CLK_CORE_GIC, 0, 1), 60745bd8166SDavid Virag }; 60845bd8166SDavid Virag 60945bd8166SDavid Virag static const struct samsung_div_clock core_div_clks[] __initconst = { 61045bd8166SDavid Virag DIV(CLK_DOUT_CORE_BUSP, "dout_core_busp", "mout_core_bus_user", 61145bd8166SDavid Virag CLK_CON_DIV_DIV_CLK_CORE_BUSP, 0, 2), 61245bd8166SDavid Virag }; 61345bd8166SDavid Virag 61445bd8166SDavid Virag static const struct samsung_gate_clock core_gate_clks[] __initconst = { 61545bd8166SDavid Virag /* CCI (interconnect) clock must be always running */ 61645bd8166SDavid Virag GATE(CLK_GOUT_CCI_ACLK, "gout_cci_aclk", "mout_core_cci_user", 61745bd8166SDavid Virag CLK_CON_GAT_GOUT_CORE_CCI_550_ACLK, 21, CLK_IS_CRITICAL, 0), 61845bd8166SDavid Virag /* GIC (interrupt controller) clock must be always running */ 61945bd8166SDavid Virag GATE(CLK_GOUT_GIC400_CLK, "gout_gic400_clk", "mout_core_gic", 62045bd8166SDavid Virag CLK_CON_GAT_GOUT_CORE_GIC400_CLK, 21, CLK_IS_CRITICAL, 0), 62145bd8166SDavid Virag }; 62245bd8166SDavid Virag 62345bd8166SDavid Virag static const struct samsung_cmu_info core_cmu_info __initconst = { 62445bd8166SDavid Virag .mux_clks = core_mux_clks, 62545bd8166SDavid Virag .nr_mux_clks = ARRAY_SIZE(core_mux_clks), 62645bd8166SDavid Virag .div_clks = core_div_clks, 62745bd8166SDavid Virag .nr_div_clks = ARRAY_SIZE(core_div_clks), 62845bd8166SDavid Virag .gate_clks = core_gate_clks, 62945bd8166SDavid Virag .nr_gate_clks = ARRAY_SIZE(core_gate_clks), 63045bd8166SDavid Virag .nr_clk_ids = CORE_NR_CLK, 63145bd8166SDavid Virag .clk_regs = core_clk_regs, 63245bd8166SDavid Virag .nr_clk_regs = ARRAY_SIZE(core_clk_regs), 63345bd8166SDavid Virag .clk_name = "dout_core_bus", 63445bd8166SDavid Virag }; 63545bd8166SDavid Virag 636*f392db97SDavid Virag /* ---- CMU_FSYS ------------------------------------------------------------ */ 637*f392db97SDavid Virag 638*f392db97SDavid Virag /* Register Offset definitions for CMU_FSYS (0x13400000) */ 639*f392db97SDavid Virag #define PLL_CON0_MUX_CLKCMU_FSYS_BUS_USER 0x0100 640*f392db97SDavid Virag #define PLL_CON0_MUX_CLKCMU_FSYS_MMC_CARD_USER 0x0120 641*f392db97SDavid Virag #define PLL_CON0_MUX_CLKCMU_FSYS_MMC_EMBD_USER 0x0140 642*f392db97SDavid Virag #define PLL_CON0_MUX_CLKCMU_FSYS_MMC_SDIO_USER 0x0160 643*f392db97SDavid Virag #define PLL_CON0_MUX_CLKCMU_FSYS_USB30DRD_USER 0x0180 644*f392db97SDavid Virag #define CLK_CON_GAT_GOUT_FSYS_MMC_CARD_I_ACLK 0x2030 645*f392db97SDavid Virag #define CLK_CON_GAT_GOUT_FSYS_MMC_CARD_SDCLKIN 0x2034 646*f392db97SDavid Virag #define CLK_CON_GAT_GOUT_FSYS_MMC_EMBD_I_ACLK 0x2038 647*f392db97SDavid Virag #define CLK_CON_GAT_GOUT_FSYS_MMC_EMBD_SDCLKIN 0x203c 648*f392db97SDavid Virag #define CLK_CON_GAT_GOUT_FSYS_MMC_SDIO_I_ACLK 0x2040 649*f392db97SDavid Virag #define CLK_CON_GAT_GOUT_FSYS_MMC_SDIO_SDCLKIN 0x2044 650*f392db97SDavid Virag 651*f392db97SDavid Virag static const unsigned long fsys_clk_regs[] __initconst = { 652*f392db97SDavid Virag PLL_CON0_MUX_CLKCMU_FSYS_BUS_USER, 653*f392db97SDavid Virag PLL_CON0_MUX_CLKCMU_FSYS_MMC_CARD_USER, 654*f392db97SDavid Virag PLL_CON0_MUX_CLKCMU_FSYS_MMC_EMBD_USER, 655*f392db97SDavid Virag PLL_CON0_MUX_CLKCMU_FSYS_MMC_SDIO_USER, 656*f392db97SDavid Virag PLL_CON0_MUX_CLKCMU_FSYS_USB30DRD_USER, 657*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_CARD_I_ACLK, 658*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_CARD_SDCLKIN, 659*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_EMBD_I_ACLK, 660*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_EMBD_SDCLKIN, 661*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_SDIO_I_ACLK, 662*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_SDIO_SDCLKIN, 663*f392db97SDavid Virag }; 664*f392db97SDavid Virag 665*f392db97SDavid Virag /* List of parent clocks for Muxes in CMU_FSYS */ 666*f392db97SDavid Virag PNAME(mout_fsys_bus_user_p) = { "oscclk", "dout_fsys_bus" }; 667*f392db97SDavid Virag PNAME(mout_fsys_mmc_card_user_p) = { "oscclk", "dout_fsys_mmc_card" }; 668*f392db97SDavid Virag PNAME(mout_fsys_mmc_embd_user_p) = { "oscclk", "dout_fsys_mmc_embd" }; 669*f392db97SDavid Virag PNAME(mout_fsys_mmc_sdio_user_p) = { "oscclk", "dout_fsys_mmc_sdio" }; 670*f392db97SDavid Virag PNAME(mout_fsys_usb30drd_user_p) = { "oscclk", "dout_fsys_usb30drd" }; 671*f392db97SDavid Virag 672*f392db97SDavid Virag static const struct samsung_mux_clock fsys_mux_clks[] __initconst = { 673*f392db97SDavid Virag MUX(CLK_MOUT_FSYS_BUS_USER, "mout_fsys_bus_user", mout_fsys_bus_user_p, 674*f392db97SDavid Virag PLL_CON0_MUX_CLKCMU_FSYS_BUS_USER, 4, 1), 675*f392db97SDavid Virag MUX_F(CLK_MOUT_FSYS_MMC_CARD_USER, "mout_fsys_mmc_card_user", 676*f392db97SDavid Virag mout_fsys_mmc_card_user_p, PLL_CON0_MUX_CLKCMU_FSYS_MMC_CARD_USER, 677*f392db97SDavid Virag 4, 1, CLK_SET_RATE_PARENT, 0), 678*f392db97SDavid Virag MUX_F(CLK_MOUT_FSYS_MMC_EMBD_USER, "mout_fsys_mmc_embd_user", 679*f392db97SDavid Virag mout_fsys_mmc_embd_user_p, PLL_CON0_MUX_CLKCMU_FSYS_MMC_EMBD_USER, 680*f392db97SDavid Virag 4, 1, CLK_SET_RATE_PARENT, 0), 681*f392db97SDavid Virag MUX_F(CLK_MOUT_FSYS_MMC_SDIO_USER, "mout_fsys_mmc_sdio_user", 682*f392db97SDavid Virag mout_fsys_mmc_sdio_user_p, PLL_CON0_MUX_CLKCMU_FSYS_MMC_SDIO_USER, 683*f392db97SDavid Virag 4, 1, CLK_SET_RATE_PARENT, 0), 684*f392db97SDavid Virag MUX_F(CLK_MOUT_FSYS_USB30DRD_USER, "mout_fsys_usb30drd_user", 685*f392db97SDavid Virag mout_fsys_usb30drd_user_p, PLL_CON0_MUX_CLKCMU_FSYS_USB30DRD_USER, 686*f392db97SDavid Virag 4, 1, CLK_SET_RATE_PARENT, 0), 687*f392db97SDavid Virag }; 688*f392db97SDavid Virag 689*f392db97SDavid Virag static const struct samsung_gate_clock fsys_gate_clks[] __initconst = { 690*f392db97SDavid Virag GATE(CLK_GOUT_MMC_CARD_ACLK, "gout_mmc_card_aclk", "mout_fsys_bus_user", 691*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_CARD_I_ACLK, 21, 0, 0), 692*f392db97SDavid Virag GATE(CLK_GOUT_MMC_CARD_SDCLKIN, "gout_mmc_card_sdclkin", 693*f392db97SDavid Virag "mout_fsys_mmc_card_user", CLK_CON_GAT_GOUT_FSYS_MMC_CARD_SDCLKIN, 694*f392db97SDavid Virag 21, CLK_SET_RATE_PARENT, 0), 695*f392db97SDavid Virag GATE(CLK_GOUT_MMC_EMBD_ACLK, "gout_mmc_embd_aclk", "mout_fsys_bus_user", 696*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_EMBD_I_ACLK, 21, 0, 0), 697*f392db97SDavid Virag GATE(CLK_GOUT_MMC_EMBD_SDCLKIN, "gout_mmc_embd_sdclkin", 698*f392db97SDavid Virag "mout_fsys_mmc_embd_user", CLK_CON_GAT_GOUT_FSYS_MMC_EMBD_SDCLKIN, 699*f392db97SDavid Virag 21, CLK_SET_RATE_PARENT, 0), 700*f392db97SDavid Virag GATE(CLK_GOUT_MMC_SDIO_ACLK, "gout_mmc_sdio_aclk", "mout_fsys_bus_user", 701*f392db97SDavid Virag CLK_CON_GAT_GOUT_FSYS_MMC_SDIO_I_ACLK, 21, 0, 0), 702*f392db97SDavid Virag GATE(CLK_GOUT_MMC_SDIO_SDCLKIN, "gout_mmc_sdio_sdclkin", 703*f392db97SDavid Virag "mout_fsys_mmc_sdio_user", CLK_CON_GAT_GOUT_FSYS_MMC_SDIO_SDCLKIN, 704*f392db97SDavid Virag 21, CLK_SET_RATE_PARENT, 0), 705*f392db97SDavid Virag }; 706*f392db97SDavid Virag 707*f392db97SDavid Virag static const struct samsung_cmu_info fsys_cmu_info __initconst = { 708*f392db97SDavid Virag .mux_clks = fsys_mux_clks, 709*f392db97SDavid Virag .nr_mux_clks = ARRAY_SIZE(fsys_mux_clks), 710*f392db97SDavid Virag .gate_clks = fsys_gate_clks, 711*f392db97SDavid Virag .nr_gate_clks = ARRAY_SIZE(fsys_gate_clks), 712*f392db97SDavid Virag .nr_clk_ids = FSYS_NR_CLK, 713*f392db97SDavid Virag .clk_regs = fsys_clk_regs, 714*f392db97SDavid Virag .nr_clk_regs = ARRAY_SIZE(fsys_clk_regs), 715*f392db97SDavid Virag .clk_name = "dout_fsys_bus", 716*f392db97SDavid Virag }; 717*f392db97SDavid Virag 71845bd8166SDavid Virag /* ---- platform_driver ----------------------------------------------------- */ 71945bd8166SDavid Virag 72045bd8166SDavid Virag static int __init exynos7885_cmu_probe(struct platform_device *pdev) 72145bd8166SDavid Virag { 72245bd8166SDavid Virag const struct samsung_cmu_info *info; 72345bd8166SDavid Virag struct device *dev = &pdev->dev; 72445bd8166SDavid Virag 72545bd8166SDavid Virag info = of_device_get_match_data(dev); 72645bd8166SDavid Virag exynos_arm64_register_cmu(dev, dev->of_node, info); 72745bd8166SDavid Virag 72845bd8166SDavid Virag return 0; 72945bd8166SDavid Virag } 73045bd8166SDavid Virag 73145bd8166SDavid Virag static const struct of_device_id exynos7885_cmu_of_match[] = { 73245bd8166SDavid Virag { 73345bd8166SDavid Virag .compatible = "samsung,exynos7885-cmu-core", 73445bd8166SDavid Virag .data = &core_cmu_info, 73545bd8166SDavid Virag }, { 736*f392db97SDavid Virag .compatible = "samsung,exynos7885-cmu-fsys", 737*f392db97SDavid Virag .data = &fsys_cmu_info, 738*f392db97SDavid Virag }, { 73945bd8166SDavid Virag }, 74045bd8166SDavid Virag }; 74145bd8166SDavid Virag 74245bd8166SDavid Virag static struct platform_driver exynos7885_cmu_driver __refdata = { 74345bd8166SDavid Virag .driver = { 74445bd8166SDavid Virag .name = "exynos7885-cmu", 74545bd8166SDavid Virag .of_match_table = exynos7885_cmu_of_match, 74645bd8166SDavid Virag .suppress_bind_attrs = true, 74745bd8166SDavid Virag }, 74845bd8166SDavid Virag .probe = exynos7885_cmu_probe, 74945bd8166SDavid Virag }; 75045bd8166SDavid Virag 75145bd8166SDavid Virag static int __init exynos7885_cmu_init(void) 75245bd8166SDavid Virag { 75345bd8166SDavid Virag return platform_driver_register(&exynos7885_cmu_driver); 75445bd8166SDavid Virag } 75545bd8166SDavid Virag core_initcall(exynos7885_cmu_init); 756