u8500_clk.c 17.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * Clock definitions for u8500 platform.
 *
 * Copyright (C) 2012 ST-Ericsson SA
 * Author: Ulf Hansson <ulf.hansson@linaro.org>
 *
 * License terms: GNU General Public License (GPL) version 2
 */

#include <linux/clk.h>
#include <linux/clkdev.h>
#include <linux/clk-provider.h>
#include <linux/mfd/dbx500-prcmu.h>
#include <linux/platform_data/clk-ux500.h>
#include "clk.h"

17 18
void u8500_clk_init(u32 clkrst1_base, u32 clkrst2_base, u32 clkrst3_base,
		    u32 clkrst5_base, u32 clkrst6_base)
19
{
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
	struct prcmu_fw_version *fw_version;
	const char *sgaclk_parent = NULL;
	struct clk *clk;

	/* Clock sources */
	clk = clk_reg_prcmu_gate("soc0_pll", NULL, PRCMU_PLLSOC0,
				CLK_IS_ROOT|CLK_IGNORE_UNUSED);
	clk_register_clkdev(clk, "soc0_pll", NULL);

	clk = clk_reg_prcmu_gate("soc1_pll", NULL, PRCMU_PLLSOC1,
				CLK_IS_ROOT|CLK_IGNORE_UNUSED);
	clk_register_clkdev(clk, "soc1_pll", NULL);

	clk = clk_reg_prcmu_gate("ddr_pll", NULL, PRCMU_PLLDDR,
				CLK_IS_ROOT|CLK_IGNORE_UNUSED);
	clk_register_clkdev(clk, "ddr_pll", NULL);

	/* FIXME: Add sys, ulp and int clocks here. */

	clk = clk_register_fixed_rate(NULL, "rtc32k", "NULL",
				CLK_IS_ROOT|CLK_IGNORE_UNUSED,
				32768);
	clk_register_clkdev(clk, "clk32k", NULL);
43
	clk_register_clkdev(clk, "apb_pclk", "rtc-pl031");
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166

	/* PRCMU clocks */
	fw_version = prcmu_get_fw_version();
	if (fw_version != NULL) {
		switch (fw_version->project) {
		case PRCMU_FW_PROJECT_U8500_C2:
		case PRCMU_FW_PROJECT_U8520:
		case PRCMU_FW_PROJECT_U8420:
			sgaclk_parent = "soc0_pll";
			break;
		default:
			break;
		}
	}

	if (sgaclk_parent)
		clk = clk_reg_prcmu_gate("sgclk", sgaclk_parent,
					PRCMU_SGACLK, 0);
	else
		clk = clk_reg_prcmu_gate("sgclk", NULL,
					PRCMU_SGACLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "mali");

	clk = clk_reg_prcmu_gate("uartclk", NULL, PRCMU_UARTCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "UART");

	clk = clk_reg_prcmu_gate("msp02clk", NULL, PRCMU_MSP02CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "MSP02");

	clk = clk_reg_prcmu_gate("msp1clk", NULL, PRCMU_MSP1CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "MSP1");

	clk = clk_reg_prcmu_gate("i2cclk", NULL, PRCMU_I2CCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "I2C");

	clk = clk_reg_prcmu_gate("slimclk", NULL, PRCMU_SLIMCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "slim");

	clk = clk_reg_prcmu_gate("per1clk", NULL, PRCMU_PER1CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "PERIPH1");

	clk = clk_reg_prcmu_gate("per2clk", NULL, PRCMU_PER2CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "PERIPH2");

	clk = clk_reg_prcmu_gate("per3clk", NULL, PRCMU_PER3CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "PERIPH3");

	clk = clk_reg_prcmu_gate("per5clk", NULL, PRCMU_PER5CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "PERIPH5");

	clk = clk_reg_prcmu_gate("per6clk", NULL, PRCMU_PER6CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "PERIPH6");

	clk = clk_reg_prcmu_gate("per7clk", NULL, PRCMU_PER7CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "PERIPH7");

	clk = clk_reg_prcmu_scalable("lcdclk", NULL, PRCMU_LCDCLK, 0,
				CLK_IS_ROOT|CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, NULL, "lcd");
	clk_register_clkdev(clk, "lcd", "mcde");

	clk = clk_reg_prcmu_opp_gate("bmlclk", NULL, PRCMU_BMLCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "bml");

	clk = clk_reg_prcmu_scalable("hsitxclk", NULL, PRCMU_HSITXCLK, 0,
				CLK_IS_ROOT|CLK_SET_RATE_GATE);

	clk = clk_reg_prcmu_scalable("hsirxclk", NULL, PRCMU_HSIRXCLK, 0,
				CLK_IS_ROOT|CLK_SET_RATE_GATE);

	clk = clk_reg_prcmu_scalable("hdmiclk", NULL, PRCMU_HDMICLK, 0,
				CLK_IS_ROOT|CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, NULL, "hdmi");
	clk_register_clkdev(clk, "hdmi", "mcde");

	clk = clk_reg_prcmu_gate("apeatclk", NULL, PRCMU_APEATCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "apeat");

	clk = clk_reg_prcmu_gate("apetraceclk", NULL, PRCMU_APETRACECLK,
				CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "apetrace");

	clk = clk_reg_prcmu_gate("mcdeclk", NULL, PRCMU_MCDECLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "mcde");
	clk_register_clkdev(clk, "mcde", "mcde");
	clk_register_clkdev(clk, "dsisys", "dsilink.0");
	clk_register_clkdev(clk, "dsisys", "dsilink.1");
	clk_register_clkdev(clk, "dsisys", "dsilink.2");

	clk = clk_reg_prcmu_opp_gate("ipi2cclk", NULL, PRCMU_IPI2CCLK,
				CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "ipi2");

	clk = clk_reg_prcmu_gate("dsialtclk", NULL, PRCMU_DSIALTCLK,
				CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "dsialt");

	clk = clk_reg_prcmu_gate("dmaclk", NULL, PRCMU_DMACLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "dma40.0");

	clk = clk_reg_prcmu_gate("b2r2clk", NULL, PRCMU_B2R2CLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "b2r2");
	clk_register_clkdev(clk, NULL, "b2r2_core");
	clk_register_clkdev(clk, NULL, "U8500-B2R2.0");

	clk = clk_reg_prcmu_scalable("tvclk", NULL, PRCMU_TVCLK, 0,
				CLK_IS_ROOT|CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, NULL, "tv");
	clk_register_clkdev(clk, "tv", "mcde");

	clk = clk_reg_prcmu_gate("sspclk", NULL, PRCMU_SSPCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "SSP");

	clk = clk_reg_prcmu_gate("rngclk", NULL, PRCMU_RNGCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "rngclk");

	clk = clk_reg_prcmu_gate("uiccclk", NULL, PRCMU_UICCCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "uicc");

	clk = clk_reg_prcmu_gate("timclk", NULL, PRCMU_TIMCLK, CLK_IS_ROOT);
	clk_register_clkdev(clk, NULL, "mtu0");
	clk_register_clkdev(clk, NULL, "mtu1");

167 168 169
	clk = clk_reg_prcmu_opp_volt_scalable("sdmmcclk", NULL, PRCMU_SDMMCCLK,
					100000000,
					CLK_IS_ROOT|CLK_SET_RATE_GATE);
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
	clk_register_clkdev(clk, NULL, "sdmmc");

	clk = clk_reg_prcmu_scalable("dsi_pll", "hdmiclk",
				PRCMU_PLLDSI, 0, CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, "dsihs2", "mcde");
	clk_register_clkdev(clk, "dsihs2", "dsilink.2");


	clk = clk_reg_prcmu_scalable("dsi0clk", "dsi_pll",
				PRCMU_DSI0CLK, 0, CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, "dsihs0", "mcde");
	clk_register_clkdev(clk, "dsihs0", "dsilink.0");

	clk = clk_reg_prcmu_scalable("dsi1clk", "dsi_pll",
				PRCMU_DSI1CLK, 0, CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, "dsihs1", "mcde");
	clk_register_clkdev(clk, "dsihs1", "dsilink.1");

	clk = clk_reg_prcmu_scalable("dsi0escclk", "tvclk",
				PRCMU_DSI0ESCCLK, 0, CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, "dsilp0", "dsilink.0");
	clk_register_clkdev(clk, "dsilp0", "mcde");

	clk = clk_reg_prcmu_scalable("dsi1escclk", "tvclk",
				PRCMU_DSI1ESCCLK, 0, CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, "dsilp1", "dsilink.1");
	clk_register_clkdev(clk, "dsilp1", "mcde");

	clk = clk_reg_prcmu_scalable("dsi2escclk", "tvclk",
				PRCMU_DSI2ESCCLK, 0, CLK_SET_RATE_GATE);
	clk_register_clkdev(clk, "dsilp2", "dsilink.2");
	clk_register_clkdev(clk, "dsilp2", "mcde");

203 204 205 206 207 208
	clk = clk_reg_prcmu_scalable_rate("armss", NULL,
				PRCMU_ARMSS, 0, CLK_IS_ROOT|CLK_IGNORE_UNUSED);
	clk_register_clkdev(clk, "armss", NULL);

	clk = clk_register_fixed_factor(NULL, "smp_twd", "armss",
				CLK_IGNORE_UNUSED, 1, 2);
209 210
	clk_register_clkdev(clk, NULL, "smp_twd");

211 212
	/*
	 * FIXME: Add special handled PRCMU clocks here:
213 214
	 * 1. clkout0yuv, use PRCMU as parent + need regulator + pinctrl.
	 * 2. ab9540_clkout1yuv, see clkout0yuv
215 216 217
	 */

	/* PRCC P-clocks */
218
	clk = clk_reg_prcc_pclk("p1_pclk0", "per1clk", clkrst1_base,
219 220 221
				BIT(0), 0);
	clk_register_clkdev(clk, "apb_pclk", "uart0");

222
	clk = clk_reg_prcc_pclk("p1_pclk1", "per1clk", clkrst1_base,
223 224 225
				BIT(1), 0);
	clk_register_clkdev(clk, "apb_pclk", "uart1");

226
	clk = clk_reg_prcc_pclk("p1_pclk2", "per1clk", clkrst1_base,
227
				BIT(2), 0);
228 229
	clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.1");

230
	clk = clk_reg_prcc_pclk("p1_pclk3", "per1clk", clkrst1_base,
231
				BIT(3), 0);
232 233 234
	clk_register_clkdev(clk, "apb_pclk", "msp0");
	clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.0");

235
	clk = clk_reg_prcc_pclk("p1_pclk4", "per1clk", clkrst1_base,
236
				BIT(4), 0);
237 238
	clk_register_clkdev(clk, "apb_pclk", "msp1");
	clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.1");
239

240
	clk = clk_reg_prcc_pclk("p1_pclk5", "per1clk", clkrst1_base,
241 242 243
				BIT(5), 0);
	clk_register_clkdev(clk, "apb_pclk", "sdi0");

244
	clk = clk_reg_prcc_pclk("p1_pclk6", "per1clk", clkrst1_base,
245
				BIT(6), 0);
246
	clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.2");
247

248
	clk = clk_reg_prcc_pclk("p1_pclk7", "per1clk", clkrst1_base,
249 250 251
				BIT(7), 0);
	clk_register_clkdev(clk, NULL, "spi3");

252
	clk = clk_reg_prcc_pclk("p1_pclk8", "per1clk", clkrst1_base,
253
				BIT(8), 0);
254
	clk_register_clkdev(clk, "apb_pclk", "slimbus0");
255

256
	clk = clk_reg_prcc_pclk("p1_pclk9", "per1clk", clkrst1_base,
257 258 259 260 261
				BIT(9), 0);
	clk_register_clkdev(clk, NULL, "gpio.0");
	clk_register_clkdev(clk, NULL, "gpio.1");
	clk_register_clkdev(clk, NULL, "gpioblock0");

262
	clk = clk_reg_prcc_pclk("p1_pclk10", "per1clk", clkrst1_base,
263
				BIT(10), 0);
264 265
	clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.4");

266
	clk = clk_reg_prcc_pclk("p1_pclk11", "per1clk", clkrst1_base,
267
				BIT(11), 0);
268 269
	clk_register_clkdev(clk, "apb_pclk", "msp3");
	clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.3");
270

271
	clk = clk_reg_prcc_pclk("p2_pclk0", "per2clk", clkrst2_base,
272
				BIT(0), 0);
273
	clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.3");
274

275
	clk = clk_reg_prcc_pclk("p2_pclk1", "per2clk", clkrst2_base,
276 277 278
				BIT(1), 0);
	clk_register_clkdev(clk, NULL, "spi2");

279
	clk = clk_reg_prcc_pclk("p2_pclk2", "per2clk", clkrst2_base,
280 281 282
				BIT(2), 0);
	clk_register_clkdev(clk, NULL, "spi1");

283
	clk = clk_reg_prcc_pclk("p2_pclk3", "per2clk", clkrst2_base,
284 285 286
				BIT(3), 0);
	clk_register_clkdev(clk, NULL, "pwl");

287
	clk = clk_reg_prcc_pclk("p2_pclk4", "per2clk", clkrst2_base,
288 289 290
				BIT(4), 0);
	clk_register_clkdev(clk, "apb_pclk", "sdi4");

291
	clk = clk_reg_prcc_pclk("p2_pclk5", "per2clk", clkrst2_base,
292
				BIT(5), 0);
293 294
	clk_register_clkdev(clk, "apb_pclk", "msp2");
	clk_register_clkdev(clk, "apb_pclk", "ux500-msp-i2s.2");
295

296
	clk = clk_reg_prcc_pclk("p2_pclk6", "per2clk", clkrst2_base,
297 298 299
				BIT(6), 0);
	clk_register_clkdev(clk, "apb_pclk", "sdi1");

300
	clk = clk_reg_prcc_pclk("p2_pclk7", "per2clk", clkrst2_base,
301 302 303
				BIT(7), 0);
	clk_register_clkdev(clk, "apb_pclk", "sdi3");

304
	clk = clk_reg_prcc_pclk("p2_pclk8", "per2clk", clkrst2_base,
305 306 307
				BIT(8), 0);
	clk_register_clkdev(clk, NULL, "spi0");

308
	clk = clk_reg_prcc_pclk("p2_pclk9", "per2clk", clkrst2_base,
309 310 311
				BIT(9), 0);
	clk_register_clkdev(clk, "hsir_hclk", "ste_hsi.0");

312
	clk = clk_reg_prcc_pclk("p2_pclk10", "per2clk", clkrst2_base,
313 314 315
				BIT(10), 0);
	clk_register_clkdev(clk, "hsit_hclk", "ste_hsi.0");

316
	clk = clk_reg_prcc_pclk("p2_pclk11", "per2clk", clkrst2_base,
317 318 319 320 321
				BIT(11), 0);
	clk_register_clkdev(clk, NULL, "gpio.6");
	clk_register_clkdev(clk, NULL, "gpio.7");
	clk_register_clkdev(clk, NULL, "gpioblock1");

322
	clk = clk_reg_prcc_pclk("p2_pclk12", "per2clk", clkrst2_base,
L
Linus Walleij 已提交
323
				BIT(12), 0);
324

325
	clk = clk_reg_prcc_pclk("p3_pclk0", "per3clk", clkrst3_base,
326 327 328
				BIT(0), 0);
	clk_register_clkdev(clk, NULL, "fsmc");

329
	clk = clk_reg_prcc_pclk("p3_pclk1", "per3clk", clkrst3_base,
330
				BIT(1), 0);
331 332
	clk_register_clkdev(clk, "apb_pclk", "ssp0");

333
	clk = clk_reg_prcc_pclk("p3_pclk2", "per3clk", clkrst3_base,
334
				BIT(2), 0);
335
	clk_register_clkdev(clk, "apb_pclk", "ssp1");
336

337
	clk = clk_reg_prcc_pclk("p3_pclk3", "per3clk", clkrst3_base,
338
				BIT(3), 0);
339
	clk_register_clkdev(clk, "apb_pclk", "nmk-i2c.0");
340

341
	clk = clk_reg_prcc_pclk("p3_pclk4", "per3clk", clkrst3_base,
342 343 344
				BIT(4), 0);
	clk_register_clkdev(clk, "apb_pclk", "sdi2");

345
	clk = clk_reg_prcc_pclk("p3_pclk5", "per3clk", clkrst3_base,
346
				BIT(5), 0);
347 348
	clk_register_clkdev(clk, "apb_pclk", "ske");
	clk_register_clkdev(clk, "apb_pclk", "nmk-ske-keypad");
349

350
	clk = clk_reg_prcc_pclk("p3_pclk6", "per3clk", clkrst3_base,
351 352 353
				BIT(6), 0);
	clk_register_clkdev(clk, "apb_pclk", "uart2");

354
	clk = clk_reg_prcc_pclk("p3_pclk7", "per3clk", clkrst3_base,
355 356 357
				BIT(7), 0);
	clk_register_clkdev(clk, "apb_pclk", "sdi5");

358
	clk = clk_reg_prcc_pclk("p3_pclk8", "per3clk", clkrst3_base,
359 360 361 362 363 364 365
				BIT(8), 0);
	clk_register_clkdev(clk, NULL, "gpio.2");
	clk_register_clkdev(clk, NULL, "gpio.3");
	clk_register_clkdev(clk, NULL, "gpio.4");
	clk_register_clkdev(clk, NULL, "gpio.5");
	clk_register_clkdev(clk, NULL, "gpioblock2");

366
	clk = clk_reg_prcc_pclk("p5_pclk0", "per5clk", clkrst5_base,
367 368 369
				BIT(0), 0);
	clk_register_clkdev(clk, "usb", "musb-ux500.0");

370
	clk = clk_reg_prcc_pclk("p5_pclk1", "per5clk", clkrst5_base,
371 372 373 374
				BIT(1), 0);
	clk_register_clkdev(clk, NULL, "gpio.8");
	clk_register_clkdev(clk, NULL, "gpioblock3");

375
	clk = clk_reg_prcc_pclk("p6_pclk0", "per6clk", clkrst6_base,
376
				BIT(0), 0);
377
	clk_register_clkdev(clk, "apb_pclk", "rng");
378

379
	clk = clk_reg_prcc_pclk("p6_pclk1", "per6clk", clkrst6_base,
380 381 382 383
				BIT(1), 0);
	clk_register_clkdev(clk, NULL, "cryp0");
	clk_register_clkdev(clk, NULL, "cryp1");

384
	clk = clk_reg_prcc_pclk("p6_pclk2", "per6clk", clkrst6_base,
385 386 387
				BIT(2), 0);
	clk_register_clkdev(clk, NULL, "hash0");

388
	clk = clk_reg_prcc_pclk("p6_pclk3", "per6clk", clkrst6_base,
389 390 391
				BIT(3), 0);
	clk_register_clkdev(clk, NULL, "pka");

392
	clk = clk_reg_prcc_pclk("p6_pclk4", "per6clk", clkrst6_base,
393 394 395
				BIT(4), 0);
	clk_register_clkdev(clk, NULL, "hash1");

396
	clk = clk_reg_prcc_pclk("p6_pclk5", "per6clk", clkrst6_base,
397 398 399
				BIT(5), 0);
	clk_register_clkdev(clk, NULL, "cfgreg");

400
	clk = clk_reg_prcc_pclk("p6_pclk6", "per6clk", clkrst6_base,
401
				BIT(6), 0);
U
Ulf Hansson 已提交
402 403
	clk_register_clkdev(clk, "apb_pclk", "mtu0");

404
	clk = clk_reg_prcc_pclk("p6_pclk7", "per6clk", clkrst6_base,
405
				BIT(7), 0);
U
Ulf Hansson 已提交
406
	clk_register_clkdev(clk, "apb_pclk", "mtu1");
407 408 409 410 411 412 413 414 415 416 417

	/* PRCC K-clocks
	 *
	 * FIXME: Some drivers requires PERPIH[n| to be automatically enabled
	 * by enabling just the K-clock, even if it is not a valid parent to
	 * the K-clock. Until drivers get fixed we might need some kind of
	 * "parent muxed join".
	 */

	/* Periph1 */
	clk = clk_reg_prcc_kclk("p1_uart0_kclk", "uartclk",
418
			clkrst1_base, BIT(0), CLK_SET_RATE_GATE);
419 420 421
	clk_register_clkdev(clk, NULL, "uart0");

	clk = clk_reg_prcc_kclk("p1_uart1_kclk", "uartclk",
422
			clkrst1_base, BIT(1), CLK_SET_RATE_GATE);
423 424 425
	clk_register_clkdev(clk, NULL, "uart1");

	clk = clk_reg_prcc_kclk("p1_i2c1_kclk", "i2cclk",
426
			clkrst1_base, BIT(2), CLK_SET_RATE_GATE);
427 428
	clk_register_clkdev(clk, NULL, "nmk-i2c.1");

429
	clk = clk_reg_prcc_kclk("p1_msp0_kclk", "msp02clk",
430
			clkrst1_base, BIT(3), CLK_SET_RATE_GATE);
431 432 433
	clk_register_clkdev(clk, NULL, "msp0");
	clk_register_clkdev(clk, NULL, "ux500-msp-i2s.0");

434
	clk = clk_reg_prcc_kclk("p1_msp1_kclk", "msp1clk",
435
			clkrst1_base, BIT(4), CLK_SET_RATE_GATE);
436 437
	clk_register_clkdev(clk, NULL, "msp1");
	clk_register_clkdev(clk, NULL, "ux500-msp-i2s.1");
438 439

	clk = clk_reg_prcc_kclk("p1_sdi0_kclk", "sdmmcclk",
440
			clkrst1_base, BIT(5), CLK_SET_RATE_GATE);
441 442 443
	clk_register_clkdev(clk, NULL, "sdi0");

	clk = clk_reg_prcc_kclk("p1_i2c2_kclk", "i2cclk",
444
			clkrst1_base, BIT(6), CLK_SET_RATE_GATE);
445 446
	clk_register_clkdev(clk, NULL, "nmk-i2c.2");

447
	clk = clk_reg_prcc_kclk("p1_slimbus0_kclk", "slimclk",
448
			clkrst1_base, BIT(8), CLK_SET_RATE_GATE);
449
	clk_register_clkdev(clk, NULL, "slimbus0");
450

451
	clk = clk_reg_prcc_kclk("p1_i2c4_kclk", "i2cclk",
452
			clkrst1_base, BIT(9), CLK_SET_RATE_GATE);
453 454
	clk_register_clkdev(clk, NULL, "nmk-i2c.4");

455
	clk = clk_reg_prcc_kclk("p1_msp3_kclk", "msp1clk",
456
			clkrst1_base, BIT(10), CLK_SET_RATE_GATE);
457 458
	clk_register_clkdev(clk, NULL, "msp3");
	clk_register_clkdev(clk, NULL, "ux500-msp-i2s.3");
459 460 461

	/* Periph2 */
	clk = clk_reg_prcc_kclk("p2_i2c3_kclk", "i2cclk",
462
			clkrst2_base, BIT(0), CLK_SET_RATE_GATE);
463
	clk_register_clkdev(clk, NULL, "nmk-i2c.3");
464 465

	clk = clk_reg_prcc_kclk("p2_sdi4_kclk", "sdmmcclk",
466
			clkrst2_base, BIT(2), CLK_SET_RATE_GATE);
467 468 469
	clk_register_clkdev(clk, NULL, "sdi4");

	clk = clk_reg_prcc_kclk("p2_msp2_kclk", "msp02clk",
470
			clkrst2_base, BIT(3), CLK_SET_RATE_GATE);
471 472
	clk_register_clkdev(clk, NULL, "msp2");
	clk_register_clkdev(clk, NULL, "ux500-msp-i2s.2");
473 474

	clk = clk_reg_prcc_kclk("p2_sdi1_kclk", "sdmmcclk",
475
			clkrst2_base, BIT(4), CLK_SET_RATE_GATE);
476 477 478
	clk_register_clkdev(clk, NULL, "sdi1");

	clk = clk_reg_prcc_kclk("p2_sdi3_kclk", "sdmmcclk",
479
			clkrst2_base, BIT(5), CLK_SET_RATE_GATE);
480 481 482 483
	clk_register_clkdev(clk, NULL, "sdi3");

	/* Note that rate is received from parent. */
	clk = clk_reg_prcc_kclk("p2_ssirx_kclk", "hsirxclk",
484
			clkrst2_base, BIT(6),
485 486
			CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT);
	clk = clk_reg_prcc_kclk("p2_ssitx_kclk", "hsitxclk",
487
			clkrst2_base, BIT(7),
488 489 490 491
			CLK_SET_RATE_GATE|CLK_SET_RATE_PARENT);

	/* Periph3 */
	clk = clk_reg_prcc_kclk("p3_ssp0_kclk", "sspclk",
492
			clkrst3_base, BIT(1), CLK_SET_RATE_GATE);
493 494
	clk_register_clkdev(clk, NULL, "ssp0");

495
	clk = clk_reg_prcc_kclk("p3_ssp1_kclk", "sspclk",
496
			clkrst3_base, BIT(2), CLK_SET_RATE_GATE);
497
	clk_register_clkdev(clk, NULL, "ssp1");
498

499
	clk = clk_reg_prcc_kclk("p3_i2c0_kclk", "i2cclk",
500
			clkrst3_base, BIT(3), CLK_SET_RATE_GATE);
501
	clk_register_clkdev(clk, NULL, "nmk-i2c.0");
502 503

	clk = clk_reg_prcc_kclk("p3_sdi2_kclk", "sdmmcclk",
504
			clkrst3_base, BIT(4), CLK_SET_RATE_GATE);
505 506 507
	clk_register_clkdev(clk, NULL, "sdi2");

	clk = clk_reg_prcc_kclk("p3_ske_kclk", "rtc32k",
508
			clkrst3_base, BIT(5), CLK_SET_RATE_GATE);
509 510
	clk_register_clkdev(clk, NULL, "ske");
	clk_register_clkdev(clk, NULL, "nmk-ske-keypad");
511 512

	clk = clk_reg_prcc_kclk("p3_uart2_kclk", "uartclk",
513
			clkrst3_base, BIT(6), CLK_SET_RATE_GATE);
514 515 516
	clk_register_clkdev(clk, NULL, "uart2");

	clk = clk_reg_prcc_kclk("p3_sdi5_kclk", "sdmmcclk",
517
			clkrst3_base, BIT(7), CLK_SET_RATE_GATE);
518 519 520 521
	clk_register_clkdev(clk, NULL, "sdi5");

	/* Periph6 */
	clk = clk_reg_prcc_kclk("p3_rng_kclk", "rngclk",
522
			clkrst6_base, BIT(0), CLK_SET_RATE_GATE);
523
	clk_register_clkdev(clk, NULL, "rng");
524
}