blob: 8cdf9f9f74b597a6e3e0d1c03c9cefdf8d2e1394 [file] [log] [blame]
Saeed Bishara651c74c2008-06-22 22:45:06 +02001/*
2 * arch/arm/mach-kirkwood/common.c
3 *
4 * Core functions for Marvell Kirkwood SoCs
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/serial_8250.h>
15#include <linux/mbus.h>
16#include <linux/mv643xx_eth.h>
Martin Michlmayr6574e002009-03-23 19:13:21 +010017#include <linux/mv643xx_i2c.h>
Saeed Bishara651c74c2008-06-22 22:45:06 +020018#include <linux/ata_platform.h>
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -040019#include <linux/mtd/nand.h>
Lennert Buytenhek18365d12008-08-09 15:38:18 +020020#include <linux/spi/orion_spi.h>
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +020021#include <net/dsa.h>
Saeed Bishara651c74c2008-06-22 22:45:06 +020022#include <asm/page.h>
23#include <asm/timex.h>
Eric Cooper9c153642011-02-02 17:16:11 -050024#include <asm/kexec.h>
Saeed Bishara651c74c2008-06-22 22:45:06 +020025#include <asm/mach/map.h>
26#include <asm/mach/time.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010027#include <mach/kirkwood.h>
Nicolas Pitrefdd8b072009-04-22 20:08:17 +010028#include <mach/bridge-regs.h>
apatard@mandriva.com49106c72010-05-31 13:49:12 +020029#include <plat/audio.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020030#include <plat/cache-feroceon-l2.h>
31#include <plat/ehci-orion.h>
Nicolas Pitre8235ee02009-02-14 03:15:55 -050032#include <plat/mvsdio.h>
Saeed Bishara09c0ed22008-06-23 04:26:07 -110033#include <plat/mv_xor.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020034#include <plat/orion_nand.h>
Nicolas Pitre3b937a72009-06-01 13:56:02 -040035#include <plat/orion_wdt.h>
Andrew Lunn28a2b452011-05-15 13:32:41 +020036#include <plat/common.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020037#include <plat/time.h>
Saeed Bishara651c74c2008-06-22 22:45:06 +020038#include "common.h"
39
40/*****************************************************************************
41 * I/O Address Mapping
42 ****************************************************************************/
43static struct map_desc kirkwood_io_desc[] __initdata = {
44 {
45 .virtual = KIRKWOOD_PCIE_IO_VIRT_BASE,
46 .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE),
47 .length = KIRKWOOD_PCIE_IO_SIZE,
48 .type = MT_DEVICE,
49 }, {
Saeed Bisharaffd58bd2010-06-08 14:21:34 +030050 .virtual = KIRKWOOD_PCIE1_IO_VIRT_BASE,
51 .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE),
52 .length = KIRKWOOD_PCIE1_IO_SIZE,
53 .type = MT_DEVICE,
54 }, {
Saeed Bishara651c74c2008-06-22 22:45:06 +020055 .virtual = KIRKWOOD_REGS_VIRT_BASE,
56 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
57 .length = KIRKWOOD_REGS_SIZE,
58 .type = MT_DEVICE,
59 },
60};
61
62void __init kirkwood_map_io(void)
63{
64 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
65}
66
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +020067/*
68 * Default clock control bits. Any bit _not_ set in this variable
69 * will be cleared from the hardware after platform devices have been
70 * registered. Some reserved bits must be set to 1.
71 */
72unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED;
73
Saeed Bishara651c74c2008-06-22 22:45:06 +020074
75/*****************************************************************************
76 * EHCI
77 ****************************************************************************/
78static struct orion_ehci_data kirkwood_ehci_data = {
79 .dram = &kirkwood_mbus_dram_info,
Ronen Shitritfb6f5522008-09-17 10:08:05 +030080 .phy_version = EHCI_PHY_NA,
Saeed Bishara651c74c2008-06-22 22:45:06 +020081};
82
Andrew Lunn5c602552011-05-15 13:32:40 +020083static u64 ehci_dmamask = DMA_BIT_MASK(32);
Saeed Bishara651c74c2008-06-22 22:45:06 +020084
85
86/*****************************************************************************
87 * EHCI0
88 ****************************************************************************/
89static struct resource kirkwood_ehci_resources[] = {
90 {
91 .start = USB_PHYS_BASE,
Andrew Lunn5c602552011-05-15 13:32:40 +020092 .end = USB_PHYS_BASE + SZ_4K - 1,
Saeed Bishara651c74c2008-06-22 22:45:06 +020093 .flags = IORESOURCE_MEM,
94 }, {
95 .start = IRQ_KIRKWOOD_USB,
96 .end = IRQ_KIRKWOOD_USB,
97 .flags = IORESOURCE_IRQ,
98 },
99};
100
101static struct platform_device kirkwood_ehci = {
102 .name = "orion-ehci",
103 .id = 0,
104 .dev = {
105 .dma_mask = &ehci_dmamask,
Andrew Lunn5c602552011-05-15 13:32:40 +0200106 .coherent_dma_mask = DMA_BIT_MASK(32),
Saeed Bishara651c74c2008-06-22 22:45:06 +0200107 .platform_data = &kirkwood_ehci_data,
108 },
109 .resource = kirkwood_ehci_resources,
110 .num_resources = ARRAY_SIZE(kirkwood_ehci_resources),
111};
112
113void __init kirkwood_ehci_init(void)
114{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200115 kirkwood_clk_ctrl |= CGC_USB0;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200116 platform_device_register(&kirkwood_ehci);
117}
118
119
120/*****************************************************************************
121 * GE00
122 ****************************************************************************/
123struct mv643xx_eth_shared_platform_data kirkwood_ge00_shared_data = {
Saeed Bishara651c74c2008-06-22 22:45:06 +0200124 .dram = &kirkwood_mbus_dram_info,
125};
126
127static struct resource kirkwood_ge00_shared_resources[] = {
128 {
129 .name = "ge00 base",
130 .start = GE00_PHYS_BASE + 0x2000,
Andrew Lunn5c602552011-05-15 13:32:40 +0200131 .end = GE00_PHYS_BASE + SZ_16K - 1,
Saeed Bishara651c74c2008-06-22 22:45:06 +0200132 .flags = IORESOURCE_MEM,
Lennert Buytenhek144f8142008-08-26 16:04:05 +0200133 }, {
134 .name = "ge00 err irq",
135 .start = IRQ_KIRKWOOD_GE00_ERR,
136 .end = IRQ_KIRKWOOD_GE00_ERR,
137 .flags = IORESOURCE_IRQ,
Saeed Bishara651c74c2008-06-22 22:45:06 +0200138 },
139};
140
141static struct platform_device kirkwood_ge00_shared = {
142 .name = MV643XX_ETH_SHARED_NAME,
143 .id = 0,
144 .dev = {
145 .platform_data = &kirkwood_ge00_shared_data,
146 },
Lennert Buytenhek144f8142008-08-26 16:04:05 +0200147 .num_resources = ARRAY_SIZE(kirkwood_ge00_shared_resources),
Saeed Bishara651c74c2008-06-22 22:45:06 +0200148 .resource = kirkwood_ge00_shared_resources,
149};
150
151static struct resource kirkwood_ge00_resources[] = {
152 {
153 .name = "ge00 irq",
154 .start = IRQ_KIRKWOOD_GE00_SUM,
155 .end = IRQ_KIRKWOOD_GE00_SUM,
156 .flags = IORESOURCE_IRQ,
157 },
158};
159
160static struct platform_device kirkwood_ge00 = {
161 .name = MV643XX_ETH_NAME,
162 .id = 0,
163 .num_resources = 1,
164 .resource = kirkwood_ge00_resources,
Nicolas Pitrea49a0182009-05-22 16:53:40 -0400165 .dev = {
Andrew Lunn5c602552011-05-15 13:32:40 +0200166 .coherent_dma_mask = DMA_BIT_MASK(32),
Nicolas Pitrea49a0182009-05-22 16:53:40 -0400167 },
Saeed Bishara651c74c2008-06-22 22:45:06 +0200168};
169
170void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
171{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200172 kirkwood_clk_ctrl |= CGC_GE0;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200173 eth_data->shared = &kirkwood_ge00_shared;
174 kirkwood_ge00.dev.platform_data = eth_data;
175
176 platform_device_register(&kirkwood_ge00_shared);
177 platform_device_register(&kirkwood_ge00);
178}
179
180
181/*****************************************************************************
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200182 * GE01
183 ****************************************************************************/
184struct mv643xx_eth_shared_platform_data kirkwood_ge01_shared_data = {
185 .dram = &kirkwood_mbus_dram_info,
186 .shared_smi = &kirkwood_ge00_shared,
187};
188
189static struct resource kirkwood_ge01_shared_resources[] = {
190 {
191 .name = "ge01 base",
192 .start = GE01_PHYS_BASE + 0x2000,
Andrew Lunn5c602552011-05-15 13:32:40 +0200193 .end = GE01_PHYS_BASE + SZ_16K - 1,
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200194 .flags = IORESOURCE_MEM,
195 }, {
196 .name = "ge01 err irq",
197 .start = IRQ_KIRKWOOD_GE01_ERR,
198 .end = IRQ_KIRKWOOD_GE01_ERR,
199 .flags = IORESOURCE_IRQ,
200 },
201};
202
203static struct platform_device kirkwood_ge01_shared = {
204 .name = MV643XX_ETH_SHARED_NAME,
205 .id = 1,
206 .dev = {
207 .platform_data = &kirkwood_ge01_shared_data,
208 },
209 .num_resources = ARRAY_SIZE(kirkwood_ge01_shared_resources),
210 .resource = kirkwood_ge01_shared_resources,
211};
212
213static struct resource kirkwood_ge01_resources[] = {
214 {
215 .name = "ge01 irq",
216 .start = IRQ_KIRKWOOD_GE01_SUM,
217 .end = IRQ_KIRKWOOD_GE01_SUM,
218 .flags = IORESOURCE_IRQ,
219 },
220};
221
222static struct platform_device kirkwood_ge01 = {
223 .name = MV643XX_ETH_NAME,
224 .id = 1,
225 .num_resources = 1,
226 .resource = kirkwood_ge01_resources,
Nicolas Pitrea49a0182009-05-22 16:53:40 -0400227 .dev = {
Andrew Lunn5c602552011-05-15 13:32:40 +0200228 .coherent_dma_mask = DMA_BIT_MASK(32),
Nicolas Pitrea49a0182009-05-22 16:53:40 -0400229 },
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200230};
231
232void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data)
233{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200234 kirkwood_clk_ctrl |= CGC_GE1;
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200235 eth_data->shared = &kirkwood_ge01_shared;
236 kirkwood_ge01.dev.platform_data = eth_data;
237
238 platform_device_register(&kirkwood_ge01_shared);
239 platform_device_register(&kirkwood_ge01);
240}
241
242
243/*****************************************************************************
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200244 * Ethernet switch
245 ****************************************************************************/
246static struct resource kirkwood_switch_resources[] = {
247 {
248 .start = 0,
249 .end = 0,
250 .flags = IORESOURCE_IRQ,
251 },
252};
253
254static struct platform_device kirkwood_switch_device = {
255 .name = "dsa",
256 .id = 0,
257 .num_resources = 0,
258 .resource = kirkwood_switch_resources,
259};
260
261void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
262{
Lennert Buytenheke84665c2009-03-20 09:52:09 +0000263 int i;
264
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200265 if (irq != NO_IRQ) {
266 kirkwood_switch_resources[0].start = irq;
267 kirkwood_switch_resources[0].end = irq;
268 kirkwood_switch_device.num_resources = 1;
269 }
270
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200271 d->netdev = &kirkwood_ge00.dev;
Lennert Buytenheke84665c2009-03-20 09:52:09 +0000272 for (i = 0; i < d->nr_chips; i++)
273 d->chip[i].mii_bus = &kirkwood_ge00_shared.dev;
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200274 kirkwood_switch_device.dev.platform_data = d;
275
276 platform_device_register(&kirkwood_switch_device);
277}
278
279
280/*****************************************************************************
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -0400281 * NAND flash
282 ****************************************************************************/
283static struct resource kirkwood_nand_resource = {
284 .flags = IORESOURCE_MEM,
285 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
286 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
287 KIRKWOOD_NAND_MEM_SIZE - 1,
288};
289
290static struct orion_nand_data kirkwood_nand_data = {
291 .cle = 0,
292 .ale = 1,
293 .width = 8,
294};
295
296static struct platform_device kirkwood_nand_flash = {
297 .name = "orion_nand",
298 .id = -1,
299 .dev = {
300 .platform_data = &kirkwood_nand_data,
301 },
302 .resource = &kirkwood_nand_resource,
303 .num_resources = 1,
304};
305
306void __init kirkwood_nand_init(struct mtd_partition *parts, int nr_parts,
307 int chip_delay)
308{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200309 kirkwood_clk_ctrl |= CGC_RUNIT;
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -0400310 kirkwood_nand_data.parts = parts;
311 kirkwood_nand_data.nr_parts = nr_parts;
312 kirkwood_nand_data.chip_delay = chip_delay;
313 platform_device_register(&kirkwood_nand_flash);
314}
315
Ben Dooks010937e2010-04-20 10:26:19 +0100316void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
317 int (*dev_ready)(struct mtd_info *))
318{
319 kirkwood_clk_ctrl |= CGC_RUNIT;
320 kirkwood_nand_data.parts = parts;
321 kirkwood_nand_data.nr_parts = nr_parts;
322 kirkwood_nand_data.dev_ready = dev_ready;
323 platform_device_register(&kirkwood_nand_flash);
324}
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -0400325
326/*****************************************************************************
Saeed Bishara651c74c2008-06-22 22:45:06 +0200327 * SoC RTC
328 ****************************************************************************/
329static struct resource kirkwood_rtc_resource = {
330 .start = RTC_PHYS_BASE,
331 .end = RTC_PHYS_BASE + SZ_16 - 1,
332 .flags = IORESOURCE_MEM,
333};
334
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500335static void __init kirkwood_rtc_init(void)
Saeed Bishara651c74c2008-06-22 22:45:06 +0200336{
337 platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1);
338}
339
340
341/*****************************************************************************
342 * SATA
343 ****************************************************************************/
344static struct resource kirkwood_sata_resources[] = {
345 {
346 .name = "sata base",
347 .start = SATA_PHYS_BASE,
348 .end = SATA_PHYS_BASE + 0x5000 - 1,
349 .flags = IORESOURCE_MEM,
350 }, {
351 .name = "sata irq",
352 .start = IRQ_KIRKWOOD_SATA,
353 .end = IRQ_KIRKWOOD_SATA,
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358static struct platform_device kirkwood_sata = {
359 .name = "sata_mv",
360 .id = 0,
361 .dev = {
Andrew Lunn5c602552011-05-15 13:32:40 +0200362 .coherent_dma_mask = DMA_BIT_MASK(32),
Saeed Bishara651c74c2008-06-22 22:45:06 +0200363 },
364 .num_resources = ARRAY_SIZE(kirkwood_sata_resources),
365 .resource = kirkwood_sata_resources,
366};
367
368void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
369{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200370 kirkwood_clk_ctrl |= CGC_SATA0;
371 if (sata_data->n_ports > 1)
372 kirkwood_clk_ctrl |= CGC_SATA1;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200373 sata_data->dram = &kirkwood_mbus_dram_info;
374 kirkwood_sata.dev.platform_data = sata_data;
375 platform_device_register(&kirkwood_sata);
376}
377
378
379/*****************************************************************************
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500380 * SD/SDIO/MMC
381 ****************************************************************************/
382static struct resource mvsdio_resources[] = {
383 [0] = {
384 .start = SDIO_PHYS_BASE,
385 .end = SDIO_PHYS_BASE + SZ_1K - 1,
386 .flags = IORESOURCE_MEM,
387 },
388 [1] = {
389 .start = IRQ_KIRKWOOD_SDIO,
390 .end = IRQ_KIRKWOOD_SDIO,
391 .flags = IORESOURCE_IRQ,
392 },
393};
394
Andrew Lunn5c602552011-05-15 13:32:40 +0200395static u64 mvsdio_dmamask = DMA_BIT_MASK(32);
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500396
397static struct platform_device kirkwood_sdio = {
398 .name = "mvsdio",
399 .id = -1,
400 .dev = {
401 .dma_mask = &mvsdio_dmamask,
Andrew Lunn5c602552011-05-15 13:32:40 +0200402 .coherent_dma_mask = DMA_BIT_MASK(32),
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500403 },
404 .num_resources = ARRAY_SIZE(mvsdio_resources),
405 .resource = mvsdio_resources,
406};
407
408void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
409{
410 u32 dev, rev;
411
412 kirkwood_pcie_id(&dev, &rev);
Saeed Bishara1e4d2d32010-06-01 18:09:27 +0300413 if (rev == 0 && dev != MV88F6282_DEV_ID) /* catch all Kirkwood Z0's */
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500414 mvsdio_data->clock = 100000000;
415 else
416 mvsdio_data->clock = 200000000;
417 mvsdio_data->dram = &kirkwood_mbus_dram_info;
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200418 kirkwood_clk_ctrl |= CGC_SDIO;
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500419 kirkwood_sdio.dev.platform_data = mvsdio_data;
420 platform_device_register(&kirkwood_sdio);
421}
422
423
424/*****************************************************************************
Lennert Buytenhek18365d12008-08-09 15:38:18 +0200425 * SPI
426 ****************************************************************************/
427static struct orion_spi_info kirkwood_spi_plat_data = {
Lennert Buytenhek18365d12008-08-09 15:38:18 +0200428};
429
430static struct resource kirkwood_spi_resources[] = {
431 {
432 .start = SPI_PHYS_BASE,
433 .end = SPI_PHYS_BASE + SZ_512 - 1,
434 .flags = IORESOURCE_MEM,
435 },
436};
437
438static struct platform_device kirkwood_spi = {
439 .name = "orion_spi",
440 .id = 0,
441 .resource = kirkwood_spi_resources,
442 .dev = {
443 .platform_data = &kirkwood_spi_plat_data,
444 },
445 .num_resources = ARRAY_SIZE(kirkwood_spi_resources),
446};
447
448void __init kirkwood_spi_init()
449{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200450 kirkwood_clk_ctrl |= CGC_RUNIT;
Lennert Buytenhek18365d12008-08-09 15:38:18 +0200451 platform_device_register(&kirkwood_spi);
452}
453
454
455/*****************************************************************************
Martin Michlmayr6574e002009-03-23 19:13:21 +0100456 * I2C
457 ****************************************************************************/
458static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = {
459 .freq_m = 8, /* assumes 166 MHz TCLK */
460 .freq_n = 3,
461 .timeout = 1000, /* Default timeout of 1 second */
462};
463
464static struct resource kirkwood_i2c_resources[] = {
465 {
Martin Michlmayr6574e002009-03-23 19:13:21 +0100466 .start = I2C_PHYS_BASE,
467 .end = I2C_PHYS_BASE + 0x1f,
468 .flags = IORESOURCE_MEM,
469 }, {
Martin Michlmayr6574e002009-03-23 19:13:21 +0100470 .start = IRQ_KIRKWOOD_TWSI,
471 .end = IRQ_KIRKWOOD_TWSI,
472 .flags = IORESOURCE_IRQ,
473 },
474};
475
476static struct platform_device kirkwood_i2c = {
477 .name = MV64XXX_I2C_CTLR_NAME,
478 .id = 0,
479 .num_resources = ARRAY_SIZE(kirkwood_i2c_resources),
480 .resource = kirkwood_i2c_resources,
481 .dev = {
482 .platform_data = &kirkwood_i2c_pdata,
483 },
484};
485
486void __init kirkwood_i2c_init(void)
487{
488 platform_device_register(&kirkwood_i2c);
489}
490
491
492/*****************************************************************************
Saeed Bishara651c74c2008-06-22 22:45:06 +0200493 * UART0
494 ****************************************************************************/
Saeed Bishara651c74c2008-06-22 22:45:06 +0200495
496void __init kirkwood_uart0_init(void)
497{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200498 orion_uart0_init(UART0_VIRT_BASE, UART0_PHYS_BASE,
499 IRQ_KIRKWOOD_UART_0, kirkwood_tclk);
Saeed Bishara651c74c2008-06-22 22:45:06 +0200500}
501
502
503/*****************************************************************************
504 * UART1
505 ****************************************************************************/
Saeed Bishara651c74c2008-06-22 22:45:06 +0200506void __init kirkwood_uart1_init(void)
507{
Andrew Lunn28a2b452011-05-15 13:32:41 +0200508 orion_uart1_init(UART1_VIRT_BASE, UART1_PHYS_BASE,
509 IRQ_KIRKWOOD_UART_1, kirkwood_tclk);
Saeed Bishara651c74c2008-06-22 22:45:06 +0200510}
511
Saeed Bishara651c74c2008-06-22 22:45:06 +0200512/*****************************************************************************
Nicolas Pitreae5c8c82009-06-03 15:24:36 -0400513 * Cryptographic Engines and Security Accelerator (CESA)
514 ****************************************************************************/
515
516static struct resource kirkwood_crypto_res[] = {
517 {
518 .name = "regs",
519 .start = CRYPTO_PHYS_BASE,
520 .end = CRYPTO_PHYS_BASE + 0xffff,
521 .flags = IORESOURCE_MEM,
522 }, {
523 .name = "sram",
524 .start = KIRKWOOD_SRAM_PHYS_BASE,
525 .end = KIRKWOOD_SRAM_PHYS_BASE + KIRKWOOD_SRAM_SIZE - 1,
526 .flags = IORESOURCE_MEM,
527 }, {
528 .name = "crypto interrupt",
529 .start = IRQ_KIRKWOOD_CRYPTO,
530 .end = IRQ_KIRKWOOD_CRYPTO,
531 .flags = IORESOURCE_IRQ,
532 },
533};
534
535static struct platform_device kirkwood_crypto_device = {
536 .name = "mv_crypto",
537 .id = -1,
538 .num_resources = ARRAY_SIZE(kirkwood_crypto_res),
539 .resource = kirkwood_crypto_res,
540};
541
542void __init kirkwood_crypto_init(void)
543{
544 kirkwood_clk_ctrl |= CGC_CRYPTO;
545 platform_device_register(&kirkwood_crypto_device);
546}
547
548
549/*****************************************************************************
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100550 * XOR
551 ****************************************************************************/
552static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = {
553 .dram = &kirkwood_mbus_dram_info,
554};
555
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100556
557/*****************************************************************************
558 * XOR0
559 ****************************************************************************/
560static struct resource kirkwood_xor0_shared_resources[] = {
561 {
562 .name = "xor 0 low",
563 .start = XOR0_PHYS_BASE,
564 .end = XOR0_PHYS_BASE + 0xff,
565 .flags = IORESOURCE_MEM,
566 }, {
567 .name = "xor 0 high",
568 .start = XOR0_HIGH_PHYS_BASE,
569 .end = XOR0_HIGH_PHYS_BASE + 0xff,
570 .flags = IORESOURCE_MEM,
571 },
572};
573
574static struct platform_device kirkwood_xor0_shared = {
575 .name = MV_XOR_SHARED_NAME,
576 .id = 0,
577 .dev = {
578 .platform_data = &kirkwood_xor_shared_data,
579 },
580 .num_resources = ARRAY_SIZE(kirkwood_xor0_shared_resources),
581 .resource = kirkwood_xor0_shared_resources,
582};
583
Andrew Lunn5c602552011-05-15 13:32:40 +0200584static u64 kirkwood_xor_dmamask = DMA_BIT_MASK(32);
585
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100586static struct resource kirkwood_xor00_resources[] = {
587 [0] = {
588 .start = IRQ_KIRKWOOD_XOR_00,
589 .end = IRQ_KIRKWOOD_XOR_00,
590 .flags = IORESOURCE_IRQ,
591 },
592};
593
594static struct mv_xor_platform_data kirkwood_xor00_data = {
595 .shared = &kirkwood_xor0_shared,
596 .hw_id = 0,
597 .pool_size = PAGE_SIZE,
598};
599
600static struct platform_device kirkwood_xor00_channel = {
601 .name = MV_XOR_NAME,
602 .id = 0,
603 .num_resources = ARRAY_SIZE(kirkwood_xor00_resources),
604 .resource = kirkwood_xor00_resources,
605 .dev = {
606 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700607 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800608 .platform_data = &kirkwood_xor00_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100609 },
610};
611
612static struct resource kirkwood_xor01_resources[] = {
613 [0] = {
614 .start = IRQ_KIRKWOOD_XOR_01,
615 .end = IRQ_KIRKWOOD_XOR_01,
616 .flags = IORESOURCE_IRQ,
617 },
618};
619
620static struct mv_xor_platform_data kirkwood_xor01_data = {
621 .shared = &kirkwood_xor0_shared,
622 .hw_id = 1,
623 .pool_size = PAGE_SIZE,
624};
625
626static struct platform_device kirkwood_xor01_channel = {
627 .name = MV_XOR_NAME,
628 .id = 1,
629 .num_resources = ARRAY_SIZE(kirkwood_xor01_resources),
630 .resource = kirkwood_xor01_resources,
631 .dev = {
632 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700633 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800634 .platform_data = &kirkwood_xor01_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100635 },
636};
637
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500638static void __init kirkwood_xor0_init(void)
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100639{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200640 kirkwood_clk_ctrl |= CGC_XOR0;
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100641 platform_device_register(&kirkwood_xor0_shared);
642
643 /*
644 * two engines can't do memset simultaneously, this limitation
645 * satisfied by removing memset support from one of the engines.
646 */
647 dma_cap_set(DMA_MEMCPY, kirkwood_xor00_data.cap_mask);
648 dma_cap_set(DMA_XOR, kirkwood_xor00_data.cap_mask);
649 platform_device_register(&kirkwood_xor00_channel);
650
651 dma_cap_set(DMA_MEMCPY, kirkwood_xor01_data.cap_mask);
652 dma_cap_set(DMA_MEMSET, kirkwood_xor01_data.cap_mask);
653 dma_cap_set(DMA_XOR, kirkwood_xor01_data.cap_mask);
654 platform_device_register(&kirkwood_xor01_channel);
655}
656
657
658/*****************************************************************************
659 * XOR1
660 ****************************************************************************/
661static struct resource kirkwood_xor1_shared_resources[] = {
662 {
663 .name = "xor 1 low",
664 .start = XOR1_PHYS_BASE,
665 .end = XOR1_PHYS_BASE + 0xff,
666 .flags = IORESOURCE_MEM,
667 }, {
668 .name = "xor 1 high",
669 .start = XOR1_HIGH_PHYS_BASE,
670 .end = XOR1_HIGH_PHYS_BASE + 0xff,
671 .flags = IORESOURCE_MEM,
672 },
673};
674
675static struct platform_device kirkwood_xor1_shared = {
676 .name = MV_XOR_SHARED_NAME,
677 .id = 1,
678 .dev = {
679 .platform_data = &kirkwood_xor_shared_data,
680 },
681 .num_resources = ARRAY_SIZE(kirkwood_xor1_shared_resources),
682 .resource = kirkwood_xor1_shared_resources,
683};
684
685static struct resource kirkwood_xor10_resources[] = {
686 [0] = {
687 .start = IRQ_KIRKWOOD_XOR_10,
688 .end = IRQ_KIRKWOOD_XOR_10,
689 .flags = IORESOURCE_IRQ,
690 },
691};
692
693static struct mv_xor_platform_data kirkwood_xor10_data = {
694 .shared = &kirkwood_xor1_shared,
695 .hw_id = 0,
696 .pool_size = PAGE_SIZE,
697};
698
699static struct platform_device kirkwood_xor10_channel = {
700 .name = MV_XOR_NAME,
701 .id = 2,
702 .num_resources = ARRAY_SIZE(kirkwood_xor10_resources),
703 .resource = kirkwood_xor10_resources,
704 .dev = {
705 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700706 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800707 .platform_data = &kirkwood_xor10_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100708 },
709};
710
711static struct resource kirkwood_xor11_resources[] = {
712 [0] = {
713 .start = IRQ_KIRKWOOD_XOR_11,
714 .end = IRQ_KIRKWOOD_XOR_11,
715 .flags = IORESOURCE_IRQ,
716 },
717};
718
719static struct mv_xor_platform_data kirkwood_xor11_data = {
720 .shared = &kirkwood_xor1_shared,
721 .hw_id = 1,
722 .pool_size = PAGE_SIZE,
723};
724
725static struct platform_device kirkwood_xor11_channel = {
726 .name = MV_XOR_NAME,
727 .id = 3,
728 .num_resources = ARRAY_SIZE(kirkwood_xor11_resources),
729 .resource = kirkwood_xor11_resources,
730 .dev = {
731 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700732 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800733 .platform_data = &kirkwood_xor11_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100734 },
735};
736
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500737static void __init kirkwood_xor1_init(void)
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100738{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200739 kirkwood_clk_ctrl |= CGC_XOR1;
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100740 platform_device_register(&kirkwood_xor1_shared);
741
742 /*
743 * two engines can't do memset simultaneously, this limitation
744 * satisfied by removing memset support from one of the engines.
745 */
746 dma_cap_set(DMA_MEMCPY, kirkwood_xor10_data.cap_mask);
747 dma_cap_set(DMA_XOR, kirkwood_xor10_data.cap_mask);
748 platform_device_register(&kirkwood_xor10_channel);
749
750 dma_cap_set(DMA_MEMCPY, kirkwood_xor11_data.cap_mask);
751 dma_cap_set(DMA_MEMSET, kirkwood_xor11_data.cap_mask);
752 dma_cap_set(DMA_XOR, kirkwood_xor11_data.cap_mask);
753 platform_device_register(&kirkwood_xor11_channel);
754}
755
756
757/*****************************************************************************
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200758 * Watchdog
759 ****************************************************************************/
Nicolas Pitre3b937a72009-06-01 13:56:02 -0400760static struct orion_wdt_platform_data kirkwood_wdt_data = {
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200761 .tclk = 0,
762};
763
764static struct platform_device kirkwood_wdt_device = {
Nicolas Pitre3b937a72009-06-01 13:56:02 -0400765 .name = "orion_wdt",
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200766 .id = -1,
767 .dev = {
768 .platform_data = &kirkwood_wdt_data,
769 },
770 .num_resources = 0,
771};
772
773static void __init kirkwood_wdt_init(void)
774{
775 kirkwood_wdt_data.tclk = kirkwood_tclk;
776 platform_device_register(&kirkwood_wdt_device);
777}
778
779
780/*****************************************************************************
Saeed Bishara651c74c2008-06-22 22:45:06 +0200781 * Time handling
782 ****************************************************************************/
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200783void __init kirkwood_init_early(void)
784{
785 orion_time_set_base(TIMER_VIRT_BASE);
786}
787
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200788int kirkwood_tclk;
789
Nicolas Pitre9b8ebfe2011-03-03 15:08:53 -0500790static int __init kirkwood_find_tclk(void)
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200791{
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300792 u32 dev, rev;
793
794 kirkwood_pcie_id(&dev, &rev);
Saeed Bishara1e4d2d32010-06-01 18:09:27 +0300795
Simon Guinot2fa0f932010-10-21 11:42:28 +0200796 if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
797 if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
798 return 200000000;
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300799
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200800 return 166666667;
801}
802
Li Jie6de95c12009-11-05 07:29:54 -0800803static void __init kirkwood_timer_init(void)
Saeed Bishara651c74c2008-06-22 22:45:06 +0200804{
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200805 kirkwood_tclk = kirkwood_find_tclk();
Lennert Buytenhek4ee1f6b2010-10-15 16:50:26 +0200806
807 orion_time_init(BRIDGE_VIRT_BASE, BRIDGE_INT_TIMER1_CLR,
808 IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
Saeed Bishara651c74c2008-06-22 22:45:06 +0200809}
810
811struct sys_timer kirkwood_timer = {
812 .init = kirkwood_timer_init,
813};
814
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200815/*****************************************************************************
816 * Audio
817 ****************************************************************************/
818static struct resource kirkwood_i2s_resources[] = {
819 [0] = {
820 .start = AUDIO_PHYS_BASE,
821 .end = AUDIO_PHYS_BASE + SZ_16K - 1,
822 .flags = IORESOURCE_MEM,
823 },
824 [1] = {
825 .start = IRQ_KIRKWOOD_I2S,
826 .end = IRQ_KIRKWOOD_I2S,
827 .flags = IORESOURCE_IRQ,
828 },
829};
830
831static struct kirkwood_asoc_platform_data kirkwood_i2s_data = {
832 .dram = &kirkwood_mbus_dram_info,
833 .burst = 128,
834};
835
836static struct platform_device kirkwood_i2s_device = {
837 .name = "kirkwood-i2s",
838 .id = -1,
839 .num_resources = ARRAY_SIZE(kirkwood_i2s_resources),
840 .resource = kirkwood_i2s_resources,
841 .dev = {
842 .platform_data = &kirkwood_i2s_data,
843 },
844};
845
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000846static struct platform_device kirkwood_pcm_device = {
Arnaud Patard (Rtp)c88e7b92010-08-30 16:00:05 +0200847 .name = "kirkwood-pcm-audio",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000848 .id = -1,
849};
850
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200851void __init kirkwood_audio_init(void)
852{
853 kirkwood_clk_ctrl |= CGC_AUDIO;
854 platform_device_register(&kirkwood_i2s_device);
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000855 platform_device_register(&kirkwood_pcm_device);
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200856}
Saeed Bishara651c74c2008-06-22 22:45:06 +0200857
858/*****************************************************************************
859 * General
860 ****************************************************************************/
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300861/*
862 * Identify device ID and revision.
863 */
Saeed Bishara651c74c2008-06-22 22:45:06 +0200864static char * __init kirkwood_id(void)
865{
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300866 u32 dev, rev;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200867
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300868 kirkwood_pcie_id(&dev, &rev);
869
870 if (dev == MV88F6281_DEV_ID) {
871 if (rev == MV88F6281_REV_Z0)
872 return "MV88F6281-Z0";
873 else if (rev == MV88F6281_REV_A0)
874 return "MV88F6281-A0";
Siddarth Goreaec1bad2009-06-09 14:41:02 +0530875 else if (rev == MV88F6281_REV_A1)
876 return "MV88F6281-A1";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300877 else
878 return "MV88F6281-Rev-Unsupported";
879 } else if (dev == MV88F6192_DEV_ID) {
880 if (rev == MV88F6192_REV_Z0)
881 return "MV88F6192-Z0";
882 else if (rev == MV88F6192_REV_A0)
883 return "MV88F6192-A0";
Saeed Bishara1c2003a2010-06-01 18:09:26 +0300884 else if (rev == MV88F6192_REV_A1)
885 return "MV88F6192-A1";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300886 else
887 return "MV88F6192-Rev-Unsupported";
888 } else if (dev == MV88F6180_DEV_ID) {
889 if (rev == MV88F6180_REV_A0)
890 return "MV88F6180-Rev-A0";
Saeed Bishara1c2003a2010-06-01 18:09:26 +0300891 else if (rev == MV88F6180_REV_A1)
892 return "MV88F6180-Rev-A1";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300893 else
894 return "MV88F6180-Rev-Unsupported";
Saeed Bishara1e4d2d32010-06-01 18:09:27 +0300895 } else if (dev == MV88F6282_DEV_ID) {
896 if (rev == MV88F6282_REV_A0)
897 return "MV88F6282-Rev-A0";
898 else
899 return "MV88F6282-Rev-Unsupported";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300900 } else {
901 return "Device-Unknown";
902 }
Saeed Bishara651c74c2008-06-22 22:45:06 +0200903}
904
Ronen Shitrit4360bb42008-09-23 15:28:10 +0300905static void __init kirkwood_l2_init(void)
Saeed Bishara13387602008-06-23 01:05:08 -1100906{
Ronen Shitrit4360bb42008-09-23 15:28:10 +0300907#ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
908 writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
909 feroceon_l2_init(1);
910#else
911 writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
912 feroceon_l2_init(0);
913#endif
Saeed Bishara13387602008-06-23 01:05:08 -1100914}
915
Saeed Bishara651c74c2008-06-22 22:45:06 +0200916void __init kirkwood_init(void)
917{
918 printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200919 kirkwood_id(), kirkwood_tclk);
920 kirkwood_ge00_shared_data.t_clk = kirkwood_tclk;
Nicolas Pitre13731d12009-01-06 23:02:08 +0100921 kirkwood_ge01_shared_data.t_clk = kirkwood_tclk;
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200922 kirkwood_spi_plat_data.tclk = kirkwood_tclk;
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200923 kirkwood_i2s_data.tclk = kirkwood_tclk;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200924
Lennert Buytenhek2bf30102009-11-12 20:31:14 +0100925 /*
926 * Disable propagation of mbus errors to the CPU local bus,
927 * as this causes mbus errors (which can occur for example
928 * for PCI aborts) to throw CPU aborts, which we're not set
929 * up to deal with.
930 */
931 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
932
Saeed Bishara651c74c2008-06-22 22:45:06 +0200933 kirkwood_setup_cpu_mbus();
934
935#ifdef CONFIG_CACHE_FEROCEON_L2
Ronen Shitrit4360bb42008-09-23 15:28:10 +0300936 kirkwood_l2_init();
Saeed Bishara651c74c2008-06-22 22:45:06 +0200937#endif
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500938
939 /* internal devices that every board has */
940 kirkwood_rtc_init();
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200941 kirkwood_wdt_init();
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500942 kirkwood_xor0_init();
943 kirkwood_xor1_init();
Nicolas Pitreae5c8c82009-06-03 15:24:36 -0400944 kirkwood_crypto_init();
Eric Cooper9c153642011-02-02 17:16:11 -0500945
946#ifdef CONFIG_KEXEC
947 kexec_reinit = kirkwood_enable_pcie;
948#endif
Saeed Bishara651c74c2008-06-22 22:45:06 +0200949}
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200950
951static int __init kirkwood_clock_gate(void)
952{
953 unsigned int curr = readl(CLOCK_GATING_CTRL);
Saeed Bisharaffd58bd2010-06-08 14:21:34 +0300954 u32 dev, rev;
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200955
Saeed Bisharaffd58bd2010-06-08 14:21:34 +0300956 kirkwood_pcie_id(&dev, &rev);
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200957 printk(KERN_DEBUG "Gating clock of unused units\n");
958 printk(KERN_DEBUG "before: 0x%08x\n", curr);
959
960 /* Make sure those units are accessible */
Saeed Bisharaffd58bd2010-06-08 14:21:34 +0300961 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200962
963 /* For SATA: first shutdown the phy */
964 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
965 /* Disable PLL and IVREF */
966 writel(readl(SATA0_PHY_MODE_2) & ~0xf, SATA0_PHY_MODE_2);
967 /* Disable PHY */
968 writel(readl(SATA0_IF_CTRL) | 0x200, SATA0_IF_CTRL);
969 }
970 if (!(kirkwood_clk_ctrl & CGC_SATA1)) {
971 /* Disable PLL and IVREF */
972 writel(readl(SATA1_PHY_MODE_2) & ~0xf, SATA1_PHY_MODE_2);
973 /* Disable PHY */
974 writel(readl(SATA1_IF_CTRL) | 0x200, SATA1_IF_CTRL);
975 }
976
977 /* For PCIe: first shutdown the phy */
978 if (!(kirkwood_clk_ctrl & CGC_PEX0)) {
979 writel(readl(PCIE_LINK_CTRL) | 0x10, PCIE_LINK_CTRL);
980 while (1)
981 if (readl(PCIE_STATUS) & 0x1)
982 break;
983 writel(readl(PCIE_LINK_CTRL) & ~0x10, PCIE_LINK_CTRL);
984 }
985
Saeed Bisharaffd58bd2010-06-08 14:21:34 +0300986 /* For PCIe 1: first shutdown the phy */
987 if (dev == MV88F6282_DEV_ID) {
988 if (!(kirkwood_clk_ctrl & CGC_PEX1)) {
989 writel(readl(PCIE1_LINK_CTRL) | 0x10, PCIE1_LINK_CTRL);
990 while (1)
991 if (readl(PCIE1_STATUS) & 0x1)
992 break;
993 writel(readl(PCIE1_LINK_CTRL) & ~0x10, PCIE1_LINK_CTRL);
994 }
995 } else /* keep this bit set for devices that don't have PCIe1 */
996 kirkwood_clk_ctrl |= CGC_PEX1;
997
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200998 /* Now gate clock the required units */
999 writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
1000 printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
1001
1002 return 0;
1003}
1004late_initcall(kirkwood_clock_gate);