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