blob: e6af03bb6373cd6fdf0b77cda9382d7728d93682 [file] [log] [blame]
/*
* Copyright (c) 2013 Samsung Electronics Co., Ltd.
* Authors: Thomas Abraham <thomas.ab@samsung.com>
* Chander Kashyap <k.chander@samsung.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Common Clock Framework support for Exynos7885 SoC.
*/
#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/clk-provider.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <soc/samsung/cal-if.h>
#include <dt-bindings/clock/exynos7885.h>
#include "../../soc/samsung/cal-if/exynos7885/cmucal-vclk.h"
#include "../../soc/samsung/cal-if/exynos7885/cmucal-node.h"
#include "../../soc/samsung/cal-if/exynos7885/cmucal-qch.h"
#include "../../soc/samsung/cal-if/exynos7885/clkout_exynos7885.h"
#include "composite.h"
static struct samsung_clk_provider *exynos7885_clk_provider;
/*
* list of controller registers to be saved and restored during a
* suspend/resume cycle.
*/
/* fixed rate clocks generated outside the soc */
struct samsung_fixed_rate exynos7885_fixed_rate_ext_clks[] __initdata = {
FRATE(OSCCLK, "fin_pll", NULL, CLK_IS_ROOT, 26000000),
};
struct init_vclk exynos7885_apm_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_APM_BUS, MUX_CLKCMU_APM_BUS_USER, "UMUX_CLKCMU_APM_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_APM_SYS, APM_QCH_SYS, "GATE_APM_SYS", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_APM_CPU, APM_QCH_CPU, "GATE_APM_CPU", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MAILBOX_APM2AP, MAILBOX_APM2AP_QCH, "GATE_MAILBOX_APM2AP", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MAILBOX_APM2CP, MAILBOX_APM2CP_QCH, "GATE_MAILBOX_APM2CP", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MAILBOX_APM2GNSS, MAILBOX_APM2GNSS_QCH, "GATE_MAILBOX_APM2GNSS", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MAILBOX_APM2WLBT, MAILBOX_APM2WLBT_QCH, "GATE_MAILBOX_APM2WLBT", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C_APM, I2C_APM_QCH, "GATE_I2C_APM", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SPEEDY_APM, SPEEDY_QCH, "GATE_SPEEDY_APM", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_WDT_APM, WDT_APM_QCH, "GATE_WDT_APM", "UMUX_CLKCMU_APM_BUS", 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_cam_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_CAM_BUS, MUX_CLKCMU_CAM_BUS_USER, "UMUX_CLKCMU_CAM_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_3AA1, IS6P20P0_CAM_QCH_S_CAM_3AA1, "GATE_IS6P20P0_CAM_S_CAM_3AA1", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_3AA0, IS6P20P0_CAM_QCH_S_CAM_3AA0, "GATE_IS6P20P0_CAM_S_CAM_3AA0", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_CSIS_DMA, IS6P20P0_CAM_QCH_S_CAM_CSIS_DMA, "GATE_IS6P20P0_CAM_S_CAM_CSIS_DMA", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_CSIS0, IS6P20P0_CAM_QCH_S_CAM_CSIS0, "GATE_IS6P20P0_CAM_S_CAM_CSIS0", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_CSIS1, IS6P20P0_CAM_QCH_S_CAM_CSIS1, "GATE_IS6P20P0_CAM_S_CAM_CSIS1", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_CSIS2, IS6P20P0_CAM_QCH_S_CAM_CSIS2, "GATE_IS6P20P0_CAM_S_CAM_CSIS2", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_CSIS3, IS6P20P0_CAM_QCH_S_CAM_CSIS3, "GATE_IS6P20P0_CAM_S_CAM_CSIS3", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS6P20P0_CAM_S_CAM_SMMU, IS6P20P0_CAM_QCH_S_CAM_SMMU, "GATE_IS6P20P0_CAM_S_CAM_SMMU", "UMUX_CLKCMU_CAM_BUS", 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_cmu_hwacg_vclks[] __initdata = {
HWACG_VCLK(GATE_DFTMUX_TOP_CIS_CLK0, DFTMUX_TOP_QCH_CLK_CSIS0, "GATE_DFTMUX_TOP_CIS_CLK0", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_DFTMUX_TOP_CIS_CLK1, DFTMUX_TOP_QCH_CLK_CSIS1, "GATE_DFTMUX_TOP_CIS_CLK1", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_DFTMUX_TOP_CIS_CLK2, DFTMUX_TOP_QCH_CLK_CSIS2, "GATE_DFTMUX_TOP_CIS_CLK2", NULL, 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_dispaud_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_DISPAUD_BUS, MUX_CLKCMU_DISPAUD_BUS_USER, "UMUX_CLKCMU_DISPAUD_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_ABOX_ABOX, ABOX_QCH_ABOX, "GATE_ABOX_ABOX", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_ABOX_CPU, ABOX_QCH_CPU, "GATE_ABOX_CPU", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_ABOX_BUS, ABOX_QCH_BUS, "GATE_ABOX_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_UAIF0, ABOX_QCH_UAIF0, "GATE_UAIF0", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_UAIF2, ABOX_QCH_UAIF2, "GATE_UAIF2", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_UAIF3, ABOX_QCH_UAIF3, "GATE_UAIF3", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_FM, ABOX_QCH_FM, "GATE_FM", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_WDT_ABOXCPU, WDT_ABOXCPU_QCH, "GATE_WDT_ABOXCPU", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_DPU_DPP, DPU_QCH_DPP, "GATE_DPU_DPP", "UMUX_CLKCMU_DISPAUD_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_DPU_DMA, DPU_QCH_DMA, "GATE_DPU_DMA", "UMUX_CLKCMU_DISPAUD_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_DPU_DECON0, DPU_QCH_DECON0, "GATE_DPU_QCH_DECON0", "UMUX_CLKCMU_DISPAUD_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SMMU_ABOX, SMMU_ABOX_QCH, "GATE_SMMU_ABOX", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SMMU_DPU, SMMU_DPU_QCH, "GATE_SMMU_DPU", "UMUX_CLKCMU_DISPAUD_BUS", 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_fsys_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_FSYS_BUS, MUX_CLKCMU_FSYS_BUS_USER, "UMUX_CLKCMU_FSYS_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_FSYS_MMC_CARD, MUX_CLKCMU_FSYS_MMC_CARD_USER, "UMUX_CLKCMU_FSYS_MMC_CARD", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_FSYS_MMC_EMBD, MUX_CLKCMU_FSYS_MMC_EMBD_USER, "UMUX_CLKCMU_FSYS_MMC_EMBD", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_FSYS_MMC_SDIO, MUX_CLKCMU_FSYS_MMC_SDIO_USER, "UMUX_CLKCMU_FSYS_MMC_SDIO", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MMC_CARD, MMC_CARD_QCH, "GATE_MMC_CARD", "UMUX_CLKCMU_FSYS_MMC_CARD", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MMC_EMBD, MMC_EMBD_QCH, "GATE_MMC_EMBD", "UMUX_CLKCMU_FSYS_MMC_EMBD", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MMC_SDIO, MMC_SDIO_QCH, "GATE_MMC_SDIO", "UMUX_CLKCMU_FSYS_MMC_SDIO", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_RTIC, RTIC_QCH, "GATE_RTIC", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SSS, SSS_QCH, "GATE_SSS", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USB30DRD_HSDRD, USB30DRD_QCH_HSDRD, "GATE_USB30DRD_HSDRD", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USB30DRD_USB20, USB30DRD_QCH_USB20, "GATE_USB30DRD_USB20", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USB30DRD_USB30_0, USB30DRD_QCH_USB30_0,"GATE_USB30DRD_USB30_0", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USB30DRD_USB30_1, USB30DRD_QCH_USB30_1, "GATE_USB30DRD_USB30_1", "UMUX_CLKCMU_FSYS_BUS", 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_g3d_hwacg_vclks[] __initdata = {
HWACG_VCLK(GATE_AGPU_G3D, AGPU_QCH, "GATE_AGPU_G3D", NULL, 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_isp_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_ISP_BUS, MUX_CLKCMU_ISP_BUS_USER, "UMUX_CLKCMU_ISP_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_ISP_VRA, MUX_CLKCMU_ISP_VRA_USER, "UMUX_CLKCMU_ISP_VRA", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_ISP_GDC, MUX_CLKCMU_ISP_GDC_USER, "UMUX_CLKCMU_ISP_GDC", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS5P20P0_ISP_ISP, IS6P20P0_ISP_QCH_S_ISP_ISP, "GATE_IS5P20P0_ISP_ISP", "UMUX_CLKCMU_ISP_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS5P20P0_ISP_MCSC, IS6P20P0_ISP_QCH_S_ISP_MCSC, "GATE_IS5P20P0_ISP_MCSC", "UMUX_CLKCMU_ISP_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS5P20P0_ISP_VRA, IS6P20P0_ISP_QCH_S_ISP_VRA, "GATE_IS5P20P0_ISP_VRA", "UMUX_CLKCMU_ISP_VRA", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_IS5P20P0_ISP_GDC, IS6P20P0_ISP_QCH_S_ISP_GDC, "GATE_IS5P20P0_ISP_GDC", "UMUX_CLKCMU_ISP_GDC", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SMMU_IS0, IS6P20P0_ISP_QCH_S_ISP_SMMU_ISP0, "GATE_SMMU_IS0", "UMUX_CLKCMU_ISP_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SMMU_IS1, IS6P20P0_ISP_QCH_S_ISP_SMMU_ISP1, "GATE_SMMU_IS1", "UMUX_CLKCMU_ISP_BUS", 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_mfcmscl_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_MFCMSCL_MSCL, MUX_CLKCMU_MFCMSCL_MSCL_USER, "UMUX_CLKCMU_MFCMSCL_MSCL", NULL, 0, 0, NULL),
HWACG_VCLK(UMUX_CLKCMU_MFCMSCL_MFC, MUX_CLKCMU_MFCMSCL_MFC_USER, "UMUX_CLKCMU_MFCMSCL_MFC","UMUX_CLKCMU_MFCMSCL_MSCL", 0, 0, NULL),
HWACG_VCLK(GATE_G2D, G2D_QCH, "GATE_G2D", "UMUX_CLKCMU_MFCMSCL_MSCL", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_JPEG, JPEG_QCH, "GATE_JPEG", "UMUX_CLKCMU_MFCMSCL_MSCL", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MFC, MFC_QCH, "GATE_MFC", "UMUX_CLKCMU_MFCMSCL_MFC", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_MSCL, MSCL_QCH, "GATE_MSCL", "UMUX_CLKCMU_MFCMSCL_MSCL", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SMMU_MFCMSCL, SMMU_MFCMSCL_QCH, "GATE_SMMU_MFCMSCL", "UMUX_CLKCMU_MFCMSCL_MSCL", 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_mif_hwacg_vclks[] __initdata = {
HWACG_VCLK(GATE_WRAP_ADC_IF_0, WRAP_ADC_IF_QCH_0, "GATE_WRAP_ADC_IF_0", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_WRAP_ADC_IF_1, WRAP_ADC_IF_QCH_1, "GATE_WRAP_ADC_IF_1", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_PDMA, PDMA_CORE_QCH, "GATE_PDMA", NULL, 0, VCLK_GATE, NULL),
};
struct init_vclk exynos7885_peri_hwacg_vclks[] __initdata = {
HWACG_VCLK(UMUX_CLKCMU_PERI_BUS, MUX_CLKCMU_PERI_BUS_USER, "UMUX_CLKCMU_PERI_BUS", NULL, 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_UART_0, MUX_CLKCMU_PERI_UART_0_USER, "UMUX_CLKCMU_PERI_UART_0", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_UART_1, MUX_CLKCMU_PERI_UART_1_USER, "UMUX_CLKCMU_PERI_UART_1", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_UART_2, MUX_CLKCMU_PERI_UART_2_USER, "UMUX_CLKCMU_PERI_UART_2", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_USI0, MUX_CLKCMU_PERI_USI0_USER, "UMUX_CLKCMU_PERI_USI0", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_USI1, MUX_CLKCMU_PERI_USI1_USER, "UMUX_CLKCMU_PERI_USI1", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_USI2, MUX_CLKCMU_PERI_USI2_USER, "UMUX_CLKCMU_PERI_USI2", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_SPI0, MUX_CLKCMU_PERI_SPI0_USER, "UMUX_CLKCMU_PERI_SPI0", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(UMUX_CLKCMU_PERI_SPI1, MUX_CLKCMU_PERI_SPI1_USER, "UMUX_CLKCMU_PERI_SPI1", "UMUX_CLKCMU_PERI_BUS_USER", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_BUSIF_TMU, BUSIF_TMU_QCH, "GATE_BUSIF_TMU", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_PWM_MOTOR, LBLK_PERIC_QCH_PWM_MOTOR, "GATE_PWM_MOTOR", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C0, LBLK_PERIC_QCH_I2C0, "GATE_I2C0", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C1, LBLK_PERIC_QCH_I2C1, "GATE_I2C1", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C2, LBLK_PERIC_QCH_I2C2, "GATE_I2C2", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C3, LBLK_PERIC_QCH_I2C3, "GATE_I2C3", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C4, LBLK_PERIC_QCH_I2C4, "GATE_I2C4", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, "clk_peric_i2c4"),
HWACG_VCLK(GATE_I2C5, LBLK_PERIC_QCH_I2C5, "GATE_I2C5", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C6, LBLK_PERIC_QCH_I2C6, "GATE_I2C6", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_I2C7, LBLK_PERIC_QCH_I2C7, "GATE_I2C7", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SPI0, LBLK_PERIC_QCH_SPI0, "GATE_SPI0", "UMUX_CLKCMU_PERI_SPI0", 0, VCLK_GATE, NULL),
#ifdef ENABLE_SENSORS_FPRINT_SECURE
HWACG_VCLK(GATE_SPI1, LBLK_PERIC_QCH_SPI1, "GATE_SPI1", "UMUX_CLKCMU_PERI_SPI1", 0, VCLK_GATE, "fp-spi-pclk"),
#else
HWACG_VCLK(GATE_SPI1, LBLK_PERIC_QCH_SPI1, "GATE_SPI1", "UMUX_CLKCMU_PERI_SPI1", 0, VCLK_GATE, NULL),
#endif
HWACG_VCLK(GATE_HSI2C0, LBLK_PERIC_QCH_HSI2C0, "GATE_HSI2C0", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_HSI2C1, LBLK_PERIC_QCH_HSI2C1, "GATE_HSI2C1", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_HSI2C2, LBLK_PERIC_QCH_HSI2C2, "GATE_HSI2C2", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_HSI2C3, LBLK_PERIC_QCH_HSI2C3, "GATE_HSI2C3", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USI0, LBLK_PERIC_QCH_USI0, "GATE_USI0", "UMUX_CLKCMU_PERI_USI0", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USI1, LBLK_PERIC_QCH_USI1, "GATE_USI1", "UMUX_CLKCMU_PERI_USI1", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_USI2, LBLK_PERIC_QCH_USI2, "GATE_USI2", "UMUX_CLKCMU_PERI_USI2", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_UART0, LBLK_PERIC_QCH_UART0, "GATE_UART0", "UMUX_CLKCMU_PERI_UART_0", 0, VCLK_GATE, "console-pclk0"),
HWACG_VCLK(GATE_UART1, LBLK_PERIC_QCH_UART1, "GATE_UART1", "UMUX_CLKCMU_PERI_UART_1", 0, VCLK_GATE, "console-pclk1"),
HWACG_VCLK(GATE_UART2, LBLK_PERIC_QCH_UART2, "GATE_UART2", "UMUX_CLKCMU_PERI_UART_2", 0, VCLK_GATE, "console-pclk2"),
HWACG_VCLK(GATE_MCT, MCT_QCH, "GATE_MCT", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_OTP_CON_TOP, OTP_CON_TOP_QCH, "GATE_OTP_CON_TOP", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_SECUCON, SECUCON_QCH, "GATE_SECUCON", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_WDT_CLUSTER0, WDT_CLUSTER0_QCH, "GATE_WDT_CLUSTER0", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
HWACG_VCLK(GATE_WDT_CLUSTER1, WDT_CLUSTER1_QCH, "GATE_WDT_CLUSTER1", "UMUX_CLKCMU_PERI_BUS", 0, VCLK_GATE, NULL),
};
static struct init_vclk exynos7885_clkout_vclks[] __initdata = {
VCLK(OSCCLK_NFC, VCLK_CLKOUT1, "OSCCLK_NFC", 0, 0, NULL),
VCLK(OSCCLK_AUD, VCLK_CLKOUT0, "OSCCLK_AUD", 0, 0, NULL),
};
/* Special VCLK */
struct init_vclk exynos7885_fsys_vclks[] __initdata = {
VCLK(MMC_EMBD, CLKCMU_FSYS_MMC_EMBD, "MMC_EMBD", 0, 0, NULL),
VCLK(MMC_CARD, CLKCMU_FSYS_MMC_CARD, "MMC_CARD", 0, 0, NULL),
VCLK(MMC_SDIO, CLKCMU_FSYS_MMC_SDIO, "MMC_SDIO", 0, 0, NULL),
VCLK(PLL_OUT_USB, PLL_USB, "PLL_OUT_USB", 0, 0, NULL),
};
struct init_vclk exynos7885_cmu_vclks[] __initdata = {
VCLK(CIS_CLK0, VCLK_CLKCMU_CIS_CLK0_BLK_CMU, "CIS_CLK0", 0, 0, NULL),
VCLK(CIS_CLK1, VCLK_CLKCMU_CIS_CLK1_BLK_CMU, "CIS_CLK1", 0, 0, NULL),
VCLK(CIS_CLK2, VCLK_CLKCMU_CIS_CLK2_BLK_CMU, "CIS_CLK2", 0, 0, NULL),
};
struct init_vclk exynos7885_peri_vclks[] __initdata = {
VCLK(UART_0, CLKCMU_PERI_UART_0, "UART_0", 0, 0, "console-sclk0"),
VCLK(UART_1, CLKCMU_PERI_UART_1, "UART_1", 0, 0, "console-sclk1"),
VCLK(UART_2, CLKCMU_PERI_UART_2, "UART_2", 0, 0, "console-sclk2"),
VCLK(SPI_0, VCLK_SPL_CLK_PERI_SPI_0_BLK_CMU, "SPI_0", 0, 0, NULL),
#ifdef ENABLE_SENSORS_FPRINT_SECURE
VCLK(SPI_1, VCLK_SPL_CLK_PERI_SPI_1_BLK_CMU, "SPI_1", 0, 0, "fp-spi-sclk"),
#else
VCLK(SPI_1, VCLK_SPL_CLK_PERI_SPI_1_BLK_CMU, "SPI_1", 0, 0, NULL),
#endif
VCLK(USI0, VCLK_SPL_CLK_PERI_USI0_BLK_CMU, "USI0", 0, 0, NULL),
VCLK(USI1, VCLK_SPL_CLK_PERI_USI1_BLK_CMU, "USI1", 0, 0, NULL),
VCLK(USI2, VCLK_SPL_CLK_PERI_USI2_BLK_CMU, "USI2", 0, 0, NULL),
};
struct init_vclk exynos7885_dispaud_vclks[] __initdata = {
VCLK(DOUT_CLK_ABOX_AUDIF, DIV_CLK_AUD_AUDIF, "DOUT_CLK_ABOX_AUDIF", 0, 0, NULL),
VCLK(DOUT_CLK_ABOX_UAIF0, DIV_CLK_AUD_UAIF0, "DOUT_CLK_ABOX_UAIF0", 0, 0, NULL),
VCLK(DOUT_CLK_ABOX_UAIF2, DIV_CLK_AUD_UAIF2, "DOUT_CLK_ABOX_UAIF2", 0, 0, NULL),
VCLK(DOUT_CLK_ABOX_UAIF3, DIV_CLK_AUD_UAIF3, "DOUT_CLK_ABOX_UAIF3", 0, 0, NULL),
VCLK(PLL_OUT_AUD, PLL_AUD, "PLL_OUT_AUD", 0, 0, NULL),
};
struct init_vclk exynos7885_dvfs_vclks[] __initdata = {
};
static __initdata struct of_device_id ext_clk_match[] = {
{.compatible = "samsung,exynos7885-oscclk", .data = (void *)0},
{},
};
void exynos7885_vclk_init(void)
{
cal_clk_setrate(DIV_CLK_AUD_FM, 40000);
}
/* register exynos7885 clocks */
void __init exynos7885_clk_init(struct device_node *np)
{
void __iomem *reg_base;
int ret;
if (np) {
reg_base = of_iomap(np, 0);
if (!reg_base)
panic("%s: failed to map registers\n", __func__);
} else {
panic("%s: unable to determine soc\n", __func__);
}
ret = cal_if_init(np);
if (ret)
panic("%s: unable to initialize cal-if\n", __func__);
exynos7885_clk_provider = samsung_clk_init(np, reg_base, CLK_NR_CLKS);
if (!exynos7885_clk_provider)
panic("%s: unable to allocate context.\n", __func__);
samsung_register_of_fixed_ext(exynos7885_clk_provider, exynos7885_fixed_rate_ext_clks,
ARRAY_SIZE(exynos7885_fixed_rate_ext_clks),
ext_clk_match);
/* register HWACG vclk */
samsung_register_vclk(exynos7885_clk_provider, exynos7885_apm_hwacg_vclks, ARRAY_SIZE(exynos7885_apm_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_cam_hwacg_vclks, ARRAY_SIZE(exynos7885_cam_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_cmu_hwacg_vclks, ARRAY_SIZE(exynos7885_cmu_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_dispaud_hwacg_vclks, ARRAY_SIZE(exynos7885_dispaud_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_fsys_hwacg_vclks, ARRAY_SIZE(exynos7885_fsys_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_g3d_hwacg_vclks, ARRAY_SIZE(exynos7885_g3d_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_isp_hwacg_vclks, ARRAY_SIZE(exynos7885_isp_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_mfcmscl_hwacg_vclks, ARRAY_SIZE(exynos7885_mfcmscl_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_mif_hwacg_vclks, ARRAY_SIZE(exynos7885_mif_hwacg_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_peri_hwacg_vclks, ARRAY_SIZE(exynos7885_peri_hwacg_vclks));
/* register special vclk */
samsung_register_vclk(exynos7885_clk_provider, exynos7885_fsys_vclks, ARRAY_SIZE(exynos7885_fsys_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_cmu_vclks, ARRAY_SIZE(exynos7885_cmu_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_peri_vclks, ARRAY_SIZE(exynos7885_peri_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_dispaud_vclks, ARRAY_SIZE(exynos7885_dispaud_vclks));
samsung_register_vclk(exynos7885_clk_provider, exynos7885_clkout_vclks, ARRAY_SIZE(exynos7885_clkout_vclks));
/* register DVFS vclk */
samsung_register_vclk(exynos7885_clk_provider, exynos7885_dvfs_vclks, ARRAY_SIZE(exynos7885_dvfs_vclks));
clk_register_fixed_factor(NULL, "pwm-clock", "fin_pll",CLK_SET_RATE_PARENT, 1, 1);
samsung_clk_of_add_provider(np, exynos7885_clk_provider);
late_time_init = exynos7885_vclk_init;
pr_info("EXYNOS7885: Clock setup completed\n");
}
CLK_OF_DECLARE(exynos7885_clk, "samsung,exynos7885-clock", exynos7885_clk_init);