Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SPDX-License-Identifier: GPL-2.0-only
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/of.h>
- #include <linux/platform_device.h>
- #include <linux/regmap.h>
- #include <linux/clk-provider.h>
- #include "clk-alpha-pll.h"
- #include "clk-regmap.h"
- #include "clk-rcg.h"
- #include "clk-pll.h"
- #include "clk-regmap-mux.h"
- #include <dt-bindings/clock/qcom,gcc-msm8255.h>
- // EXTREMELY NEEDED STATIC STRUCTS FOR 1440+ LINES!
- static struct clk_rcg mdp_lcdc_pclk_clk;
- static struct clk_rcg mdp_lcdc_pad_pclk_clk;
- static struct clk_rcg mdp_vsync_clk;
- static struct clk_rcg mi2s_codec_rx_m_clk;
- static struct clk_gate mi2s_codec_rx_s_clk;
- static struct clk_rcg mi2s_codec_tx_m_clk;
- static struct clk_gate mi2s_codec_tx_s_clk;
- static struct clk_rcg mi2s_m_clk;
- static struct clk_gate mi2s_s_clk;
- static struct clk_regmap_mux acpu_clk;
- // DO NOT ABSOLUTE DELETE ANYTHING ABOVE THIS SPECIFIC COMMENT! unless its unused
- static const struct clk_parent_data gcc_msm8255_parent_data[] = {
- { .fw_name = "cxo_board", .name = "cxo_board" },
- { .fw_name = "pll1_clk", .name = "pll1_clk" },
- { .fw_name = "pll4_clk", .name = "pll4_clk" },
- { .fw_name = "pll3_clk", .name = "pll3_clk" },
- };
- /* PLL1 */
- static struct clk_pll pll1_clk = {
- .l_reg = 0x0264,
- .status_reg = 0x0334,
- .status_bit = 16,
- .clkr = {
- .enable_reg = 0x0264,
- .enable_mask = BIT(1),
- .hw.init = &(struct clk_init_data){
- .name = "pll1_clk",
- .parent_data = &(const struct clk_parent_data){
- .fw_name = "cxo_board",
- },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- },
- };
- /* PLL2 */
- static struct clk_pll pll2_clk = {
- .l_reg = 0x0264,
- .status_reg = 0x0350,
- .status_bit = 16,
- .clkr = {
- .enable_reg = 0x0264,
- .enable_mask = BIT(2),
- .hw.init = &(struct clk_init_data){
- .name = "pll2_clk",
- .parent_data = &(const struct clk_parent_data){
- .fw_name = "cxo_board",
- },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- },
- };
- /* PLL3 */
- static struct clk_pll pll3_clk = {
- .l_reg = 0x0264,
- .status_reg = 0x036c,
- .status_bit = 16,
- .clkr = {
- .enable_reg = 0x0264,
- .enable_mask = BIT(3),
- .hw.init = &(struct clk_init_data){
- .name = "pll3_clk",
- .parent_data = &(const struct clk_parent_data){
- .fw_name = "lpxo_board",
- },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- },
- };
- /* PLL4 */
- static struct clk_pll pll4_clk = {
- .l_reg = 0x0264,
- .status_reg = 0x0254,
- .status_bit = 16,
- .clkr = {
- .enable_reg = 0x0264,
- .enable_mask = BIT(4),
- .hw.init = &(struct clk_init_data){
- .name = "pll4_clk",
- .parent_data = &(const struct clk_parent_data){
- .fw_name = "cxo_board",
- },
- .num_parents = 1,
- .ops = &clk_pll_vote_ops,
- },
- },
- };
- static struct clk_gate glbl_root_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 29,
- .hw.init = &(struct clk_init_data){
- .name = "glbl_root_clk",
- .parent_data = &(const struct clk_parent_data){
- .fw_name = "lpxo_board",
- },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_li_apps_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 2,
- .hw.init = &(struct clk_init_data){
- .name = "axi_li_apps_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_li_adsp_a_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 14,
- .hw.init = &(struct clk_init_data){
- .name = "axi_li_adsp_a_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_apps_clk.hw },
- .num_parents = 1,
- .ops = &clk_rcg2_gp_ops,
- },
- };
- static struct clk_gate axi_li_jpeg_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 19,
- .hw.init = &(struct clk_init_data){
- .name = "axi_li_jpeg_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_apps_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_li_vfe_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 23,
- .hw.init = &(struct clk_init_data){
- .name = "axi_li_vfe_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_apps_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_mdp_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 29,
- .hw.init = &(struct clk_init_data){
- .name = "axi_mdp_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_apps_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_li_vg_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 3,
- .hw.init = &(struct clk_init_data){
- .name = "axi_li_vg_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_grp_2d_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 21,
- .hw.init = &(struct clk_init_data){
- .name = "axi_grp_2d_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_vg_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_li_grp_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 22,
- .hw.init = &(struct clk_init_data){
- .name = "axi_li_grp_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_vg_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_mfc_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 20,
- .hw.init = &(struct clk_init_data){
- .name = "axi_mfc_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_vg_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_rotator_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 22,
- .hw.init = &(struct clk_init_data){
- .name = "axi_rotator_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_vg_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate axi_vpe_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 21,
- .hw.init = &(struct clk_init_data){
- .name = "axi_vpe_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_vg_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate adm_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 5,
- .hw.init = &(struct clk_init_data){
- .name = "adm_clk",
- .parent_hws = (const struct clk_hw *[]){ &axi_li_apps_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate adm_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 15,
- .hw.init = &(struct clk_init_data){
- .name = "adm_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate ce_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 6,
- .hw.init = &(struct clk_init_data){
- .name = "ce_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate camif_pad_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "camif_pad_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate csi0_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 30,
- .hw.init = &(struct clk_init_data){
- .name = "csi0_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate emdh_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 3,
- .hw.init = &(struct clk_init_data){
- .name = "emdh_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate grp_2d_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 24,
- .hw.init = &(struct clk_init_data){
- .name = "grp_2d_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate grp_3d_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 17,
- .hw.init = &(struct clk_init_data){
- .name = "grp_3d_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate jpeg_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 24,
- .hw.init = &(struct clk_init_data){
- .name = "jpeg_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate lpa_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 7,
- .hw.init = &(struct clk_init_data){
- .name = "lpa_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate mdp_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 6,
- .hw.init = &(struct clk_init_data){
- .name = "mdp_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate mfc_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 26,
- .hw.init = &(struct clk_init_data){
- .name = "mfc_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate pmdh_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 4,
- .hw.init = &(struct clk_init_data){
- .name = "pmdh_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate rotator_imem_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 23,
- .hw.init = &(struct clk_init_data){
- .name = "rotator_imem_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate rotator_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 25,
- .hw.init = &(struct clk_init_data){
- .name = "rotator_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate sdc1_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 7,
- .hw.init = &(struct clk_init_data){
- .name = "sdc1_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate sdc2_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 8,
- .hw.init = &(struct clk_init_data){
- .name = "sdc2_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate sdc3_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 27,
- .hw.init = &(struct clk_init_data){
- .name = "sdc3_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate sdc4_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 28,
- .hw.init = &(struct clk_init_data){
- .name = "sdc4_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate spi_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 10,
- .hw.init = &(struct clk_init_data){
- .name = "spi_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate tsif_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 18,
- .hw.init = &(struct clk_init_data){
- .name = "tsif_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate uart1dm_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 17,
- .hw.init = &(struct clk_init_data){
- .name = "uart1dm_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate uart2dm_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 26,
- .hw.init = &(struct clk_init_data){
- .name = "uart2dm_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs2_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 8,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs2_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs3_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs3_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs_p_clk = {
- .reg = (void __iomem *)0x03bc,
- .bit_idx = 25,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate vfe_p_clk = {
- .reg = (void __iomem *)0x03c0,
- .bit_idx = 27,
- .hw.init = &(struct clk_init_data){
- .name = "vfe_p_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static const struct freq_tbl ftbl_gcc_csi_clk[] = {
- F(153600000, 1, 2, 2, 5),
- F(192000000, 1, 4, 0, 0),
- F(384000000, 1, 2, 0, 0),
- { }
- };
- static struct clk_rcg csi0_clk = {
- .ns_reg = 0x0174,
- .md_reg = 0x0170,
- .freq_tbl = ftbl_gcc_csi_clk,
- .clkr = {
- .enable_reg = 0x0174,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "csi0_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg i2c_clk = {
- .ns_reg = 0x0068,
- .clkr = {
- .enable_reg = 0x0068,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "i2c_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg i2c_2_clk = {
- .ns_reg = 0x02d8,
- .clkr = {
- .enable_reg = 0x02d8,
- .enable_mask = BIT(0),
- .hw.init = &(struct clk_init_data){
- .name = "i2c_2_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg qup_i2c_clk = {
- .ns_reg = 0x04f0,
- .clkr = {
- .enable_reg = 0x04f0,
- .enable_mask = BIT(0),
- .hw.init = &(struct clk_init_data){
- .name = "qup_i2c_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg uart1_clk = {
- .ns_reg = 0x00e0,
- .clkr = {
- .enable_reg = 0x00e0,
- .enable_mask = BIT(5),
- .hw.init = &(struct clk_init_data){
- .name = "uart1_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static const struct freq_tbl ftbl_gcc_uartdm_clk[] = {
- { 3686400, 3, 5, 3, 200 },
- { 7372800, 3, 5, 3, 100 },
- { 14745600, 3, 5, 3, 50 },
- { 32000000, 3, 5, 25, 192 },
- { 40000000, 3, 5, 125, 768 },
- { 46400000, 3, 5, 145, 768 },
- { 48000000, 3, 5, 25, 128 },
- { 51200000, 3, 5, 5, 24 },
- { 56000000, 3, 5, 175, 768 },
- { 58982400, 3, 5, 6, 25 },
- { 64000000, 1, 7, 1, 3 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mdh_clk[] = {
- { 49150000, 3, 29, 0, 0 },
- { 92160000, 3, 15, 0, 0 },
- { 122880000, 3, 11, 0, 0 },
- { 184320000, 3, 7, 0, 0 },
- { 245760000, 3, 5, 0, 0 },
- { 368640000, 3, 3, 0, 0 },
- { 384000000, 1, 3, 0, 0 },
- { 445500000, 2, 3, 0, 0 },
- { }
- };
- static struct clk_rcg uart2_clk = {
- .ns_reg = 0x0464,
- .clkr = {
- .enable_reg = 0x0464,
- .enable_mask = BIT(5),
- .hw.init = &(struct clk_init_data){
- .name = "uart2_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg uart1dm_clk = {
- .ns_reg = 0x00d4,
- .md_reg = 0x00d0,
- .freq_tbl = ftbl_gcc_uartdm_clk,
- .clkr = {
- .enable_reg = 0x00d4,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "uart1dm_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg uart2dm_clk = {
- .ns_reg = 0x00dc,
- .md_reg = 0x00d8,
- .freq_tbl = ftbl_gcc_uartdm_clk,
- .clkr = {
- .enable_reg = 0x00dc,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "uart2dm_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static const struct freq_tbl ftbl_gcc_grp_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 46080000, 3, 31, 0, 0 },
- { 49152000, 3, 29, 0, 0 },
- { 52662875, 3, 27, 0, 0 },
- { 56713846, 3, 25, 0, 0 },
- { 61440000, 3, 23, 0, 0 },
- { 67025454, 3, 21, 0, 0 },
- { 73728000, 3, 19, 0, 0 },
- { 81920000, 3, 17, 0, 0 },
- { 92160000, 3, 15, 0, 0 },
- { 105325714, 3, 13, 0, 0 },
- { 122880000, 3, 11, 0, 0 },
- { 147456000, 3, 9, 0, 0 },
- { 184320000, 3, 7, 0, 0 },
- { 192000000, 1, 7, 0, 0 },
- { 245760000, 3, 5, 0, 0 },
- { }
- };
- static struct clk_rcg emdh_clk = {
- .ns_reg = 0x0050,
- .freq_tbl = ftbl_gcc_mdh_clk,
- .clkr = {
- .enable_reg = 0x0050,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "emdh_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg pmdh_clk = {
- .ns_reg = 0x008c,
- .freq_tbl = ftbl_gcc_mdh_clk,
- .clkr = {
- .enable_reg = 0x008c,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "pmdh_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg grp_2d_clk = {
- .ns_reg = 0x0034,
- .freq_tbl = ftbl_gcc_grp_clk,
- .clkr = {
- .enable_reg = 0x0034,
- .enable_mask = BIT(7),
- .hw.init = &(struct clk_init_data){
- .name = "grp_2d_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg grp_3d_src_clk = {
- .ns_reg = 0x0084,
- .freq_tbl = ftbl_gcc_grp_clk,
- .clkr = {
- .enable_reg = 0x0084,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "grp_3d_src_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_gate imem_clk = {
- .reg = (void __iomem *)0x0084,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "imem_clk",
- .parent_hws = (const struct clk_hw *[]){ &grp_3d_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate grp_3d_clk = {
- .reg = (void __iomem *)0x0084,
- .bit_idx = 7,
- .hw.init = &(struct clk_init_data){
- .name = "grp_3d_clk",
- .parent_hws = (const struct clk_hw *[]){ &grp_3d_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static const struct freq_tbl ftbl_gcc_sdc1_3_clk[] = {
- { 144000, 0, 1, 1, 171 },
- { 400000, 0, 1, 2, 123 },
- { 16027000, 3, 5, 14, 215 },
- { 17000000, 3, 7, 19, 206 },
- { 20480000, 3, 7, 23, 212 },
- { 24576000, 0, 1, 0, 0 },
- { 49152000, 3, 5, 1, 5 },
- { }
- };
- static struct clk_rcg sdc1_clk = {
- .ns_reg = 0x00a4,
- .md_reg = 0x00a0,
- .freq_tbl = ftbl_gcc_sdc1_3_clk,
- .clkr = {
- .enable_reg = 0x00a4,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdc1_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg sdc3_clk = {
- .ns_reg = 0x00b4,
- .md_reg = 0x00b0,
- .freq_tbl = ftbl_gcc_sdc1_3_clk,
- .clkr = {
- .enable_reg = 0x00b4,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdc3_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static const struct freq_tbl ftbl_gcc_sdc2_4_clk[] = {
- { 144000, 0, 1, 1, 171 },
- { 400000, 0, 1, 2, 123 },
- { 16027000, 3, 5, 14, 215 },
- { 17000000, 3, 7, 19, 206 },
- { 20480000, 3, 7, 23, 212 },
- { 24576000, 0, 1, 0, 0 },
- { 49152000, 3, 5, 1, 5 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mdp_core_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 46080000, 3, 31, 0, 0 },
- { 49152000, 3, 29, 0, 0 },
- { 52663000, 3, 27, 0, 0 },
- { 92160000, 3, 15, 0, 0 },
- { 122880000, 3, 11, 0, 0 },
- { 147456000, 3, 9, 0, 0 },
- { 153600000, 1, 9, 0, 0 },
- { 192000000, 1, 7, 0, 0 },
- { }
- };
- static struct clk_rcg sdc2_clk = {
- .ns_reg = 0x00ac,
- .md_reg = 0x00a8,
- .freq_tbl = ftbl_gcc_sdc2_4_clk,
- .clkr = {
- .enable_reg = 0x00ac,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdc2_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg sdc4_clk = {
- .ns_reg = 0x00bc,
- .md_reg = 0x00b8,
- .freq_tbl = ftbl_gcc_sdc2_4_clk,
- .clkr = {
- .enable_reg = 0x00bc,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdc4_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg mdp_clk = {
- .ns_reg = 0x014c,
- .freq_tbl = ftbl_gcc_mdp_core_clk,
- .clkr = {
- .enable_reg = 0x014c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "mdp_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static const struct freq_tbl ftbl_gcc_mdp_lcdc_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 30720000, 3, 7, 1, 6 },
- { 32768000, 3, 5, 2, 15 },
- { 40960000, 3, 3, 1, 9 },
- { 73728000, 3, 3, 1, 5 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mdp_vsync_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mi2s_codec_clk[] = {
- { 2048000, 0, 7, 1, 3 },
- { 12288000, 0, 3, 0, 0 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mi2s_clk[] = {
- { 12288000, 0, 3, 0, 0 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_sdac_clk[] = {
- { 256000, 0, 7, 1, 24 },
- { 352800, 0, 1, 147, 10240 },
- { 384000, 0, 7, 1, 16 },
- { 512000, 0, 7, 1, 12 },
- { 705600, 0, 1, 147, 5120 },
- { 768000, 0, 7, 1, 8 },
- { 1024000, 0, 7, 1, 6 },
- { 1411200, 0, 1, 147, 2560 },
- { 1536000, 0, 7, 1, 4 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_tv_clk[] = {
- { 27000000, 2, 3, 2, 33 },
- { 74250000, 2, 3, 1, 6 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_usb_clk[] = {
- { 60000000, 1, 3, 5, 32 },
- { }
- };
- static struct clk_rcg sdac_clk = {
- .ns_reg = 0x009c,
- .md_reg = 0x0098,
- .freq_tbl = ftbl_gcc_sdac_clk,
- .clkr = {
- .enable_reg = 0x009c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "sdac_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_gate sdac_m_clk = {
- .reg = (void __iomem *)0x009c,
- .bit_idx = 12,
- .hw.init = &(struct clk_init_data){
- .name = "sdac_m_clk",
- .parent_hws = (const struct clk_hw *[]){ &sdac_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_rcg tv_clk = {
- .ns_reg = 0x00cc,
- .md_reg = 0x00c8,
- .freq_tbl = ftbl_gcc_tv_clk,
- .clkr = {
- .enable_reg = 0x00cc,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "tv_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_gate hdmi_clk = {
- .reg = (void __iomem *)0x0484,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "hdmi_clk",
- .parent_hws = (const struct clk_hw *[]){ &tv_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate tv_dac_clk = {
- .reg = (void __iomem *)0x00cc,
- .bit_idx = 12,
- .hw.init = &(struct clk_init_data){
- .name = "tv_dac_clk",
- .parent_hws = (const struct clk_hw *[]){ &tv_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate tv_enc_clk = {
- .reg = (void __iomem *)0x00cc,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "tv_enc_clk",
- .parent_hws = (const struct clk_hw *[]){ &tv_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate tsif_ref_clk = {
- .reg = (void __iomem *)0x00c4,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "tsif_ref_clk",
- .parent_hws = (const struct clk_hw *[]){ &tv_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_rcg usb_hs_src_clk = {
- .ns_reg = 0x02c0,
- .md_reg = 0x02bc,
- .freq_tbl = ftbl_gcc_usb_clk,
- .clkr = {
- .enable_reg = 0x02c0,
- .enable_mask = BIT(11),
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs_src_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_gate usb_hs_clk = {
- .reg = (void __iomem *)0x02c0,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs_clk",
- .parent_hws = (const struct clk_hw *[]){ &usb_hs_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs_core_clk = {
- .reg = (void __iomem *)0x02c0,
- .bit_idx = 13,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs_core_clk",
- .parent_hws = (const struct clk_hw *[]){ &usb_hs_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs2_clk = {
- .reg = (void __iomem *)0x046c,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs2_clk",
- .parent_hws = (const struct clk_hw *[]){ &usb_hs_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs2_core_clk = {
- .reg = (void __iomem *)0x046c,
- .bit_idx = 4,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs2_core_clk",
- .parent_hws = (const struct clk_hw *[]){ &usb_hs_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static const struct freq_tbl ftbl_gcc_vfe_jpeg_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 36864000, 3, 7, 1, 5 },
- { 46080000, 3, 7, 1, 4 },
- { 61440000, 3, 7, 1, 3 },
- { 73728000, 3, 3, 1, 5 },
- { 81920000, 3, 5, 1, 3 },
- { 92160000, 3, 7, 1, 2 },
- { 98304000, 3, 5, 2, 5 },
- { 105326000, 3, 3, 2, 7 },
- { 122880000, 3, 3, 1, 3 },
- { 147456000, 3, 3, 2, 5 },
- { 153600000, 1, 3, 2, 5 },
- { 192000000, 1, 7, 0, 0 },
- { }
- };
- static struct clk_gate usb_hs3_clk = {
- .reg = (void __iomem *)0x0470,
- .bit_idx = 9,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs3_clk",
- .parent_hws = (const struct clk_hw *[]){ &usb_hs_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate usb_hs3_core_clk = {
- .reg = (void __iomem *)0x0470,
- .bit_idx = 4,
- .hw.init = &(struct clk_init_data){
- .name = "usb_hs3_core_clk",
- .parent_hws = (const struct clk_hw *[]){ &usb_hs_src_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_rcg jpeg_clk = {
- .ns_reg = 0x0164,
- .md_reg = 0x0160,
- .freq_tbl = ftbl_gcc_vfe_jpeg_clk,
- .clkr = {
- .enable_reg = 0x0164,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "jpeg_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg vfe_clk = {
- .ns_reg = 0x0044,
- .md_reg = 0x0040,
- .freq_tbl = ftbl_gcc_vfe_jpeg_clk,
- .clkr = {
- .enable_reg = 0x0044,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "vfe_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_gate vfe_mdc_clk = {
- .reg = (void __iomem *)0x0044,
- .bit_idx = 11,
- .hw.init = &(struct clk_init_data){
- .name = "vfe_mdc_clk",
- .parent_hws = (const struct clk_hw *[]){ &vfe_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate vfe_camif_clk = {
- .reg = (void __iomem *)0x0044,
- .bit_idx = 15,
- .hw.init = &(struct clk_init_data){
- .name = "vfe_camif_clk",
- .parent_hws = (const struct clk_hw *[]){ &vfe_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_gate csi0_vfe_clk = {
- .reg = (void __iomem *)0x0174,
- .bit_idx = 15,
- .hw.init = &(struct clk_init_data){
- .name = "csi0_vfe_clk",
- .parent_hws = (const struct clk_hw *[]){ &vfe_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- // i must remember mdp4... i must remember mdp4...
- // anyway heres a freq table, get ready for 4square
- static const struct freq_tbl ftbl_mdp_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 61440000, 3, 7, 1, 3 },
- { 81920000, 3, 5, 1, 3 },
- { 122880000, 3, 5, 1, 2 },
- { 153600000, 1, 1, 1, 5 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_cam_clk[] = {
- { 6000000, 1, 7, 1, 32 },
- { 8000000, 1, 7, 1, 24 },
- { 12000000, 1, 7, 1, 16 },
- { 16000000, 1, 7, 1, 12 },
- { 19200000, 1, 7, 1, 10 },
- { 24000000, 1, 7, 1, 8 },
- { 32000000, 1, 7, 1, 6 },
- { 48000000, 1, 7, 1, 4 },
- { 64000000, 1, 7, 1, 3 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_vpe_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 30720000, 3, 7, 1, 6 },
- { 61440000, 3, 7, 1, 3 },
- { 81920000, 3, 5, 1, 3 },
- { 122880000, 3, 5, 1, 2 },
- { 147456000, 3, 1, 1, 5 },
- { 153600000, 1, 1, 1, 5 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mfc_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 30720000, 3, 7, 1, 6 },
- { 61440000, 3, 7, 1, 3 },
- { 81920000, 3, 5, 1, 3 },
- { 122880000, 3, 5, 1, 2 },
- { 147456000, 3, 1, 1, 5 },
- { 153600000, 1, 1, 1, 5 },
- { 170667000, 1, 1, 2, 9 },
- { }
- };
- static struct clk_rcg cam_m_clk = {
- .ns_reg = 0x0374,
- .md_reg = 0x0370,
- .freq_tbl = ftbl_gcc_cam_clk,
- .clkr = {
- .enable_reg = 0x0374,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "cam_m_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg vpe_clk = {
- .ns_reg = 0x015c,
- .md_reg = 0x0158,
- .freq_tbl = ftbl_gcc_vpe_clk,
- .clkr = {
- .enable_reg = 0x015c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "vpe_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg mfc_clk = {
- .ns_reg = 0x0154,
- .md_reg = 0x0150,
- .freq_tbl = ftbl_gcc_mfc_clk,
- .clkr = {
- .enable_reg = 0x0154,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "mfc_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static const struct freq_tbl ftbl_gcc_spi_clk[] = {
- { 9963243, 3, 5, 2, 37 },
- { 24576000, 0, 1, 0, 0 },
- { 26331429, 3, 5, 1, 7 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_lpa_codec_clk[] = {
- { 1, 1, 1, 0, 0 },
- { 2, 2, 1, 0, 0 },
- { 3, 3, 1, 0, 0 },
- { 4, 4, 1, 0, 0 },
- { }
- };
- static const struct freq_tbl ftbl_gcc_mdc_clk[] = {
- { 1, 0, 1, 0, 0 },
- { }
- };
- static struct clk_gate mfc_div2_clk = {
- .reg = (void __iomem *)0x0154,
- .bit_idx = 15,
- .hw.init = &(struct clk_init_data){
- .name = "mfc_div2_clk",
- .parent_hws = (const struct clk_hw *[]){ &mfc_clk.clkr.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_rcg spi_clk = {
- .ns_reg = 0x02c8,
- .md_reg = 0x02c4,
- .freq_tbl = ftbl_gcc_spi_clk,
- .clkr = {
- .enable_reg = 0x02c8,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "spi_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg lpa_codec_clk = {
- .ns_reg = 0x02e8,
- .freq_tbl = ftbl_gcc_lpa_codec_clk,
- .clkr = {
- .enable_reg = 0x02e8,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "lpa_codec_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_rcg mdc_clk = {
- .ns_reg = 0x007c,
- .freq_tbl = ftbl_gcc_mdc_clk,
- .clkr = {
- .enable_reg = 0x007c,
- .enable_mask = BIT(9),
- .hw.init = &(struct clk_init_data){
- .name = "mdc_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_rcg_ops,
- },
- },
- };
- static struct clk_gate lpa_core_clk = {
- .reg = (void __iomem *)0x02e8,
- .bit_idx = 5,
- .hw.init = &(struct clk_init_data){
- .name = "lpa_core_clk",
- .parent_hws = (const struct clk_hw *[]){ &glbl_root_clk.hw },
- .num_parents = 1,
- .ops = &clk_gate_ops,
- },
- };
- static __maybe_unused struct clk_gate gcc_msm8255_debug_mux = {
- .reg = (void __iomem *)0x011c,
- .bit_idx = 0,
- .hw.init = &(struct clk_init_data){
- .name = "gcc_debug_mux",
- .ops = &clk_gate_ops,
- },
- };
- static struct clk_regmap *gcc_msm8255_clocks[] = {
- [PLL1_CLK] = &pll1_clk.clkr,
- [PLL2_CLK] = (struct clk_regmap *)&pll2_clk,
- [PLL3_CLK] = &pll3_clk.clkr,
- [PLL4_CLK] = &pll4_clk.clkr,
- [GLBL_ROOT_CLK] = (struct clk_regmap *)&glbl_root_clk,
- [AXI_LI_APPS_CLK] = (struct clk_regmap *)&axi_li_apps_clk,
- [AXI_LI_ADSP_A_CLK] = (struct clk_regmap *)&axi_li_adsp_a_clk,
- [AXI_LI_JPEG_CLK] = (struct clk_regmap *)&axi_li_jpeg_clk,
- [AXI_LI_VFE_CLK] = (struct clk_regmap *)&axi_li_vfe_clk,
- [AXI_MDP_CLK] = (struct clk_regmap *)&axi_mdp_clk,
- [AXI_LI_VG_CLK] = (struct clk_regmap *)&axi_li_vg_clk,
- [AXI_GRP_2D_CLK] = (struct clk_regmap *)&axi_grp_2d_clk,
- [AXI_LI_GRP_CLK] = (struct clk_regmap *)&axi_li_grp_clk,
- [AXI_MFC_CLK] = (struct clk_regmap *)&axi_mfc_clk,
- [AXI_ROTATOR_CLK] = (struct clk_regmap *)&axi_rotator_clk,
- [AXI_VPE_CLK] = (struct clk_regmap *)&axi_vpe_clk,
- [ADM_CLK] = (struct clk_regmap *)&adm_clk,
- [ADM_P_CLK] = (struct clk_regmap *)&adm_p_clk,
- [CE_CLK] = (struct clk_regmap *)&ce_clk,
- [CAMIF_PAD_P_CLK] = (struct clk_regmap *)&camif_pad_p_clk,
- [CSI0_P_CLK] = (struct clk_regmap *)&csi0_p_clk,
- [EMDH_P_CLK] = (struct clk_regmap *)&emdh_p_clk,
- [GRP_2D_P_CLK] = (struct clk_regmap *)&grp_2d_p_clk,
- [GRP_3D_P_CLK] = (struct clk_regmap *)&grp_3d_p_clk,
- [JPEG_P_CLK] = (struct clk_regmap *)&jpeg_p_clk,
- [LPA_P_CLK] = (struct clk_regmap *)&lpa_p_clk,
- [MDP_P_CLK] = (struct clk_regmap *)&mdp_p_clk,
- [MFC_P_CLK] = (struct clk_regmap *)&mfc_p_clk,
- [PMDH_P_CLK] = (struct clk_regmap *)&pmdh_p_clk,
- [ROTATOR_IMEM_CLK] = (struct clk_regmap *)&rotator_imem_clk,
- [ROTATOR_P_CLK] = (struct clk_regmap *)&rotator_p_clk,
- [SDC1_P_CLK] = (struct clk_regmap *)&sdc1_p_clk,
- [SDC2_P_CLK] = (struct clk_regmap *)&sdc2_p_clk,
- [SDC3_P_CLK] = (struct clk_regmap *)&sdc3_p_clk,
- [SDC4_P_CLK] = (struct clk_regmap *)&sdc4_p_clk,
- [SPI_P_CLK] = (struct clk_regmap *)&spi_p_clk,
- [TSIF_P_CLK] = (struct clk_regmap *)&tsif_p_clk,
- [UART1DM_P_CLK] = (struct clk_regmap *)&uart1dm_p_clk,
- [UART2DM_P_CLK] = (struct clk_regmap *)&uart2dm_p_clk,
- [USB_HS2_P_CLK] = (struct clk_regmap *)&usb_hs2_p_clk,
- [USB_HS3_P_CLK] = (struct clk_regmap *)&usb_hs3_p_clk,
- [USB_HS_P_CLK] = (struct clk_regmap *)&usb_hs_p_clk,
- [VFE_P_CLK] = (struct clk_regmap *)&vfe_p_clk,
- [CSI0_CLK] = &csi0_clk.clkr,
- [I2C_CLK] = &i2c_clk.clkr,
- [I2C_2_CLK] = &i2c_2_clk.clkr,
- [QUP_I2C_CLK] = &qup_i2c_clk.clkr,
- [UART1_CLK] = &uart1_clk.clkr,
- [UART2_CLK] = &uart2_clk.clkr,
- [UART1DM_CLK] = &uart1dm_clk.clkr,
- [UART2DM_CLK] = &uart2dm_clk.clkr,
- [EMDH_CLK] = &emdh_clk.clkr,
- [PMDH_CLK] = &pmdh_clk.clkr,
- [GRP_2D_CLK] = &grp_2d_clk.clkr,
- [GRP_3D_SRC_CLK] = &grp_3d_src_clk.clkr,
- [GRP_3D_CLK] = (struct clk_regmap *)&grp_3d_clk,
- [IMEM_CLK] = (struct clk_regmap *)&imem_clk,
- [SDC1_CLK] = &sdc1_clk.clkr,
- [SDC3_CLK] = &sdc3_clk.clkr,
- [SDC2_CLK] = &sdc2_clk.clkr,
- [SDC4_CLK] = &sdc4_clk.clkr,
- [MDP_CLK] = &mdp_clk.clkr,
- [MDP_LCDC_PCLK_CLK] = &mdp_lcdc_pclk_clk.clkr,
- [MDP_LCDC_PAD_PCLK_CLK] = (struct clk_regmap *)&mdp_lcdc_pad_pclk_clk,
- [MDP_VSYNC_CLK] = &mdp_vsync_clk.clkr,
- [MI2S_CODEC_RX_M_CLK] = &mi2s_codec_rx_m_clk.clkr,
- [MI2S_CODEC_RX_S_CLK] = (struct clk_regmap *)&mi2s_codec_rx_s_clk,
- [MI2S_CODEC_TX_M_CLK] = &mi2s_codec_tx_m_clk.clkr,
- [MI2S_CODEC_TX_S_CLK] = (struct clk_regmap *)&mi2s_codec_tx_s_clk,
- [MI2S_M_CLK] = &mi2s_m_clk.clkr,
- [MI2S_S_CLK] = (struct clk_regmap *)&mi2s_s_clk,
- [SDAC_CLK] = &sdac_clk.clkr,
- [SDAC_M_CLK] = (struct clk_regmap *)&sdac_m_clk,
- [TV_CLK] = &tv_clk.clkr,
- [HDMI_CLK] = (struct clk_regmap *)&hdmi_clk,
- [TV_DAC_CLK] = (struct clk_regmap *)&tv_dac_clk,
- [TV_ENC_CLK] = (struct clk_regmap *)&tv_enc_clk,
- [TSIF_REF_CLK] = (struct clk_regmap *)&tsif_ref_clk,
- [USB_HS_SRC_CLK] = &usb_hs_src_clk.clkr,
- [USB_HS_CLK] = (struct clk_regmap *)&usb_hs_clk,
- [USB_HS_CORE_CLK] = (struct clk_regmap *)&usb_hs_core_clk,
- [USB_HS2_CLK] = (struct clk_regmap *)&usb_hs2_clk,
- [USB_HS2_CORE_CLK] = (struct clk_regmap *)&usb_hs2_core_clk,
- [USB_HS3_CLK] = (struct clk_regmap *)&usb_hs3_clk,
- [USB_HS3_CORE_CLK] = (struct clk_regmap *)&usb_hs3_core_clk,
- [JPEG_CLK] = &jpeg_clk.clkr,
- [VFE_CLK] = &vfe_clk.clkr,
- [VFE_MDC_CLK] = (struct clk_regmap *)&vfe_mdc_clk,
- [VFE_CAMIF_CLK] = (struct clk_regmap *)&vfe_camif_clk,
- [CSI0_VFE_CLK] = (struct clk_regmap *)&csi0_vfe_clk,
- [CAM_M_CLK] = &cam_m_clk.clkr,
- [VPE_CLK] = &vpe_clk.clkr,
- [MFC_CLK] = &mfc_clk.clkr,
- [MFC_DIV2_CLK] = (struct clk_regmap *)&mfc_div2_clk,
- [SPI_CLK] = &spi_clk.clkr,
- [LPA_CODEC_CLK] = &lpa_codec_clk.clkr,
- [MDC_CLK] = &mdc_clk.clkr,
- [LPA_CORE_CLK] = (struct clk_regmap *)&lpa_core_clk,
- [ACPU_CLK] = (struct clk_regmap *)&acpu_clk,
- };
- // time for the translation to CCF from acpuclock-msm7x30.c
- // NOTE: this is for cpu, gpu, whatever.
- #define PLL2_L_VAL_ADDR 0x033c
- #define PLL2_M_VAL_ADDR 0x0340
- #define PLL2_N_VAL_ADDR 0x0344
- #define PLL2_CONFIG_ADDR 0x034c
- static const struct freq_tbl ftbl_gcc_acpu_clk[] = {
- { 24576000, 0, 1, 0, 0 },
- { 61440000, 3, 23, 0, 0 },
- { 122880000, 3, 11, 0, 0 },
- { 184320000, 3, 9, 0, 0 },
- { 245760000, 3, 5, 0, 0 },
- { 368640000, 3, 3, 0, 0 },
- { 460800000, 1, 1, 0, 0 },
- { 768000000, 1, 1, 0, 0 },
- { 806400000, 2, 1, 0, 0 },
- { 902400000, 2, 1, 0, 0 },
- { 1017600000, 2, 1, 0, 0 },
- { 1113600000, 2, 1, 0, 0 },
- { 1209600000, 2, 1, 0, 0 },
- { 1305600000, 2, 1, 0, 0 },
- { 1401600000, 2, 1, 0, 0 },
- { }
- };
- static struct clk_regmap_mux acpu_clk = {
- .reg = 0x0004,
- .shift = 0,
- .width = 4,
- .clkr = {
- .hw.init = &(struct clk_init_data){
- .name = "acpu_clk",
- .parent_data = gcc_msm8255_parent_data,
- .num_parents = 4,
- .ops = &clk_regmap_mux_closest_ops,
- },
- },
- };
- static const struct of_device_id gcc_msm8255_match_table[] = {
- { .compatible = "qcom,gcc-msm8255" },
- { }
- };
- MODULE_DEVICE_TABLE(of, gcc_msm8255_match_table);
- static const struct regmap_config gcc_msm8255_regmap_config = {
- .reg_bits = 32,
- .reg_stride = 4,
- .val_bits = 32,
- .max_register = 0x05ff,
- .fast_io = true,
- };
- static const struct qcom_cc_desc gcc_msm8255_desc = {
- .config = &gcc_msm8255_regmap_config,
- .clks = gcc_msm8255_clocks,
- .num_clks = ARRAY_SIZE(gcc_msm8255_clocks),
- };
- static int gcc_msm8255_probe(struct platform_device *pdev)
- {
- struct device *dev = &pdev->dev;
- struct regmap *regmap;
- int ret;
- regmap = qcom_cc_map(pdev, &gcc_msm8255_desc);
- if (IS_ERR(regmap))
- return PTR_ERR(regmap);
- regmap_update_bits(regmap, 0x03c0, BIT(2), BIT(2));
- regmap_update_bits(regmap, 0x02c0, BIT(13) | BIT(9), 0);
- regmap_update_bits(regmap, 0x046c, BIT(9) | BIT(4), 0);
- regmap_update_bits(regmap, 0x0470, BIT(9) | BIT(4), 0);
- regmap_update_bits(regmap, 0x0050, GENMASK(18, 17), (0x3 << 17) & GENMASK(18, 17));
- regmap_update_bits(regmap, 0x008c, GENMASK(18, 17), (0x3 << 17) & GENMASK(18, 17));
- regmap_update_bits(regmap, 0x02bc, BIT(15), BIT(15));
- regmap_update_bits(regmap, 0x046c, BIT(6), BIT(6));
- regmap_update_bits(regmap, 0x0470, BIT(6), BIT(6));
- ret = qcom_cc_really_probe(dev, &gcc_msm8255_desc, regmap);
- if (ret)
- return ret;
- return 0;
- }
- static struct platform_driver gcc_msm8255_driver = {
- .probe = gcc_msm8255_probe,
- .driver = {
- .name = "gcc-msm8255",
- .of_match_table = gcc_msm8255_match_table,
- },
- };
- builtin_platform_driver(gcc_msm8255_driver);
- // do not say that anything here is deprecated,
- // my arm-none-eabi didnt error!
- //
- // =@@@
- // @
- // _/@
- // /@@@
- // |@ @
- // |@_@
- // @@@@
- // &||&
- // CHECKPATCHPL SPETZNAZ &&&&.
- // _ _ &||&&
- // \\ _________ // &&&&& $$$$$
- // \X X/ @@&&& $$$$$$$
- // / =\ /= \ @%%@@$$$$$$$$$
- // [ 0 0 ] @%%@@$$$$$$$
- // ------------- @%%@@$$$$
- // _____________ @@@@@@@
- // /=\ [ ] /=\@@@@@ @
- // [ ] [ gin ger ] [ ]@@@@@= @
- // [ ] [ bread ] [ ]@@@@@@&&&&&.
- // [ ] [ 2.3.4 ] [ ]@@@@@@P&&&&&&.
- // [ ] \___________/ [ ]@@@@@ &&&/
- // \=/ \=/ @@@/
- // /=\ /=\ |##|
- // [ ] [ ] |###|
- // [ ] [ ] |####|
- // [ ] [ ] |####|
- // === === |#####|
- //--------------------------------|#####|------
Advertisement
Add Comment
Please, Sign In to add comment