Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Clock definitions for u8500 platform. |
| 3 | * |
| 4 | * Copyright (C) 2012 ST-Ericsson SA |
| 5 | * Author: Ulf Hansson <ulf.hansson@linaro.org> |
| 6 | * |
| 7 | * License terms: GNU General Public License (GPL) version 2 |
| 8 | */ |
| 9 | |
Lee Jones | dec759d | 2013-09-17 10:26:24 +0100 | [diff] [blame] | 10 | #include <linux/of.h> |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 11 | #include <linux/clk.h> |
| 12 | #include <linux/clkdev.h> |
| 13 | #include <linux/clk-provider.h> |
| 14 | #include <linux/mfd/dbx500-prcmu.h> |
| 15 | #include <linux/platform_data/clk-ux500.h> |
| 16 | #include "clk.h" |
| 17 | |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 18 | #define PRCC_NUM_PERIPH_CLUSTERS 6 |
| 19 | #define PRCC_PERIPHS_PER_CLUSTER 32 |
| 20 | |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 21 | static struct clk *prcmu_clk[PRCMU_NUM_CLKS]; |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 22 | static struct clk *prcc_pclk[(PRCC_NUM_PERIPH_CLUSTERS + 1) * PRCC_PERIPHS_PER_CLUSTER]; |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 23 | static struct clk *prcc_kclk[(PRCC_NUM_PERIPH_CLUSTERS + 1) * PRCC_PERIPHS_PER_CLUSTER]; |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 24 | |
Lee Jones | b4bdc81 | 2013-07-22 13:13:01 +0100 | [diff] [blame] | 25 | #define PRCC_SHOW(clk, base, bit) \ |
| 26 | clk[(base * PRCC_PERIPHS_PER_CLUSTER) + bit] |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 27 | #define PRCC_PCLK_STORE(clk, base, bit) \ |
| 28 | prcc_pclk[(base * PRCC_PERIPHS_PER_CLUSTER) + bit] = clk |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 29 | #define PRCC_KCLK_STORE(clk, base, bit) \ |
| 30 | prcc_kclk[(base * PRCC_PERIPHS_PER_CLUSTER) + bit] = clk |
Lee Jones | b4bdc81 | 2013-07-22 13:13:01 +0100 | [diff] [blame] | 31 | |
Sachin Kamat | c112c1d | 2014-01-15 11:13:26 +0530 | [diff] [blame] | 32 | static struct clk *ux500_twocell_get(struct of_phandle_args *clkspec, |
| 33 | void *data) |
Lee Jones | b4bdc81 | 2013-07-22 13:13:01 +0100 | [diff] [blame] | 34 | { |
| 35 | struct clk **clk_data = data; |
| 36 | unsigned int base, bit; |
| 37 | |
| 38 | if (clkspec->args_count != 2) |
| 39 | return ERR_PTR(-EINVAL); |
| 40 | |
| 41 | base = clkspec->args[0]; |
| 42 | bit = clkspec->args[1]; |
| 43 | |
| 44 | if (base != 1 && base != 2 && base != 3 && base != 5 && base != 6) { |
| 45 | pr_err("%s: invalid PRCC base %d\n", __func__, base); |
| 46 | return ERR_PTR(-EINVAL); |
| 47 | } |
| 48 | |
| 49 | return PRCC_SHOW(clk_data, base, bit); |
| 50 | } |
| 51 | |
Lee Jones | dec759d | 2013-09-17 10:26:24 +0100 | [diff] [blame] | 52 | static const struct of_device_id u8500_clk_of_match[] = { |
| 53 | { .compatible = "stericsson,u8500-clks", }, |
| 54 | { }, |
| 55 | }; |
| 56 | |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 57 | void u8500_of_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base, |
| 58 | u32 clkrst5_base, u32 clkrst6_base) |
| 59 | { |
| 60 | struct prcmu_fw_version *fw_version; |
Lee Jones | dec759d | 2013-09-17 10:26:24 +0100 | [diff] [blame] | 61 | struct device_node *np = NULL; |
| 62 | struct device_node *child = NULL; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 63 | const char *sgaclk_parent = NULL; |
Lee Jones | 4e33466 | 2013-09-17 10:35:00 +0100 | [diff] [blame] | 64 | struct clk *clk, *rtc_clk, *twd_clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 65 | |
Lee Jones | dec759d | 2013-09-17 10:26:24 +0100 | [diff] [blame] | 66 | if (of_have_populated_dt()) |
| 67 | np = of_find_matching_node(NULL, u8500_clk_of_match); |
| 68 | if (!np) { |
| 69 | pr_err("Either DT or U8500 Clock node not found\n"); |
| 70 | return; |
| 71 | } |
| 72 | |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 73 | /* Clock sources */ |
| 74 | clk = clk_reg_prcmu_gate("soc0_pll", NULL, PRCMU_PLLSOC0, |
| 75 | CLK_IS_ROOT|CLK_IGNORE_UNUSED); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 76 | prcmu_clk[PRCMU_PLLSOC0] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 77 | |
| 78 | clk = clk_reg_prcmu_gate("soc1_pll", NULL, PRCMU_PLLSOC1, |
| 79 | CLK_IS_ROOT|CLK_IGNORE_UNUSED); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 80 | prcmu_clk[PRCMU_PLLSOC1] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 81 | |
| 82 | clk = clk_reg_prcmu_gate("ddr_pll", NULL, PRCMU_PLLDDR, |
| 83 | CLK_IS_ROOT|CLK_IGNORE_UNUSED); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 84 | prcmu_clk[PRCMU_PLLDDR] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 85 | |
| 86 | /* FIXME: Add sys, ulp and int clocks here. */ |
| 87 | |
Lee Jones | d625a73 | 2013-09-17 10:34:24 +0100 | [diff] [blame] | 88 | rtc_clk = clk_register_fixed_rate(NULL, "rtc32k", "NULL", |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 89 | CLK_IS_ROOT|CLK_IGNORE_UNUSED, |
| 90 | 32768); |
| 91 | |
| 92 | /* PRCMU clocks */ |
| 93 | fw_version = prcmu_get_fw_version(); |
| 94 | if (fw_version != NULL) { |
| 95 | switch (fw_version->project) { |
| 96 | case PRCMU_FW_PROJECT_U8500_C2: |
| 97 | case PRCMU_FW_PROJECT_U8520: |
| 98 | case PRCMU_FW_PROJECT_U8420: |
| 99 | sgaclk_parent = "soc0_pll"; |
| 100 | break; |
| 101 | default: |
| 102 | break; |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | if (sgaclk_parent) |
| 107 | clk = clk_reg_prcmu_gate("sgclk", sgaclk_parent, |
| 108 | PRCMU_SGACLK, 0); |
| 109 | else |
| 110 | clk = clk_reg_prcmu_gate("sgclk", NULL, |
| 111 | PRCMU_SGACLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 112 | prcmu_clk[PRCMU_SGACLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 113 | |
| 114 | clk = clk_reg_prcmu_gate("uartclk", NULL, PRCMU_UARTCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 115 | prcmu_clk[PRCMU_UARTCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 116 | |
| 117 | clk = clk_reg_prcmu_gate("msp02clk", NULL, PRCMU_MSP02CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 118 | prcmu_clk[PRCMU_MSP02CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 119 | |
| 120 | clk = clk_reg_prcmu_gate("msp1clk", NULL, PRCMU_MSP1CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 121 | prcmu_clk[PRCMU_MSP1CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 122 | |
| 123 | clk = clk_reg_prcmu_gate("i2cclk", NULL, PRCMU_I2CCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 124 | prcmu_clk[PRCMU_I2CCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 125 | |
| 126 | clk = clk_reg_prcmu_gate("slimclk", NULL, PRCMU_SLIMCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 127 | prcmu_clk[PRCMU_SLIMCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 128 | |
| 129 | clk = clk_reg_prcmu_gate("per1clk", NULL, PRCMU_PER1CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 130 | prcmu_clk[PRCMU_PER1CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 131 | |
| 132 | clk = clk_reg_prcmu_gate("per2clk", NULL, PRCMU_PER2CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 133 | prcmu_clk[PRCMU_PER2CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 134 | |
| 135 | clk = clk_reg_prcmu_gate("per3clk", NULL, PRCMU_PER3CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 136 | prcmu_clk[PRCMU_PER3CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 137 | |
| 138 | clk = clk_reg_prcmu_gate("per5clk", NULL, PRCMU_PER5CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 139 | prcmu_clk[PRCMU_PER5CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 140 | |
| 141 | clk = clk_reg_prcmu_gate("per6clk", NULL, PRCMU_PER6CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 142 | prcmu_clk[PRCMU_PER6CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 143 | |
| 144 | clk = clk_reg_prcmu_gate("per7clk", NULL, PRCMU_PER7CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 145 | prcmu_clk[PRCMU_PER7CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 146 | |
| 147 | clk = clk_reg_prcmu_scalable("lcdclk", NULL, PRCMU_LCDCLK, 0, |
| 148 | CLK_IS_ROOT|CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 149 | prcmu_clk[PRCMU_LCDCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 150 | |
| 151 | clk = clk_reg_prcmu_opp_gate("bmlclk", NULL, PRCMU_BMLCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 152 | prcmu_clk[PRCMU_BMLCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 153 | |
| 154 | clk = clk_reg_prcmu_scalable("hsitxclk", NULL, PRCMU_HSITXCLK, 0, |
| 155 | CLK_IS_ROOT|CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 156 | prcmu_clk[PRCMU_HSITXCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 157 | |
| 158 | clk = clk_reg_prcmu_scalable("hsirxclk", NULL, PRCMU_HSIRXCLK, 0, |
| 159 | CLK_IS_ROOT|CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 160 | prcmu_clk[PRCMU_HSIRXCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 161 | |
| 162 | clk = clk_reg_prcmu_scalable("hdmiclk", NULL, PRCMU_HDMICLK, 0, |
| 163 | CLK_IS_ROOT|CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 164 | prcmu_clk[PRCMU_HDMICLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 165 | |
| 166 | clk = clk_reg_prcmu_gate("apeatclk", NULL, PRCMU_APEATCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 167 | prcmu_clk[PRCMU_APEATCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 168 | |
| 169 | clk = clk_reg_prcmu_gate("apetraceclk", NULL, PRCMU_APETRACECLK, |
| 170 | CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 171 | prcmu_clk[PRCMU_APETRACECLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 172 | |
| 173 | clk = clk_reg_prcmu_gate("mcdeclk", NULL, PRCMU_MCDECLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 174 | prcmu_clk[PRCMU_MCDECLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 175 | |
| 176 | clk = clk_reg_prcmu_opp_gate("ipi2cclk", NULL, PRCMU_IPI2CCLK, |
| 177 | CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 178 | prcmu_clk[PRCMU_IPI2CCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 179 | |
| 180 | clk = clk_reg_prcmu_gate("dsialtclk", NULL, PRCMU_DSIALTCLK, |
| 181 | CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 182 | prcmu_clk[PRCMU_DSIALTCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 183 | |
| 184 | clk = clk_reg_prcmu_gate("dmaclk", NULL, PRCMU_DMACLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 185 | prcmu_clk[PRCMU_DMACLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 186 | |
| 187 | clk = clk_reg_prcmu_gate("b2r2clk", NULL, PRCMU_B2R2CLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 188 | prcmu_clk[PRCMU_B2R2CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 189 | |
| 190 | clk = clk_reg_prcmu_scalable("tvclk", NULL, PRCMU_TVCLK, 0, |
| 191 | CLK_IS_ROOT|CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 192 | prcmu_clk[PRCMU_TVCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 193 | |
| 194 | clk = clk_reg_prcmu_gate("sspclk", NULL, PRCMU_SSPCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 195 | prcmu_clk[PRCMU_SSPCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 196 | |
| 197 | clk = clk_reg_prcmu_gate("rngclk", NULL, PRCMU_RNGCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 198 | prcmu_clk[PRCMU_RNGCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 199 | |
| 200 | clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 201 | prcmu_clk[PRCMU_UICCCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 202 | |
| 203 | clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 204 | prcmu_clk[PRCMU_TIMCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 205 | |
| 206 | clk = clk_reg_prcmu_opp_volt_scalable("sdmmcclk", NULL, PRCMU_SDMMCCLK, |
| 207 | 100000000, |
| 208 | CLK_IS_ROOT|CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 209 | prcmu_clk[PRCMU_SDMMCCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 210 | |
| 211 | clk = clk_reg_prcmu_scalable("dsi_pll", "hdmiclk", |
| 212 | PRCMU_PLLDSI, 0, CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 213 | prcmu_clk[PRCMU_PLLDSI] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 214 | |
| 215 | clk = clk_reg_prcmu_scalable("dsi0clk", "dsi_pll", |
| 216 | PRCMU_DSI0CLK, 0, CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 217 | prcmu_clk[PRCMU_DSI0CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 218 | |
| 219 | clk = clk_reg_prcmu_scalable("dsi1clk", "dsi_pll", |
| 220 | PRCMU_DSI1CLK, 0, CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 221 | prcmu_clk[PRCMU_DSI1CLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 222 | |
| 223 | clk = clk_reg_prcmu_scalable("dsi0escclk", "tvclk", |
| 224 | PRCMU_DSI0ESCCLK, 0, CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 225 | prcmu_clk[PRCMU_DSI0ESCCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 226 | |
| 227 | clk = clk_reg_prcmu_scalable("dsi1escclk", "tvclk", |
| 228 | PRCMU_DSI1ESCCLK, 0, CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 229 | prcmu_clk[PRCMU_DSI1ESCCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 230 | |
| 231 | clk = clk_reg_prcmu_scalable("dsi2escclk", "tvclk", |
| 232 | PRCMU_DSI2ESCCLK, 0, CLK_SET_RATE_GATE); |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 233 | prcmu_clk[PRCMU_DSI2ESCCLK] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 234 | |
| 235 | clk = clk_reg_prcmu_scalable_rate("armss", NULL, |
| 236 | PRCMU_ARMSS, 0, CLK_IS_ROOT|CLK_IGNORE_UNUSED); |
Lee Jones | 257015a | 2013-09-18 16:09:38 +0100 | [diff] [blame] | 237 | prcmu_clk[PRCMU_ARMSS] = clk; |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 238 | |
Lee Jones | 4e33466 | 2013-09-17 10:35:00 +0100 | [diff] [blame] | 239 | twd_clk = clk_register_fixed_factor(NULL, "smp_twd", "armss", |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 240 | CLK_IGNORE_UNUSED, 1, 2); |
| 241 | |
| 242 | /* |
| 243 | * FIXME: Add special handled PRCMU clocks here: |
| 244 | * 1. clkout0yuv, use PRCMU as parent + need regulator + pinctrl. |
| 245 | * 2. ab9540_clkout1yuv, see clkout0yuv |
| 246 | */ |
| 247 | |
| 248 | /* PRCC P-clocks */ |
| 249 | clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", clkrst1_base, |
| 250 | BIT(0), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 251 | PRCC_PCLK_STORE(clk, 1, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 252 | |
| 253 | clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", clkrst1_base, |
| 254 | BIT(1), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 255 | PRCC_PCLK_STORE(clk, 1, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 256 | |
| 257 | clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", clkrst1_base, |
| 258 | BIT(2), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 259 | PRCC_PCLK_STORE(clk, 1, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 260 | |
| 261 | clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", clkrst1_base, |
| 262 | BIT(3), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 263 | PRCC_PCLK_STORE(clk, 1, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 264 | |
| 265 | clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", clkrst1_base, |
| 266 | BIT(4), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 267 | PRCC_PCLK_STORE(clk, 1, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 268 | |
| 269 | clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", clkrst1_base, |
| 270 | BIT(5), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 271 | PRCC_PCLK_STORE(clk, 1, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 272 | |
| 273 | clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", clkrst1_base, |
| 274 | BIT(6), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 275 | PRCC_PCLK_STORE(clk, 1, 6); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 276 | |
| 277 | clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", clkrst1_base, |
| 278 | BIT(7), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 279 | PRCC_PCLK_STORE(clk, 1, 7); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 280 | |
| 281 | clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", clkrst1_base, |
| 282 | BIT(8), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 283 | PRCC_PCLK_STORE(clk, 1, 8); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 284 | |
| 285 | clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", clkrst1_base, |
| 286 | BIT(9), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 287 | PRCC_PCLK_STORE(clk, 1, 9); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 288 | |
| 289 | clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", clkrst1_base, |
| 290 | BIT(10), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 291 | PRCC_PCLK_STORE(clk, 1, 10); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 292 | |
| 293 | clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", clkrst1_base, |
| 294 | BIT(11), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 295 | PRCC_PCLK_STORE(clk, 1, 11); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 296 | |
| 297 | clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", clkrst2_base, |
| 298 | BIT(0), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 299 | PRCC_PCLK_STORE(clk, 2, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 300 | |
| 301 | clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", clkrst2_base, |
| 302 | BIT(1), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 303 | PRCC_PCLK_STORE(clk, 2, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 304 | |
| 305 | clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", clkrst2_base, |
| 306 | BIT(2), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 307 | PRCC_PCLK_STORE(clk, 2, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 308 | |
| 309 | clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", clkrst2_base, |
| 310 | BIT(3), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 311 | PRCC_PCLK_STORE(clk, 2, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 312 | |
| 313 | clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", clkrst2_base, |
| 314 | BIT(4), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 315 | PRCC_PCLK_STORE(clk, 2, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 316 | |
| 317 | clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", clkrst2_base, |
| 318 | BIT(5), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 319 | PRCC_PCLK_STORE(clk, 2, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 320 | |
| 321 | clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", clkrst2_base, |
| 322 | BIT(6), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 323 | PRCC_PCLK_STORE(clk, 2, 6); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 324 | |
| 325 | clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", clkrst2_base, |
| 326 | BIT(7), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 327 | PRCC_PCLK_STORE(clk, 2, 7); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 328 | |
| 329 | clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", clkrst2_base, |
| 330 | BIT(8), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 331 | PRCC_PCLK_STORE(clk, 2, 8); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 332 | |
| 333 | clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", clkrst2_base, |
| 334 | BIT(9), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 335 | PRCC_PCLK_STORE(clk, 2, 9); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 336 | |
| 337 | clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", clkrst2_base, |
| 338 | BIT(10), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 339 | PRCC_PCLK_STORE(clk, 2, 10); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 340 | |
| 341 | clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", clkrst2_base, |
| 342 | BIT(11), 0); |
Linus Walleij | f5ff9a1 | 2013-10-18 10:56:14 +0200 | [diff] [blame] | 343 | PRCC_PCLK_STORE(clk, 2, 11); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 344 | |
| 345 | clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", clkrst2_base, |
| 346 | BIT(12), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 347 | PRCC_PCLK_STORE(clk, 2, 12); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 348 | |
| 349 | clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", clkrst3_base, |
| 350 | BIT(0), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 351 | PRCC_PCLK_STORE(clk, 3, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 352 | |
| 353 | clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", clkrst3_base, |
| 354 | BIT(1), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 355 | PRCC_PCLK_STORE(clk, 3, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 356 | |
| 357 | clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", clkrst3_base, |
| 358 | BIT(2), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 359 | PRCC_PCLK_STORE(clk, 3, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 360 | |
| 361 | clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", clkrst3_base, |
| 362 | BIT(3), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 363 | PRCC_PCLK_STORE(clk, 3, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 364 | |
| 365 | clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", clkrst3_base, |
| 366 | BIT(4), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 367 | PRCC_PCLK_STORE(clk, 3, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 368 | |
| 369 | clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", clkrst3_base, |
| 370 | BIT(5), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 371 | PRCC_PCLK_STORE(clk, 3, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 372 | |
| 373 | clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", clkrst3_base, |
| 374 | BIT(6), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 375 | PRCC_PCLK_STORE(clk, 3, 6); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 376 | |
| 377 | clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", clkrst3_base, |
| 378 | BIT(7), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 379 | PRCC_PCLK_STORE(clk, 3, 7); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 380 | |
| 381 | clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", clkrst3_base, |
| 382 | BIT(8), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 383 | PRCC_PCLK_STORE(clk, 3, 8); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 384 | |
| 385 | clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", clkrst5_base, |
| 386 | BIT(0), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 387 | PRCC_PCLK_STORE(clk, 5, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 388 | |
| 389 | clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", clkrst5_base, |
| 390 | BIT(1), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 391 | PRCC_PCLK_STORE(clk, 5, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 392 | |
| 393 | clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", clkrst6_base, |
| 394 | BIT(0), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 395 | PRCC_PCLK_STORE(clk, 6, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 396 | |
| 397 | clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", clkrst6_base, |
| 398 | BIT(1), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 399 | PRCC_PCLK_STORE(clk, 6, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 400 | |
| 401 | clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", clkrst6_base, |
| 402 | BIT(2), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 403 | PRCC_PCLK_STORE(clk, 6, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 404 | |
| 405 | clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", clkrst6_base, |
| 406 | BIT(3), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 407 | PRCC_PCLK_STORE(clk, 6, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 408 | |
| 409 | clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", clkrst6_base, |
| 410 | BIT(4), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 411 | PRCC_PCLK_STORE(clk, 6, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 412 | |
| 413 | clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", clkrst6_base, |
| 414 | BIT(5), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 415 | PRCC_PCLK_STORE(clk, 6, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 416 | |
| 417 | clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", clkrst6_base, |
| 418 | BIT(6), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 419 | PRCC_PCLK_STORE(clk, 6, 6); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 420 | |
| 421 | clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", clkrst6_base, |
| 422 | BIT(7), 0); |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 423 | PRCC_PCLK_STORE(clk, 6, 7); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 424 | |
| 425 | /* PRCC K-clocks |
| 426 | * |
| 427 | * FIXME: Some drivers requires PERPIH[n| to be automatically enabled |
| 428 | * by enabling just the K-clock, even if it is not a valid parent to |
| 429 | * the K-clock. Until drivers get fixed we might need some kind of |
| 430 | * "parent muxed join". |
| 431 | */ |
| 432 | |
| 433 | /* Periph1 */ |
| 434 | clk = clk_reg_prcc_kclk("p1_uart0_kclk", "uartclk", |
| 435 | clkrst1_base, BIT(0), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 436 | PRCC_KCLK_STORE(clk, 1, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 437 | |
| 438 | clk = clk_reg_prcc_kclk("p1_uart1_kclk", "uartclk", |
| 439 | clkrst1_base, BIT(1), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 440 | PRCC_KCLK_STORE(clk, 1, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 441 | |
| 442 | clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk", |
| 443 | clkrst1_base, BIT(2), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 444 | PRCC_KCLK_STORE(clk, 1, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 445 | |
| 446 | clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk", |
| 447 | clkrst1_base, BIT(3), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 448 | PRCC_KCLK_STORE(clk, 1, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 449 | |
| 450 | clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk", |
| 451 | clkrst1_base, BIT(4), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 452 | PRCC_KCLK_STORE(clk, 1, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 453 | |
| 454 | clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk", |
| 455 | clkrst1_base, BIT(5), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 456 | PRCC_KCLK_STORE(clk, 1, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 457 | |
| 458 | clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk", |
| 459 | clkrst1_base, BIT(6), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 460 | PRCC_KCLK_STORE(clk, 1, 6); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 461 | |
| 462 | clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk", |
| 463 | clkrst1_base, BIT(8), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 464 | PRCC_KCLK_STORE(clk, 1, 8); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 465 | |
| 466 | clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk", |
| 467 | clkrst1_base, BIT(9), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 468 | PRCC_KCLK_STORE(clk, 1, 9); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 469 | |
| 470 | clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk", |
| 471 | clkrst1_base, BIT(10), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 472 | PRCC_KCLK_STORE(clk, 1, 10); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 473 | |
| 474 | /* Periph2 */ |
| 475 | clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk", |
| 476 | clkrst2_base, BIT(0), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 477 | PRCC_KCLK_STORE(clk, 2, 0); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 478 | |
| 479 | clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk", |
| 480 | clkrst2_base, BIT(2), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 481 | PRCC_KCLK_STORE(clk, 2, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 482 | |
| 483 | clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk", |
| 484 | clkrst2_base, BIT(3), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 485 | PRCC_KCLK_STORE(clk, 2, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 486 | |
| 487 | clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk", |
| 488 | clkrst2_base, BIT(4), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 489 | PRCC_KCLK_STORE(clk, 2, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 490 | |
| 491 | clk = clk_reg_prcc_kclk("p2_sdi3_kclk", "sdmmcclk", |
| 492 | clkrst2_base, BIT(5), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 493 | PRCC_KCLK_STORE(clk, 2, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 494 | |
| 495 | /* Note that rate is received from parent. */ |
| 496 | clk = clk_reg_prcc_kclk("p2_ssirx_kclk", "hsirxclk", |
| 497 | clkrst2_base, BIT(6), |
| 498 | CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 499 | PRCC_KCLK_STORE(clk, 2, 6); |
| 500 | |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 501 | clk = clk_reg_prcc_kclk("p2_ssitx_kclk", "hsitxclk", |
| 502 | clkrst2_base, BIT(7), |
| 503 | CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 504 | PRCC_KCLK_STORE(clk, 2, 7); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 505 | |
| 506 | /* Periph3 */ |
| 507 | clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk", |
| 508 | clkrst3_base, BIT(1), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 509 | PRCC_KCLK_STORE(clk, 3, 1); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 510 | |
| 511 | clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk", |
| 512 | clkrst3_base, BIT(2), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 513 | PRCC_KCLK_STORE(clk, 3, 2); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 514 | |
| 515 | clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk", |
| 516 | clkrst3_base, BIT(3), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 517 | PRCC_KCLK_STORE(clk, 3, 3); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 518 | |
| 519 | clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk", |
| 520 | clkrst3_base, BIT(4), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 521 | PRCC_KCLK_STORE(clk, 3, 4); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 522 | |
| 523 | clk = clk_reg_prcc_kclk("p3_ske_kclk", "rtc32k", |
| 524 | clkrst3_base, BIT(5), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 525 | PRCC_KCLK_STORE(clk, 3, 5); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 526 | |
| 527 | clk = clk_reg_prcc_kclk("p3_uart2_kclk", "uartclk", |
| 528 | clkrst3_base, BIT(6), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 529 | PRCC_KCLK_STORE(clk, 3, 6); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 530 | |
| 531 | clk = clk_reg_prcc_kclk("p3_sdi5_kclk", "sdmmcclk", |
| 532 | clkrst3_base, BIT(7), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 533 | PRCC_KCLK_STORE(clk, 3, 7); |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 534 | |
| 535 | /* Periph6 */ |
| 536 | clk = clk_reg_prcc_kclk("p3_rng_kclk", "rngclk", |
| 537 | clkrst6_base, BIT(0), CLK_SET_RATE_GATE); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 538 | PRCC_KCLK_STORE(clk, 6, 0); |
Lee Jones | dec759d | 2013-09-17 10:26:24 +0100 | [diff] [blame] | 539 | |
| 540 | for_each_child_of_node(np, child) { |
Lee Jones | f9fcb8e | 2013-09-17 10:30:19 +0100 | [diff] [blame] | 541 | static struct clk_onecell_data clk_data; |
| 542 | |
| 543 | if (!of_node_cmp(child->name, "prcmu-clock")) { |
| 544 | clk_data.clks = prcmu_clk; |
| 545 | clk_data.clk_num = ARRAY_SIZE(prcmu_clk); |
| 546 | of_clk_add_provider(child, of_clk_src_onecell_get, &clk_data); |
| 547 | } |
Lee Jones | 2d08030 | 2013-09-17 10:31:39 +0100 | [diff] [blame] | 548 | if (!of_node_cmp(child->name, "prcc-periph-clock")) |
| 549 | of_clk_add_provider(child, ux500_twocell_get, prcc_pclk); |
Lee Jones | 89da2df | 2013-09-17 10:33:05 +0100 | [diff] [blame] | 550 | |
| 551 | if (!of_node_cmp(child->name, "prcc-kernel-clock")) |
| 552 | of_clk_add_provider(child, ux500_twocell_get, prcc_kclk); |
Lee Jones | d625a73 | 2013-09-17 10:34:24 +0100 | [diff] [blame] | 553 | |
| 554 | if (!of_node_cmp(child->name, "rtc32k-clock")) |
| 555 | of_clk_add_provider(child, of_clk_src_simple_get, rtc_clk); |
Lee Jones | 4e33466 | 2013-09-17 10:35:00 +0100 | [diff] [blame] | 556 | |
| 557 | if (!of_node_cmp(child->name, "smp-twd-clock")) |
| 558 | of_clk_add_provider(child, of_clk_src_simple_get, twd_clk); |
Lee Jones | dec759d | 2013-09-17 10:26:24 +0100 | [diff] [blame] | 559 | } |
Lee Jones | 82b0f4b | 2013-09-17 10:11:53 +0100 | [diff] [blame] | 560 | } |