blob: 5d085654aa336458f32808456b728fd571fea423 [file] [log] [blame]
John Crispin287e3f32012-04-17 15:53:19 +02001/*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU General Public License version 2 as published
4 * by the Free Software Foundation.
5 *
6 * Copyright (C) 2011-2012 John Crispin <blogic@openwrt.org>
Hauke Mehrtenscab7b832015-10-28 23:37:30 +01007 * Copyright (C) 2013-2015 Lantiq Beteiligungs-GmbH & Co.KG
John Crispin287e3f32012-04-17 15:53:19 +02008 */
9
10#include <linux/ioport.h>
11#include <linux/export.h>
12#include <linux/clkdev.h>
Hauke Mehrtens758d2442015-10-28 23:37:31 +010013#include <linux/spinlock.h>
John Crispin287e3f32012-04-17 15:53:19 +020014#include <linux/of.h>
15#include <linux/of_platform.h>
16#include <linux/of_address.h>
17
18#include <lantiq_soc.h>
19
20#include "../clk.h"
21#include "../prom.h"
22
Hauke Mehrtens758d2442015-10-28 23:37:31 +010023/* clock control register for legacy */
John Crispin287e3f32012-04-17 15:53:19 +020024#define CGU_IFCCR 0x0018
John Crispine29b72f2012-07-22 08:55:57 +020025#define CGU_IFCCR_VR9 0x0024
Hauke Mehrtens758d2442015-10-28 23:37:31 +010026/* system clock register for legacy */
John Crispin287e3f32012-04-17 15:53:19 +020027#define CGU_SYS 0x0010
28/* pci control register */
29#define CGU_PCICR 0x0034
John Crispine29b72f2012-07-22 08:55:57 +020030#define CGU_PCICR_VR9 0x0038
John Crispin287e3f32012-04-17 15:53:19 +020031/* ephy configuration register */
32#define CGU_EPHY 0x10
Hauke Mehrtens758d2442015-10-28 23:37:31 +010033
34/* Legacy PMU register for ar9, ase, danube */
John Crispin287e3f32012-04-17 15:53:19 +020035/* power control register */
36#define PMU_PWDCR 0x1C
37/* power status register */
38#define PMU_PWDSR 0x20
39/* power control register */
40#define PMU_PWDCR1 0x24
41/* power status register */
42#define PMU_PWDSR1 0x28
43/* power control register */
44#define PWDCR(x) ((x) ? (PMU_PWDCR1) : (PMU_PWDCR))
45/* power status register */
46#define PWDSR(x) ((x) ? (PMU_PWDSR1) : (PMU_PWDSR))
47
Hauke Mehrtens758d2442015-10-28 23:37:31 +010048
49/* PMU register for ar10 and grx390 */
50
51/* First register set */
52#define PMU_CLK_SR 0x20 /* status */
53#define PMU_CLK_CR_A 0x24 /* Enable */
54#define PMU_CLK_CR_B 0x28 /* Disable */
55/* Second register set */
56#define PMU_CLK_SR1 0x30 /* status */
57#define PMU_CLK_CR1_A 0x34 /* Enable */
58#define PMU_CLK_CR1_B 0x38 /* Disable */
59/* Third register set */
60#define PMU_ANA_SR 0x40 /* status */
61#define PMU_ANA_CR_A 0x44 /* Enable */
62#define PMU_ANA_CR_B 0x48 /* Disable */
63
64/* Status */
65static u32 pmu_clk_sr[] = {
66 PMU_CLK_SR,
67 PMU_CLK_SR1,
68 PMU_ANA_SR,
69};
70
71/* Enable */
72static u32 pmu_clk_cr_a[] = {
73 PMU_CLK_CR_A,
74 PMU_CLK_CR1_A,
75 PMU_ANA_CR_A,
76};
77
78/* Disable */
79static u32 pmu_clk_cr_b[] = {
80 PMU_CLK_CR_B,
81 PMU_CLK_CR1_B,
82 PMU_ANA_CR_B,
83};
84
85#define PWDCR_EN_XRX(x) (pmu_clk_cr_a[(x)])
86#define PWDCR_DIS_XRX(x) (pmu_clk_cr_b[(x)])
87#define PWDSR_XRX(x) (pmu_clk_sr[(x)])
88
John Crispin287e3f32012-04-17 15:53:19 +020089/* clock gates that we can en/disable */
90#define PMU_USB0_P BIT(0)
91#define PMU_PCI BIT(4)
John Crispin009d6912012-04-19 16:23:14 +020092#define PMU_DMA BIT(5)
John Crispin287e3f32012-04-17 15:53:19 +020093#define PMU_USB0 BIT(6)
94#define PMU_ASC0 BIT(7)
95#define PMU_EPHY BIT(7) /* ase */
96#define PMU_SPI BIT(8)
97#define PMU_DFE BIT(9)
98#define PMU_EBU BIT(10)
99#define PMU_STP BIT(11)
John Crispin009d6912012-04-19 16:23:14 +0200100#define PMU_GPT BIT(12)
John Crispin287e3f32012-04-17 15:53:19 +0200101#define PMU_AHBS BIT(13) /* vr9 */
John Crispin009d6912012-04-19 16:23:14 +0200102#define PMU_FPI BIT(14)
John Crispin287e3f32012-04-17 15:53:19 +0200103#define PMU_AHBM BIT(15)
104#define PMU_ASC1 BIT(17)
105#define PMU_PPE_QSB BIT(18)
106#define PMU_PPE_SLL01 BIT(19)
107#define PMU_PPE_TC BIT(21)
108#define PMU_PPE_EMA BIT(22)
109#define PMU_PPE_DPLUM BIT(23)
110#define PMU_PPE_DPLUS BIT(24)
111#define PMU_USB1_P BIT(26)
112#define PMU_USB1 BIT(27)
John Crispin009d6912012-04-19 16:23:14 +0200113#define PMU_SWITCH BIT(28)
John Crispin287e3f32012-04-17 15:53:19 +0200114#define PMU_PPE_TOP BIT(29)
115#define PMU_GPHY BIT(30)
116#define PMU_PCIE_CLK BIT(31)
117
118#define PMU1_PCIE_PHY BIT(0)
119#define PMU1_PCIE_CTL BIT(1)
120#define PMU1_PCIE_PDI BIT(4)
121#define PMU1_PCIE_MSI BIT(5)
122
123#define pmu_w32(x, y) ltq_w32((x), pmu_membase + (y))
124#define pmu_r32(x) ltq_r32(pmu_membase + (x))
125
126static void __iomem *pmu_membase;
127void __iomem *ltq_cgu_membase;
128void __iomem *ltq_ebu_membase;
129
John Crispine29b72f2012-07-22 08:55:57 +0200130static u32 ifccr = CGU_IFCCR;
131static u32 pcicr = CGU_PCICR;
132
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100133static DEFINE_SPINLOCK(g_pmu_lock);
134
John Crispin287e3f32012-04-17 15:53:19 +0200135/* legacy function kept alive to ease clkdev transition */
136void ltq_pmu_enable(unsigned int module)
137{
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100138 int retry = 1000000;
John Crispin287e3f32012-04-17 15:53:19 +0200139
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100140 spin_lock(&g_pmu_lock);
John Crispin287e3f32012-04-17 15:53:19 +0200141 pmu_w32(pmu_r32(PMU_PWDCR) & ~module, PMU_PWDCR);
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100142 do {} while (--retry && (pmu_r32(PMU_PWDSR) & module));
143 spin_unlock(&g_pmu_lock);
John Crispin287e3f32012-04-17 15:53:19 +0200144
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100145 if (!retry)
John Crispin287e3f32012-04-17 15:53:19 +0200146 panic("activating PMU module failed!");
147}
148EXPORT_SYMBOL(ltq_pmu_enable);
149
150/* legacy function kept alive to ease clkdev transition */
151void ltq_pmu_disable(unsigned int module)
152{
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100153 int retry = 1000000;
154
155 spin_lock(&g_pmu_lock);
John Crispin287e3f32012-04-17 15:53:19 +0200156 pmu_w32(pmu_r32(PMU_PWDCR) | module, PMU_PWDCR);
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100157 do {} while (--retry && (!(pmu_r32(PMU_PWDSR) & module)));
158 spin_unlock(&g_pmu_lock);
159
160 if (!retry)
161 pr_warn("deactivating PMU module failed!");
John Crispin287e3f32012-04-17 15:53:19 +0200162}
163EXPORT_SYMBOL(ltq_pmu_disable);
164
165/* enable a hw clock */
166static int cgu_enable(struct clk *clk)
167{
John Crispine29b72f2012-07-22 08:55:57 +0200168 ltq_cgu_w32(ltq_cgu_r32(ifccr) | clk->bits, ifccr);
John Crispin287e3f32012-04-17 15:53:19 +0200169 return 0;
170}
171
172/* disable a hw clock */
173static void cgu_disable(struct clk *clk)
174{
John Crispine29b72f2012-07-22 08:55:57 +0200175 ltq_cgu_w32(ltq_cgu_r32(ifccr) & ~clk->bits, ifccr);
John Crispin287e3f32012-04-17 15:53:19 +0200176}
177
178/* enable a clock gate */
179static int pmu_enable(struct clk *clk)
180{
181 int retry = 1000000;
182
Hauke Mehrtens758d2442015-10-28 23:37:31 +0100183 if (of_machine_is_compatible("lantiq,ar10")
184 || of_machine_is_compatible("lantiq,grx390")) {
185 pmu_w32(clk->bits, PWDCR_EN_XRX(clk->module));
186 do {} while (--retry &&
187 (!(pmu_r32(PWDSR_XRX(clk->module)) & clk->bits)));
188
189 } else {
190 spin_lock(&g_pmu_lock);
191 pmu_w32(pmu_r32(PWDCR(clk->module)) & ~clk->bits,
192 PWDCR(clk->module));
193 do {} while (--retry &&
194 (pmu_r32(PWDSR(clk->module)) & clk->bits));
195 spin_unlock(&g_pmu_lock);
196 }
John Crispin287e3f32012-04-17 15:53:19 +0200197
198 if (!retry)
Ralf Baechlef7777dc2013-09-18 16:05:26 +0200199 panic("activating PMU module failed!");
John Crispin287e3f32012-04-17 15:53:19 +0200200
201 return 0;
202}
203
204/* disable a clock gate */
205static void pmu_disable(struct clk *clk)
206{
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100207 int retry = 1000000;
208
Hauke Mehrtens758d2442015-10-28 23:37:31 +0100209 if (of_machine_is_compatible("lantiq,ar10")
210 || of_machine_is_compatible("lantiq,grx390")) {
211 pmu_w32(clk->bits, PWDCR_DIS_XRX(clk->module));
212 do {} while (--retry &&
213 (pmu_r32(PWDSR_XRX(clk->module)) & clk->bits));
214 } else {
215 spin_lock(&g_pmu_lock);
216 pmu_w32(pmu_r32(PWDCR(clk->module)) | clk->bits,
217 PWDCR(clk->module));
218 do {} while (--retry &&
219 (!(pmu_r32(PWDSR(clk->module)) & clk->bits)));
220 spin_unlock(&g_pmu_lock);
221 }
Hauke Mehrtenscab7b832015-10-28 23:37:30 +0100222
223 if (!retry)
224 pr_warn("deactivating PMU module failed!");
John Crispin287e3f32012-04-17 15:53:19 +0200225}
226
227/* the pci enable helper */
228static int pci_enable(struct clk *clk)
229{
John Crispine29b72f2012-07-22 08:55:57 +0200230 unsigned int val = ltq_cgu_r32(ifccr);
John Crispin287e3f32012-04-17 15:53:19 +0200231 /* set bus clock speed */
John Crispinf40e1f92012-08-16 08:25:42 +0000232 if (of_machine_is_compatible("lantiq,ar9") ||
233 of_machine_is_compatible("lantiq,vr9")) {
John Crispine29b72f2012-07-22 08:55:57 +0200234 val &= ~0x1f00000;
John Crispin287e3f32012-04-17 15:53:19 +0200235 if (clk->rate == CLOCK_33M)
John Crispine29b72f2012-07-22 08:55:57 +0200236 val |= 0xe00000;
John Crispin287e3f32012-04-17 15:53:19 +0200237 else
John Crispine29b72f2012-07-22 08:55:57 +0200238 val |= 0x700000; /* 62.5M */
John Crispin287e3f32012-04-17 15:53:19 +0200239 } else {
John Crispine29b72f2012-07-22 08:55:57 +0200240 val &= ~0xf00000;
John Crispin287e3f32012-04-17 15:53:19 +0200241 if (clk->rate == CLOCK_33M)
John Crispine29b72f2012-07-22 08:55:57 +0200242 val |= 0x800000;
John Crispin287e3f32012-04-17 15:53:19 +0200243 else
John Crispine29b72f2012-07-22 08:55:57 +0200244 val |= 0x400000; /* 62.5M */
John Crispin287e3f32012-04-17 15:53:19 +0200245 }
John Crispine29b72f2012-07-22 08:55:57 +0200246 ltq_cgu_w32(val, ifccr);
John Crispin287e3f32012-04-17 15:53:19 +0200247 pmu_enable(clk);
248 return 0;
249}
250
251/* enable the external clock as a source */
252static int pci_ext_enable(struct clk *clk)
253{
John Crispine29b72f2012-07-22 08:55:57 +0200254 ltq_cgu_w32(ltq_cgu_r32(ifccr) & ~(1 << 16), ifccr);
255 ltq_cgu_w32((1 << 30), pcicr);
John Crispin287e3f32012-04-17 15:53:19 +0200256 return 0;
257}
258
259/* disable the external clock as a source */
260static void pci_ext_disable(struct clk *clk)
261{
John Crispine29b72f2012-07-22 08:55:57 +0200262 ltq_cgu_w32(ltq_cgu_r32(ifccr) | (1 << 16), ifccr);
263 ltq_cgu_w32((1 << 31) | (1 << 30), pcicr);
John Crispin287e3f32012-04-17 15:53:19 +0200264}
265
266/* enable a clockout source */
267static int clkout_enable(struct clk *clk)
268{
269 int i;
270
271 /* get the correct rate */
272 for (i = 0; i < 4; i++) {
273 if (clk->rates[i] == clk->rate) {
274 int shift = 14 - (2 * clk->module);
John Crispin98dbc572012-07-24 08:56:41 +0200275 int enable = 7 - clk->module;
John Crispine29b72f2012-07-22 08:55:57 +0200276 unsigned int val = ltq_cgu_r32(ifccr);
John Crispin287e3f32012-04-17 15:53:19 +0200277
John Crispine29b72f2012-07-22 08:55:57 +0200278 val &= ~(3 << shift);
279 val |= i << shift;
John Crispin98dbc572012-07-24 08:56:41 +0200280 val |= enable;
John Crispine29b72f2012-07-22 08:55:57 +0200281 ltq_cgu_w32(val, ifccr);
John Crispin287e3f32012-04-17 15:53:19 +0200282 return 0;
283 }
284 }
285 return -1;
286}
287
288/* manage the clock gates via PMU */
289static void clkdev_add_pmu(const char *dev, const char *con,
290 unsigned int module, unsigned int bits)
291{
292 struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
293
294 clk->cl.dev_id = dev;
295 clk->cl.con_id = con;
296 clk->cl.clk = clk;
297 clk->enable = pmu_enable;
298 clk->disable = pmu_disable;
299 clk->module = module;
300 clk->bits = bits;
301 clkdev_add(&clk->cl);
302}
303
304/* manage the clock generator */
305static void clkdev_add_cgu(const char *dev, const char *con,
306 unsigned int bits)
307{
308 struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
309
310 clk->cl.dev_id = dev;
311 clk->cl.con_id = con;
312 clk->cl.clk = clk;
313 clk->enable = cgu_enable;
314 clk->disable = cgu_disable;
315 clk->bits = bits;
316 clkdev_add(&clk->cl);
317}
318
319/* pci needs its own enable function as the setup is a bit more complex */
320static unsigned long valid_pci_rates[] = {CLOCK_33M, CLOCK_62_5M, 0};
321
322static void clkdev_add_pci(void)
323{
324 struct clk *clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
325 struct clk *clk_ext = kzalloc(sizeof(struct clk), GFP_KERNEL);
326
327 /* main pci clock */
328 clk->cl.dev_id = "17000000.pci";
329 clk->cl.con_id = NULL;
330 clk->cl.clk = clk;
331 clk->rate = CLOCK_33M;
332 clk->rates = valid_pci_rates;
333 clk->enable = pci_enable;
334 clk->disable = pmu_disable;
335 clk->module = 0;
336 clk->bits = PMU_PCI;
337 clkdev_add(&clk->cl);
338
339 /* use internal/external bus clock */
340 clk_ext->cl.dev_id = "17000000.pci";
341 clk_ext->cl.con_id = "external";
342 clk_ext->cl.clk = clk_ext;
343 clk_ext->enable = pci_ext_enable;
344 clk_ext->disable = pci_ext_disable;
345 clkdev_add(&clk_ext->cl);
346}
347
348/* xway socs can generate clocks on gpio pins */
349static unsigned long valid_clkout_rates[4][5] = {
350 {CLOCK_32_768K, CLOCK_1_536M, CLOCK_2_5M, CLOCK_12M, 0},
351 {CLOCK_40M, CLOCK_12M, CLOCK_24M, CLOCK_48M, 0},
352 {CLOCK_25M, CLOCK_40M, CLOCK_30M, CLOCK_60M, 0},
353 {CLOCK_12M, CLOCK_50M, CLOCK_32_768K, CLOCK_25M, 0},
354};
355
356static void clkdev_add_clkout(void)
357{
358 int i;
359
360 for (i = 0; i < 4; i++) {
361 struct clk *clk;
362 char *name;
363
364 name = kzalloc(sizeof("clkout0"), GFP_KERNEL);
365 sprintf(name, "clkout%d", i);
366
367 clk = kzalloc(sizeof(struct clk), GFP_KERNEL);
368 clk->cl.dev_id = "1f103000.cgu";
369 clk->cl.con_id = name;
370 clk->cl.clk = clk;
371 clk->rate = 0;
372 clk->rates = valid_clkout_rates[i];
373 clk->enable = clkout_enable;
374 clk->module = i;
375 clkdev_add(&clk->cl);
376 }
377}
378
379/* bring up all register ranges that we need for basic system control */
380void __init ltq_soc_init(void)
381{
382 struct resource res_pmu, res_cgu, res_ebu;
383 struct device_node *np_pmu =
384 of_find_compatible_node(NULL, NULL, "lantiq,pmu-xway");
385 struct device_node *np_cgu =
386 of_find_compatible_node(NULL, NULL, "lantiq,cgu-xway");
387 struct device_node *np_ebu =
388 of_find_compatible_node(NULL, NULL, "lantiq,ebu-xway");
389
390 /* check if all the core register ranges are available */
391 if (!np_pmu || !np_cgu || !np_ebu)
John Crispin3d18c172013-01-19 08:54:23 +0000392 panic("Failed to load core nodes from devicetree");
John Crispin287e3f32012-04-17 15:53:19 +0200393
394 if (of_address_to_resource(np_pmu, 0, &res_pmu) ||
395 of_address_to_resource(np_cgu, 0, &res_cgu) ||
396 of_address_to_resource(np_ebu, 0, &res_ebu))
397 panic("Failed to get core resources");
398
399 if ((request_mem_region(res_pmu.start, resource_size(&res_pmu),
400 res_pmu.name) < 0) ||
401 (request_mem_region(res_cgu.start, resource_size(&res_cgu),
402 res_cgu.name) < 0) ||
403 (request_mem_region(res_ebu.start, resource_size(&res_ebu),
404 res_ebu.name) < 0))
Masanari Iida1a84db52014-08-29 23:37:33 +0900405 pr_err("Failed to request core resources");
John Crispin287e3f32012-04-17 15:53:19 +0200406
407 pmu_membase = ioremap_nocache(res_pmu.start, resource_size(&res_pmu));
408 ltq_cgu_membase = ioremap_nocache(res_cgu.start,
409 resource_size(&res_cgu));
410 ltq_ebu_membase = ioremap_nocache(res_ebu.start,
411 resource_size(&res_ebu));
412 if (!pmu_membase || !ltq_cgu_membase || !ltq_ebu_membase)
413 panic("Failed to remap core resources");
414
415 /* make sure to unprotect the memory region where flash is located */
416 ltq_ebu_w32(ltq_ebu_r32(LTQ_EBU_BUSCON0) & ~EBU_WRDIS, LTQ_EBU_BUSCON0);
417
418 /* add our generic xway clocks */
419 clkdev_add_pmu("10000000.fpi", NULL, 0, PMU_FPI);
420 clkdev_add_pmu("1e100400.serial", NULL, 0, PMU_ASC0);
421 clkdev_add_pmu("1e100a00.gptu", NULL, 0, PMU_GPT);
422 clkdev_add_pmu("1e100bb0.stp", NULL, 0, PMU_STP);
423 clkdev_add_pmu("1e104100.dma", NULL, 0, PMU_DMA);
424 clkdev_add_pmu("1e100800.spi", NULL, 0, PMU_SPI);
425 clkdev_add_pmu("1e105300.ebu", NULL, 0, PMU_EBU);
426 clkdev_add_clkout();
427
428 /* add the soc dependent clocks */
John Crispine29b72f2012-07-22 08:55:57 +0200429 if (of_machine_is_compatible("lantiq,vr9")) {
430 ifccr = CGU_IFCCR_VR9;
431 pcicr = CGU_PCICR_VR9;
432 } else {
John Crispin287e3f32012-04-17 15:53:19 +0200433 clkdev_add_pmu("1e180000.etop", NULL, 0, PMU_PPE);
John Crispine29b72f2012-07-22 08:55:57 +0200434 }
John Crispin287e3f32012-04-17 15:53:19 +0200435
436 if (!of_machine_is_compatible("lantiq,ase")) {
437 clkdev_add_pmu("1e100c00.serial", NULL, 0, PMU_ASC1);
438 clkdev_add_pci();
439 }
440
441 if (of_machine_is_compatible("lantiq,ase")) {
442 if (ltq_cgu_r32(CGU_SYS) & (1 << 5))
John Crispin740c606e2013-01-19 08:54:24 +0000443 clkdev_add_static(CLOCK_266M, CLOCK_133M,
444 CLOCK_133M, CLOCK_266M);
John Crispin287e3f32012-04-17 15:53:19 +0200445 else
John Crispin740c606e2013-01-19 08:54:24 +0000446 clkdev_add_static(CLOCK_133M, CLOCK_133M,
447 CLOCK_133M, CLOCK_133M);
John Crispin287e3f32012-04-17 15:53:19 +0200448 clkdev_add_cgu("1e180000.etop", "ephycgu", CGU_EPHY),
449 clkdev_add_pmu("1e180000.etop", "ephy", 0, PMU_EPHY);
450 } else if (of_machine_is_compatible("lantiq,vr9")) {
451 clkdev_add_static(ltq_vr9_cpu_hz(), ltq_vr9_fpi_hz(),
John Crispin740c606e2013-01-19 08:54:24 +0000452 ltq_vr9_fpi_hz(), ltq_vr9_pp32_hz());
John Crispin287e3f32012-04-17 15:53:19 +0200453 clkdev_add_pmu("1d900000.pcie", "phy", 1, PMU1_PCIE_PHY);
454 clkdev_add_pmu("1d900000.pcie", "bus", 0, PMU_PCIE_CLK);
455 clkdev_add_pmu("1d900000.pcie", "msi", 1, PMU1_PCIE_MSI);
456 clkdev_add_pmu("1d900000.pcie", "pdi", 1, PMU1_PCIE_PDI);
457 clkdev_add_pmu("1d900000.pcie", "ctl", 1, PMU1_PCIE_CTL);
458 clkdev_add_pmu("1d900000.pcie", "ahb", 0, PMU_AHBM | PMU_AHBS);
John Crispinf2bbe412012-11-09 13:34:18 +0100459 clkdev_add_pmu("1e108000.eth", NULL, 0,
460 PMU_SWITCH | PMU_PPE_DPLUS | PMU_PPE_DPLUM |
461 PMU_PPE_EMA | PMU_PPE_TC | PMU_PPE_SLL01 |
462 PMU_PPE_QSB | PMU_PPE_TOP);
John Crispind0c550d2013-01-19 08:54:25 +0000463 clkdev_add_pmu("1f203000.rcu", "gphy", 0, PMU_GPHY);
John Crispin287e3f32012-04-17 15:53:19 +0200464 } else if (of_machine_is_compatible("lantiq,ar9")) {
465 clkdev_add_static(ltq_ar9_cpu_hz(), ltq_ar9_fpi_hz(),
John Crispin740c606e2013-01-19 08:54:24 +0000466 ltq_ar9_fpi_hz(), CLOCK_250M);
John Crispin287e3f32012-04-17 15:53:19 +0200467 clkdev_add_pmu("1e180000.etop", "switch", 0, PMU_SWITCH);
468 } else {
469 clkdev_add_static(ltq_danube_cpu_hz(), ltq_danube_fpi_hz(),
John Crispin740c606e2013-01-19 08:54:24 +0000470 ltq_danube_fpi_hz(), ltq_danube_pp32_hz());
John Crispin287e3f32012-04-17 15:53:19 +0200471 }
472}