blob: 51ff23b72d3a3e8d6982b031dd36df0c3c1cc711 [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>
24#include <asm/mach/map.h>
25#include <asm/mach/time.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010026#include <mach/kirkwood.h>
Nicolas Pitrefdd8b072009-04-22 20:08:17 +010027#include <mach/bridge-regs.h>
apatard@mandriva.com49106c72010-05-31 13:49:12 +020028#include <plat/audio.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020029#include <plat/cache-feroceon-l2.h>
30#include <plat/ehci-orion.h>
Nicolas Pitre8235ee02009-02-14 03:15:55 -050031#include <plat/mvsdio.h>
Saeed Bishara09c0ed22008-06-23 04:26:07 -110032#include <plat/mv_xor.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020033#include <plat/orion_nand.h>
Nicolas Pitre3b937a72009-06-01 13:56:02 -040034#include <plat/orion_wdt.h>
Lennert Buytenhek6f088f12008-08-09 13:44:58 +020035#include <plat/time.h>
Saeed Bishara651c74c2008-06-22 22:45:06 +020036#include "common.h"
37
38/*****************************************************************************
39 * I/O Address Mapping
40 ****************************************************************************/
41static struct map_desc kirkwood_io_desc[] __initdata = {
42 {
43 .virtual = KIRKWOOD_PCIE_IO_VIRT_BASE,
44 .pfn = __phys_to_pfn(KIRKWOOD_PCIE_IO_PHYS_BASE),
45 .length = KIRKWOOD_PCIE_IO_SIZE,
46 .type = MT_DEVICE,
47 }, {
Saeed Bisharaffd58bd2010-06-08 14:21:34 +030048 .virtual = KIRKWOOD_PCIE1_IO_VIRT_BASE,
49 .pfn = __phys_to_pfn(KIRKWOOD_PCIE1_IO_PHYS_BASE),
50 .length = KIRKWOOD_PCIE1_IO_SIZE,
51 .type = MT_DEVICE,
52 }, {
Saeed Bishara651c74c2008-06-22 22:45:06 +020053 .virtual = KIRKWOOD_REGS_VIRT_BASE,
54 .pfn = __phys_to_pfn(KIRKWOOD_REGS_PHYS_BASE),
55 .length = KIRKWOOD_REGS_SIZE,
56 .type = MT_DEVICE,
57 },
58};
59
60void __init kirkwood_map_io(void)
61{
62 iotable_init(kirkwood_io_desc, ARRAY_SIZE(kirkwood_io_desc));
63}
64
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +020065/*
66 * Default clock control bits. Any bit _not_ set in this variable
67 * will be cleared from the hardware after platform devices have been
68 * registered. Some reserved bits must be set to 1.
69 */
70unsigned int kirkwood_clk_ctrl = CGC_DUNIT | CGC_RESERVED;
71
Saeed Bishara651c74c2008-06-22 22:45:06 +020072
73/*****************************************************************************
74 * EHCI
75 ****************************************************************************/
76static struct orion_ehci_data kirkwood_ehci_data = {
77 .dram = &kirkwood_mbus_dram_info,
Ronen Shitritfb6f5522008-09-17 10:08:05 +030078 .phy_version = EHCI_PHY_NA,
Saeed Bishara651c74c2008-06-22 22:45:06 +020079};
80
81static u64 ehci_dmamask = 0xffffffffUL;
82
83
84/*****************************************************************************
85 * EHCI0
86 ****************************************************************************/
87static struct resource kirkwood_ehci_resources[] = {
88 {
89 .start = USB_PHYS_BASE,
90 .end = USB_PHYS_BASE + 0x0fff,
91 .flags = IORESOURCE_MEM,
92 }, {
93 .start = IRQ_KIRKWOOD_USB,
94 .end = IRQ_KIRKWOOD_USB,
95 .flags = IORESOURCE_IRQ,
96 },
97};
98
99static struct platform_device kirkwood_ehci = {
100 .name = "orion-ehci",
101 .id = 0,
102 .dev = {
103 .dma_mask = &ehci_dmamask,
104 .coherent_dma_mask = 0xffffffff,
105 .platform_data = &kirkwood_ehci_data,
106 },
107 .resource = kirkwood_ehci_resources,
108 .num_resources = ARRAY_SIZE(kirkwood_ehci_resources),
109};
110
111void __init kirkwood_ehci_init(void)
112{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200113 kirkwood_clk_ctrl |= CGC_USB0;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200114 platform_device_register(&kirkwood_ehci);
115}
116
117
118/*****************************************************************************
119 * GE00
120 ****************************************************************************/
121struct mv643xx_eth_shared_platform_data kirkwood_ge00_shared_data = {
Saeed Bishara651c74c2008-06-22 22:45:06 +0200122 .dram = &kirkwood_mbus_dram_info,
123};
124
125static struct resource kirkwood_ge00_shared_resources[] = {
126 {
127 .name = "ge00 base",
128 .start = GE00_PHYS_BASE + 0x2000,
129 .end = GE00_PHYS_BASE + 0x3fff,
130 .flags = IORESOURCE_MEM,
Lennert Buytenhek144f8142008-08-26 16:04:05 +0200131 }, {
132 .name = "ge00 err irq",
133 .start = IRQ_KIRKWOOD_GE00_ERR,
134 .end = IRQ_KIRKWOOD_GE00_ERR,
135 .flags = IORESOURCE_IRQ,
Saeed Bishara651c74c2008-06-22 22:45:06 +0200136 },
137};
138
139static struct platform_device kirkwood_ge00_shared = {
140 .name = MV643XX_ETH_SHARED_NAME,
141 .id = 0,
142 .dev = {
143 .platform_data = &kirkwood_ge00_shared_data,
144 },
Lennert Buytenhek144f8142008-08-26 16:04:05 +0200145 .num_resources = ARRAY_SIZE(kirkwood_ge00_shared_resources),
Saeed Bishara651c74c2008-06-22 22:45:06 +0200146 .resource = kirkwood_ge00_shared_resources,
147};
148
149static struct resource kirkwood_ge00_resources[] = {
150 {
151 .name = "ge00 irq",
152 .start = IRQ_KIRKWOOD_GE00_SUM,
153 .end = IRQ_KIRKWOOD_GE00_SUM,
154 .flags = IORESOURCE_IRQ,
155 },
156};
157
158static struct platform_device kirkwood_ge00 = {
159 .name = MV643XX_ETH_NAME,
160 .id = 0,
161 .num_resources = 1,
162 .resource = kirkwood_ge00_resources,
Nicolas Pitrea49a0182009-05-22 16:53:40 -0400163 .dev = {
164 .coherent_dma_mask = 0xffffffff,
165 },
Saeed Bishara651c74c2008-06-22 22:45:06 +0200166};
167
168void __init kirkwood_ge00_init(struct mv643xx_eth_platform_data *eth_data)
169{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200170 kirkwood_clk_ctrl |= CGC_GE0;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200171 eth_data->shared = &kirkwood_ge00_shared;
172 kirkwood_ge00.dev.platform_data = eth_data;
173
174 platform_device_register(&kirkwood_ge00_shared);
175 platform_device_register(&kirkwood_ge00);
176}
177
178
179/*****************************************************************************
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200180 * GE01
181 ****************************************************************************/
182struct mv643xx_eth_shared_platform_data kirkwood_ge01_shared_data = {
183 .dram = &kirkwood_mbus_dram_info,
184 .shared_smi = &kirkwood_ge00_shared,
185};
186
187static struct resource kirkwood_ge01_shared_resources[] = {
188 {
189 .name = "ge01 base",
190 .start = GE01_PHYS_BASE + 0x2000,
191 .end = GE01_PHYS_BASE + 0x3fff,
192 .flags = IORESOURCE_MEM,
193 }, {
194 .name = "ge01 err irq",
195 .start = IRQ_KIRKWOOD_GE01_ERR,
196 .end = IRQ_KIRKWOOD_GE01_ERR,
197 .flags = IORESOURCE_IRQ,
198 },
199};
200
201static struct platform_device kirkwood_ge01_shared = {
202 .name = MV643XX_ETH_SHARED_NAME,
203 .id = 1,
204 .dev = {
205 .platform_data = &kirkwood_ge01_shared_data,
206 },
207 .num_resources = ARRAY_SIZE(kirkwood_ge01_shared_resources),
208 .resource = kirkwood_ge01_shared_resources,
209};
210
211static struct resource kirkwood_ge01_resources[] = {
212 {
213 .name = "ge01 irq",
214 .start = IRQ_KIRKWOOD_GE01_SUM,
215 .end = IRQ_KIRKWOOD_GE01_SUM,
216 .flags = IORESOURCE_IRQ,
217 },
218};
219
220static struct platform_device kirkwood_ge01 = {
221 .name = MV643XX_ETH_NAME,
222 .id = 1,
223 .num_resources = 1,
224 .resource = kirkwood_ge01_resources,
Nicolas Pitrea49a0182009-05-22 16:53:40 -0400225 .dev = {
226 .coherent_dma_mask = 0xffffffff,
227 },
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200228};
229
230void __init kirkwood_ge01_init(struct mv643xx_eth_platform_data *eth_data)
231{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200232 kirkwood_clk_ctrl |= CGC_GE1;
Ronen Shitritd15fb9e2008-10-19 23:10:14 +0200233 eth_data->shared = &kirkwood_ge01_shared;
234 kirkwood_ge01.dev.platform_data = eth_data;
235
236 platform_device_register(&kirkwood_ge01_shared);
237 platform_device_register(&kirkwood_ge01);
238}
239
240
241/*****************************************************************************
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200242 * Ethernet switch
243 ****************************************************************************/
244static struct resource kirkwood_switch_resources[] = {
245 {
246 .start = 0,
247 .end = 0,
248 .flags = IORESOURCE_IRQ,
249 },
250};
251
252static struct platform_device kirkwood_switch_device = {
253 .name = "dsa",
254 .id = 0,
255 .num_resources = 0,
256 .resource = kirkwood_switch_resources,
257};
258
259void __init kirkwood_ge00_switch_init(struct dsa_platform_data *d, int irq)
260{
Lennert Buytenheke84665c2009-03-20 09:52:09 +0000261 int i;
262
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200263 if (irq != NO_IRQ) {
264 kirkwood_switch_resources[0].start = irq;
265 kirkwood_switch_resources[0].end = irq;
266 kirkwood_switch_device.num_resources = 1;
267 }
268
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200269 d->netdev = &kirkwood_ge00.dev;
Lennert Buytenheke84665c2009-03-20 09:52:09 +0000270 for (i = 0; i < d->nr_chips; i++)
271 d->chip[i].mii_bus = &kirkwood_ge00_shared.dev;
Lennert Buytenhekdcf1cec2008-09-25 16:23:48 +0200272 kirkwood_switch_device.dev.platform_data = d;
273
274 platform_device_register(&kirkwood_switch_device);
275}
276
277
278/*****************************************************************************
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -0400279 * NAND flash
280 ****************************************************************************/
281static struct resource kirkwood_nand_resource = {
282 .flags = IORESOURCE_MEM,
283 .start = KIRKWOOD_NAND_MEM_PHYS_BASE,
284 .end = KIRKWOOD_NAND_MEM_PHYS_BASE +
285 KIRKWOOD_NAND_MEM_SIZE - 1,
286};
287
288static struct orion_nand_data kirkwood_nand_data = {
289 .cle = 0,
290 .ale = 1,
291 .width = 8,
292};
293
294static struct platform_device kirkwood_nand_flash = {
295 .name = "orion_nand",
296 .id = -1,
297 .dev = {
298 .platform_data = &kirkwood_nand_data,
299 },
300 .resource = &kirkwood_nand_resource,
301 .num_resources = 1,
302};
303
304void __init kirkwood_nand_init(struct mtd_partition *parts, int nr_parts,
305 int chip_delay)
306{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200307 kirkwood_clk_ctrl |= CGC_RUNIT;
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -0400308 kirkwood_nand_data.parts = parts;
309 kirkwood_nand_data.nr_parts = nr_parts;
310 kirkwood_nand_data.chip_delay = chip_delay;
311 platform_device_register(&kirkwood_nand_flash);
312}
313
Ben Dooks010937e2010-04-20 10:26:19 +0100314void __init kirkwood_nand_init_rnb(struct mtd_partition *parts, int nr_parts,
315 int (*dev_ready)(struct mtd_info *))
316{
317 kirkwood_clk_ctrl |= CGC_RUNIT;
318 kirkwood_nand_data.parts = parts;
319 kirkwood_nand_data.nr_parts = nr_parts;
320 kirkwood_nand_data.dev_ready = dev_ready;
321 platform_device_register(&kirkwood_nand_flash);
322}
Nicolas Pitrefb7b2d32009-06-01 15:36:36 -0400323
324/*****************************************************************************
Saeed Bishara651c74c2008-06-22 22:45:06 +0200325 * SoC RTC
326 ****************************************************************************/
327static struct resource kirkwood_rtc_resource = {
328 .start = RTC_PHYS_BASE,
329 .end = RTC_PHYS_BASE + SZ_16 - 1,
330 .flags = IORESOURCE_MEM,
331};
332
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500333static void __init kirkwood_rtc_init(void)
Saeed Bishara651c74c2008-06-22 22:45:06 +0200334{
335 platform_device_register_simple("rtc-mv", -1, &kirkwood_rtc_resource, 1);
336}
337
338
339/*****************************************************************************
340 * SATA
341 ****************************************************************************/
342static struct resource kirkwood_sata_resources[] = {
343 {
344 .name = "sata base",
345 .start = SATA_PHYS_BASE,
346 .end = SATA_PHYS_BASE + 0x5000 - 1,
347 .flags = IORESOURCE_MEM,
348 }, {
349 .name = "sata irq",
350 .start = IRQ_KIRKWOOD_SATA,
351 .end = IRQ_KIRKWOOD_SATA,
352 .flags = IORESOURCE_IRQ,
353 },
354};
355
356static struct platform_device kirkwood_sata = {
357 .name = "sata_mv",
358 .id = 0,
359 .dev = {
360 .coherent_dma_mask = 0xffffffff,
361 },
362 .num_resources = ARRAY_SIZE(kirkwood_sata_resources),
363 .resource = kirkwood_sata_resources,
364};
365
366void __init kirkwood_sata_init(struct mv_sata_platform_data *sata_data)
367{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200368 kirkwood_clk_ctrl |= CGC_SATA0;
369 if (sata_data->n_ports > 1)
370 kirkwood_clk_ctrl |= CGC_SATA1;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200371 sata_data->dram = &kirkwood_mbus_dram_info;
372 kirkwood_sata.dev.platform_data = sata_data;
373 platform_device_register(&kirkwood_sata);
374}
375
376
377/*****************************************************************************
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500378 * SD/SDIO/MMC
379 ****************************************************************************/
380static struct resource mvsdio_resources[] = {
381 [0] = {
382 .start = SDIO_PHYS_BASE,
383 .end = SDIO_PHYS_BASE + SZ_1K - 1,
384 .flags = IORESOURCE_MEM,
385 },
386 [1] = {
387 .start = IRQ_KIRKWOOD_SDIO,
388 .end = IRQ_KIRKWOOD_SDIO,
389 .flags = IORESOURCE_IRQ,
390 },
391};
392
393static u64 mvsdio_dmamask = 0xffffffffUL;
394
395static struct platform_device kirkwood_sdio = {
396 .name = "mvsdio",
397 .id = -1,
398 .dev = {
399 .dma_mask = &mvsdio_dmamask,
400 .coherent_dma_mask = 0xffffffff,
401 },
402 .num_resources = ARRAY_SIZE(mvsdio_resources),
403 .resource = mvsdio_resources,
404};
405
406void __init kirkwood_sdio_init(struct mvsdio_platform_data *mvsdio_data)
407{
408 u32 dev, rev;
409
410 kirkwood_pcie_id(&dev, &rev);
Saeed Bishara1e4d2d32010-06-01 18:09:27 +0300411 if (rev == 0 && dev != MV88F6282_DEV_ID) /* catch all Kirkwood Z0's */
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500412 mvsdio_data->clock = 100000000;
413 else
414 mvsdio_data->clock = 200000000;
415 mvsdio_data->dram = &kirkwood_mbus_dram_info;
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200416 kirkwood_clk_ctrl |= CGC_SDIO;
Nicolas Pitre8235ee02009-02-14 03:15:55 -0500417 kirkwood_sdio.dev.platform_data = mvsdio_data;
418 platform_device_register(&kirkwood_sdio);
419}
420
421
422/*****************************************************************************
Lennert Buytenhek18365d12008-08-09 15:38:18 +0200423 * SPI
424 ****************************************************************************/
425static struct orion_spi_info kirkwood_spi_plat_data = {
Lennert Buytenhek18365d12008-08-09 15:38:18 +0200426};
427
428static struct resource kirkwood_spi_resources[] = {
429 {
430 .start = SPI_PHYS_BASE,
431 .end = SPI_PHYS_BASE + SZ_512 - 1,
432 .flags = IORESOURCE_MEM,
433 },
434};
435
436static struct platform_device kirkwood_spi = {
437 .name = "orion_spi",
438 .id = 0,
439 .resource = kirkwood_spi_resources,
440 .dev = {
441 .platform_data = &kirkwood_spi_plat_data,
442 },
443 .num_resources = ARRAY_SIZE(kirkwood_spi_resources),
444};
445
446void __init kirkwood_spi_init()
447{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200448 kirkwood_clk_ctrl |= CGC_RUNIT;
Lennert Buytenhek18365d12008-08-09 15:38:18 +0200449 platform_device_register(&kirkwood_spi);
450}
451
452
453/*****************************************************************************
Martin Michlmayr6574e002009-03-23 19:13:21 +0100454 * I2C
455 ****************************************************************************/
456static struct mv64xxx_i2c_pdata kirkwood_i2c_pdata = {
457 .freq_m = 8, /* assumes 166 MHz TCLK */
458 .freq_n = 3,
459 .timeout = 1000, /* Default timeout of 1 second */
460};
461
462static struct resource kirkwood_i2c_resources[] = {
463 {
Martin Michlmayr6574e002009-03-23 19:13:21 +0100464 .start = I2C_PHYS_BASE,
465 .end = I2C_PHYS_BASE + 0x1f,
466 .flags = IORESOURCE_MEM,
467 }, {
Martin Michlmayr6574e002009-03-23 19:13:21 +0100468 .start = IRQ_KIRKWOOD_TWSI,
469 .end = IRQ_KIRKWOOD_TWSI,
470 .flags = IORESOURCE_IRQ,
471 },
472};
473
474static struct platform_device kirkwood_i2c = {
475 .name = MV64XXX_I2C_CTLR_NAME,
476 .id = 0,
477 .num_resources = ARRAY_SIZE(kirkwood_i2c_resources),
478 .resource = kirkwood_i2c_resources,
479 .dev = {
480 .platform_data = &kirkwood_i2c_pdata,
481 },
482};
483
484void __init kirkwood_i2c_init(void)
485{
486 platform_device_register(&kirkwood_i2c);
487}
488
489
490/*****************************************************************************
Saeed Bishara651c74c2008-06-22 22:45:06 +0200491 * UART0
492 ****************************************************************************/
493static struct plat_serial8250_port kirkwood_uart0_data[] = {
494 {
495 .mapbase = UART0_PHYS_BASE,
496 .membase = (char *)UART0_VIRT_BASE,
497 .irq = IRQ_KIRKWOOD_UART_0,
498 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
499 .iotype = UPIO_MEM,
500 .regshift = 2,
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200501 .uartclk = 0,
Saeed Bishara651c74c2008-06-22 22:45:06 +0200502 }, {
503 },
504};
505
506static struct resource kirkwood_uart0_resources[] = {
507 {
508 .start = UART0_PHYS_BASE,
509 .end = UART0_PHYS_BASE + 0xff,
510 .flags = IORESOURCE_MEM,
511 }, {
512 .start = IRQ_KIRKWOOD_UART_0,
513 .end = IRQ_KIRKWOOD_UART_0,
514 .flags = IORESOURCE_IRQ,
515 },
516};
517
518static struct platform_device kirkwood_uart0 = {
519 .name = "serial8250",
520 .id = 0,
521 .dev = {
522 .platform_data = kirkwood_uart0_data,
523 },
524 .resource = kirkwood_uart0_resources,
525 .num_resources = ARRAY_SIZE(kirkwood_uart0_resources),
526};
527
528void __init kirkwood_uart0_init(void)
529{
530 platform_device_register(&kirkwood_uart0);
531}
532
533
534/*****************************************************************************
535 * UART1
536 ****************************************************************************/
537static struct plat_serial8250_port kirkwood_uart1_data[] = {
538 {
539 .mapbase = UART1_PHYS_BASE,
540 .membase = (char *)UART1_VIRT_BASE,
541 .irq = IRQ_KIRKWOOD_UART_1,
542 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
543 .iotype = UPIO_MEM,
544 .regshift = 2,
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200545 .uartclk = 0,
Saeed Bishara651c74c2008-06-22 22:45:06 +0200546 }, {
547 },
548};
549
550static struct resource kirkwood_uart1_resources[] = {
551 {
552 .start = UART1_PHYS_BASE,
553 .end = UART1_PHYS_BASE + 0xff,
554 .flags = IORESOURCE_MEM,
555 }, {
556 .start = IRQ_KIRKWOOD_UART_1,
557 .end = IRQ_KIRKWOOD_UART_1,
558 .flags = IORESOURCE_IRQ,
559 },
560};
561
562static struct platform_device kirkwood_uart1 = {
563 .name = "serial8250",
564 .id = 1,
565 .dev = {
566 .platform_data = kirkwood_uart1_data,
567 },
568 .resource = kirkwood_uart1_resources,
569 .num_resources = ARRAY_SIZE(kirkwood_uart1_resources),
570};
571
572void __init kirkwood_uart1_init(void)
573{
574 platform_device_register(&kirkwood_uart1);
575}
576
577
578/*****************************************************************************
Nicolas Pitreae5c8c82009-06-03 15:24:36 -0400579 * Cryptographic Engines and Security Accelerator (CESA)
580 ****************************************************************************/
581
582static struct resource kirkwood_crypto_res[] = {
583 {
584 .name = "regs",
585 .start = CRYPTO_PHYS_BASE,
586 .end = CRYPTO_PHYS_BASE + 0xffff,
587 .flags = IORESOURCE_MEM,
588 }, {
589 .name = "sram",
590 .start = KIRKWOOD_SRAM_PHYS_BASE,
591 .end = KIRKWOOD_SRAM_PHYS_BASE + KIRKWOOD_SRAM_SIZE - 1,
592 .flags = IORESOURCE_MEM,
593 }, {
594 .name = "crypto interrupt",
595 .start = IRQ_KIRKWOOD_CRYPTO,
596 .end = IRQ_KIRKWOOD_CRYPTO,
597 .flags = IORESOURCE_IRQ,
598 },
599};
600
601static struct platform_device kirkwood_crypto_device = {
602 .name = "mv_crypto",
603 .id = -1,
604 .num_resources = ARRAY_SIZE(kirkwood_crypto_res),
605 .resource = kirkwood_crypto_res,
606};
607
608void __init kirkwood_crypto_init(void)
609{
610 kirkwood_clk_ctrl |= CGC_CRYPTO;
611 platform_device_register(&kirkwood_crypto_device);
612}
613
614
615/*****************************************************************************
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100616 * XOR
617 ****************************************************************************/
618static struct mv_xor_platform_shared_data kirkwood_xor_shared_data = {
619 .dram = &kirkwood_mbus_dram_info,
620};
621
Yang Hongyang284901a2009-04-06 19:01:15 -0700622static u64 kirkwood_xor_dmamask = DMA_BIT_MASK(32);
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100623
624
625/*****************************************************************************
626 * XOR0
627 ****************************************************************************/
628static struct resource kirkwood_xor0_shared_resources[] = {
629 {
630 .name = "xor 0 low",
631 .start = XOR0_PHYS_BASE,
632 .end = XOR0_PHYS_BASE + 0xff,
633 .flags = IORESOURCE_MEM,
634 }, {
635 .name = "xor 0 high",
636 .start = XOR0_HIGH_PHYS_BASE,
637 .end = XOR0_HIGH_PHYS_BASE + 0xff,
638 .flags = IORESOURCE_MEM,
639 },
640};
641
642static struct platform_device kirkwood_xor0_shared = {
643 .name = MV_XOR_SHARED_NAME,
644 .id = 0,
645 .dev = {
646 .platform_data = &kirkwood_xor_shared_data,
647 },
648 .num_resources = ARRAY_SIZE(kirkwood_xor0_shared_resources),
649 .resource = kirkwood_xor0_shared_resources,
650};
651
652static struct resource kirkwood_xor00_resources[] = {
653 [0] = {
654 .start = IRQ_KIRKWOOD_XOR_00,
655 .end = IRQ_KIRKWOOD_XOR_00,
656 .flags = IORESOURCE_IRQ,
657 },
658};
659
660static struct mv_xor_platform_data kirkwood_xor00_data = {
661 .shared = &kirkwood_xor0_shared,
662 .hw_id = 0,
663 .pool_size = PAGE_SIZE,
664};
665
666static struct platform_device kirkwood_xor00_channel = {
667 .name = MV_XOR_NAME,
668 .id = 0,
669 .num_resources = ARRAY_SIZE(kirkwood_xor00_resources),
670 .resource = kirkwood_xor00_resources,
671 .dev = {
672 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700673 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800674 .platform_data = &kirkwood_xor00_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100675 },
676};
677
678static struct resource kirkwood_xor01_resources[] = {
679 [0] = {
680 .start = IRQ_KIRKWOOD_XOR_01,
681 .end = IRQ_KIRKWOOD_XOR_01,
682 .flags = IORESOURCE_IRQ,
683 },
684};
685
686static struct mv_xor_platform_data kirkwood_xor01_data = {
687 .shared = &kirkwood_xor0_shared,
688 .hw_id = 1,
689 .pool_size = PAGE_SIZE,
690};
691
692static struct platform_device kirkwood_xor01_channel = {
693 .name = MV_XOR_NAME,
694 .id = 1,
695 .num_resources = ARRAY_SIZE(kirkwood_xor01_resources),
696 .resource = kirkwood_xor01_resources,
697 .dev = {
698 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700699 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800700 .platform_data = &kirkwood_xor01_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100701 },
702};
703
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500704static void __init kirkwood_xor0_init(void)
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100705{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200706 kirkwood_clk_ctrl |= CGC_XOR0;
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100707 platform_device_register(&kirkwood_xor0_shared);
708
709 /*
710 * two engines can't do memset simultaneously, this limitation
711 * satisfied by removing memset support from one of the engines.
712 */
713 dma_cap_set(DMA_MEMCPY, kirkwood_xor00_data.cap_mask);
714 dma_cap_set(DMA_XOR, kirkwood_xor00_data.cap_mask);
715 platform_device_register(&kirkwood_xor00_channel);
716
717 dma_cap_set(DMA_MEMCPY, kirkwood_xor01_data.cap_mask);
718 dma_cap_set(DMA_MEMSET, kirkwood_xor01_data.cap_mask);
719 dma_cap_set(DMA_XOR, kirkwood_xor01_data.cap_mask);
720 platform_device_register(&kirkwood_xor01_channel);
721}
722
723
724/*****************************************************************************
725 * XOR1
726 ****************************************************************************/
727static struct resource kirkwood_xor1_shared_resources[] = {
728 {
729 .name = "xor 1 low",
730 .start = XOR1_PHYS_BASE,
731 .end = XOR1_PHYS_BASE + 0xff,
732 .flags = IORESOURCE_MEM,
733 }, {
734 .name = "xor 1 high",
735 .start = XOR1_HIGH_PHYS_BASE,
736 .end = XOR1_HIGH_PHYS_BASE + 0xff,
737 .flags = IORESOURCE_MEM,
738 },
739};
740
741static struct platform_device kirkwood_xor1_shared = {
742 .name = MV_XOR_SHARED_NAME,
743 .id = 1,
744 .dev = {
745 .platform_data = &kirkwood_xor_shared_data,
746 },
747 .num_resources = ARRAY_SIZE(kirkwood_xor1_shared_resources),
748 .resource = kirkwood_xor1_shared_resources,
749};
750
751static struct resource kirkwood_xor10_resources[] = {
752 [0] = {
753 .start = IRQ_KIRKWOOD_XOR_10,
754 .end = IRQ_KIRKWOOD_XOR_10,
755 .flags = IORESOURCE_IRQ,
756 },
757};
758
759static struct mv_xor_platform_data kirkwood_xor10_data = {
760 .shared = &kirkwood_xor1_shared,
761 .hw_id = 0,
762 .pool_size = PAGE_SIZE,
763};
764
765static struct platform_device kirkwood_xor10_channel = {
766 .name = MV_XOR_NAME,
767 .id = 2,
768 .num_resources = ARRAY_SIZE(kirkwood_xor10_resources),
769 .resource = kirkwood_xor10_resources,
770 .dev = {
771 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700772 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800773 .platform_data = &kirkwood_xor10_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100774 },
775};
776
777static struct resource kirkwood_xor11_resources[] = {
778 [0] = {
779 .start = IRQ_KIRKWOOD_XOR_11,
780 .end = IRQ_KIRKWOOD_XOR_11,
781 .flags = IORESOURCE_IRQ,
782 },
783};
784
785static struct mv_xor_platform_data kirkwood_xor11_data = {
786 .shared = &kirkwood_xor1_shared,
787 .hw_id = 1,
788 .pool_size = PAGE_SIZE,
789};
790
791static struct platform_device kirkwood_xor11_channel = {
792 .name = MV_XOR_NAME,
793 .id = 3,
794 .num_resources = ARRAY_SIZE(kirkwood_xor11_resources),
795 .resource = kirkwood_xor11_resources,
796 .dev = {
797 .dma_mask = &kirkwood_xor_dmamask,
Yang Hongyang6a355282009-04-06 19:01:13 -0700798 .coherent_dma_mask = DMA_BIT_MASK(64),
H Hartley Sweeten3e3e65f2010-01-29 14:43:52 -0800799 .platform_data = &kirkwood_xor11_data,
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100800 },
801};
802
Nicolas Pitre5b99d532009-02-26 22:55:59 -0500803static void __init kirkwood_xor1_init(void)
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100804{
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +0200805 kirkwood_clk_ctrl |= CGC_XOR1;
Saeed Bishara09c0ed22008-06-23 04:26:07 -1100806 platform_device_register(&kirkwood_xor1_shared);
807
808 /*
809 * two engines can't do memset simultaneously, this limitation
810 * satisfied by removing memset support from one of the engines.
811 */
812 dma_cap_set(DMA_MEMCPY, kirkwood_xor10_data.cap_mask);
813 dma_cap_set(DMA_XOR, kirkwood_xor10_data.cap_mask);
814 platform_device_register(&kirkwood_xor10_channel);
815
816 dma_cap_set(DMA_MEMCPY, kirkwood_xor11_data.cap_mask);
817 dma_cap_set(DMA_MEMSET, kirkwood_xor11_data.cap_mask);
818 dma_cap_set(DMA_XOR, kirkwood_xor11_data.cap_mask);
819 platform_device_register(&kirkwood_xor11_channel);
820}
821
822
823/*****************************************************************************
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200824 * Watchdog
825 ****************************************************************************/
Nicolas Pitre3b937a72009-06-01 13:56:02 -0400826static struct orion_wdt_platform_data kirkwood_wdt_data = {
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200827 .tclk = 0,
828};
829
830static struct platform_device kirkwood_wdt_device = {
Nicolas Pitre3b937a72009-06-01 13:56:02 -0400831 .name = "orion_wdt",
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +0200832 .id = -1,
833 .dev = {
834 .platform_data = &kirkwood_wdt_data,
835 },
836 .num_resources = 0,
837};
838
839static void __init kirkwood_wdt_init(void)
840{
841 kirkwood_wdt_data.tclk = kirkwood_tclk;
842 platform_device_register(&kirkwood_wdt_device);
843}
844
845
846/*****************************************************************************
Saeed Bishara651c74c2008-06-22 22:45:06 +0200847 * Time handling
848 ****************************************************************************/
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200849int kirkwood_tclk;
850
851int __init kirkwood_find_tclk(void)
852{
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300853 u32 dev, rev;
854
855 kirkwood_pcie_id(&dev, &rev);
Saeed Bishara1e4d2d32010-06-01 18:09:27 +0300856
857 if ((dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 ||
858 rev == MV88F6281_REV_A1)) ||
859 (dev == MV88F6282_DEV_ID))
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300860 return 200000000;
861
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200862 return 166666667;
863}
864
Li Jie6de95c12009-11-05 07:29:54 -0800865static void __init kirkwood_timer_init(void)
Saeed Bishara651c74c2008-06-22 22:45:06 +0200866{
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200867 kirkwood_tclk = kirkwood_find_tclk();
868 orion_time_init(IRQ_KIRKWOOD_BRIDGE, kirkwood_tclk);
Saeed Bishara651c74c2008-06-22 22:45:06 +0200869}
870
871struct sys_timer kirkwood_timer = {
872 .init = kirkwood_timer_init,
873};
874
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200875/*****************************************************************************
876 * Audio
877 ****************************************************************************/
878static struct resource kirkwood_i2s_resources[] = {
879 [0] = {
880 .start = AUDIO_PHYS_BASE,
881 .end = AUDIO_PHYS_BASE + SZ_16K - 1,
882 .flags = IORESOURCE_MEM,
883 },
884 [1] = {
885 .start = IRQ_KIRKWOOD_I2S,
886 .end = IRQ_KIRKWOOD_I2S,
887 .flags = IORESOURCE_IRQ,
888 },
889};
890
891static struct kirkwood_asoc_platform_data kirkwood_i2s_data = {
892 .dram = &kirkwood_mbus_dram_info,
893 .burst = 128,
894};
895
896static struct platform_device kirkwood_i2s_device = {
897 .name = "kirkwood-i2s",
898 .id = -1,
899 .num_resources = ARRAY_SIZE(kirkwood_i2s_resources),
900 .resource = kirkwood_i2s_resources,
901 .dev = {
902 .platform_data = &kirkwood_i2s_data,
903 },
904};
905
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000906static struct platform_device kirkwood_pcm_device = {
Arnaud Patard (Rtp)c88e7b92010-08-30 16:00:05 +0200907 .name = "kirkwood-pcm-audio",
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000908 .id = -1,
909};
910
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200911void __init kirkwood_audio_init(void)
912{
913 kirkwood_clk_ctrl |= CGC_AUDIO;
914 platform_device_register(&kirkwood_i2s_device);
Liam Girdwoodf0fba2a2010-03-17 20:15:21 +0000915 platform_device_register(&kirkwood_pcm_device);
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200916}
Saeed Bishara651c74c2008-06-22 22:45:06 +0200917
918/*****************************************************************************
919 * General
920 ****************************************************************************/
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300921/*
922 * Identify device ID and revision.
923 */
Saeed Bishara651c74c2008-06-22 22:45:06 +0200924static char * __init kirkwood_id(void)
925{
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300926 u32 dev, rev;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200927
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300928 kirkwood_pcie_id(&dev, &rev);
929
930 if (dev == MV88F6281_DEV_ID) {
931 if (rev == MV88F6281_REV_Z0)
932 return "MV88F6281-Z0";
933 else if (rev == MV88F6281_REV_A0)
934 return "MV88F6281-A0";
Siddarth Goreaec1bad2009-06-09 14:41:02 +0530935 else if (rev == MV88F6281_REV_A1)
936 return "MV88F6281-A1";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300937 else
938 return "MV88F6281-Rev-Unsupported";
939 } else if (dev == MV88F6192_DEV_ID) {
940 if (rev == MV88F6192_REV_Z0)
941 return "MV88F6192-Z0";
942 else if (rev == MV88F6192_REV_A0)
943 return "MV88F6192-A0";
Saeed Bishara1c2003a2010-06-01 18:09:26 +0300944 else if (rev == MV88F6192_REV_A1)
945 return "MV88F6192-A1";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300946 else
947 return "MV88F6192-Rev-Unsupported";
948 } else if (dev == MV88F6180_DEV_ID) {
949 if (rev == MV88F6180_REV_A0)
950 return "MV88F6180-Rev-A0";
Saeed Bishara1c2003a2010-06-01 18:09:26 +0300951 else if (rev == MV88F6180_REV_A1)
952 return "MV88F6180-Rev-A1";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300953 else
954 return "MV88F6180-Rev-Unsupported";
Saeed Bishara1e4d2d32010-06-01 18:09:27 +0300955 } else if (dev == MV88F6282_DEV_ID) {
956 if (rev == MV88F6282_REV_A0)
957 return "MV88F6282-Rev-A0";
958 else
959 return "MV88F6282-Rev-Unsupported";
Ronen Shitritb2b3dc22008-09-15 10:40:35 +0300960 } else {
961 return "Device-Unknown";
962 }
Saeed Bishara651c74c2008-06-22 22:45:06 +0200963}
964
Ronen Shitrit4360bb42008-09-23 15:28:10 +0300965static void __init kirkwood_l2_init(void)
Saeed Bishara13387602008-06-23 01:05:08 -1100966{
Ronen Shitrit4360bb42008-09-23 15:28:10 +0300967#ifdef CONFIG_CACHE_FEROCEON_L2_WRITETHROUGH
968 writel(readl(L2_CONFIG_REG) | L2_WRITETHROUGH, L2_CONFIG_REG);
969 feroceon_l2_init(1);
970#else
971 writel(readl(L2_CONFIG_REG) & ~L2_WRITETHROUGH, L2_CONFIG_REG);
972 feroceon_l2_init(0);
973#endif
Saeed Bishara13387602008-06-23 01:05:08 -1100974}
975
Saeed Bishara651c74c2008-06-22 22:45:06 +0200976void __init kirkwood_init(void)
977{
978 printk(KERN_INFO "Kirkwood: %s, TCLK=%d.\n",
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200979 kirkwood_id(), kirkwood_tclk);
980 kirkwood_ge00_shared_data.t_clk = kirkwood_tclk;
Nicolas Pitre13731d12009-01-06 23:02:08 +0100981 kirkwood_ge01_shared_data.t_clk = kirkwood_tclk;
Ronen Shitrit79d4dd72008-09-15 00:56:38 +0200982 kirkwood_spi_plat_data.tclk = kirkwood_tclk;
983 kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
984 kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
apatard@mandriva.com49106c72010-05-31 13:49:12 +0200985 kirkwood_i2s_data.tclk = kirkwood_tclk;
Saeed Bishara651c74c2008-06-22 22:45:06 +0200986
Lennert Buytenhek2bf30102009-11-12 20:31:14 +0100987 /*
988 * Disable propagation of mbus errors to the CPU local bus,
989 * as this causes mbus errors (which can occur for example
990 * for PCI aborts) to throw CPU aborts, which we're not set
991 * up to deal with.
992 */
993 writel(readl(CPU_CONFIG) & ~CPU_CONFIG_ERROR_PROP, CPU_CONFIG);
994
Saeed Bishara651c74c2008-06-22 22:45:06 +0200995 kirkwood_setup_cpu_mbus();
996
997#ifdef CONFIG_CACHE_FEROCEON_L2
Ronen Shitrit4360bb42008-09-23 15:28:10 +0300998 kirkwood_l2_init();
Saeed Bishara651c74c2008-06-22 22:45:06 +0200999#endif
Nicolas Pitre5b99d532009-02-26 22:55:59 -05001000
1001 /* internal devices that every board has */
1002 kirkwood_rtc_init();
Thomas Reitmayr054bd3f02009-06-01 13:38:34 +02001003 kirkwood_wdt_init();
Nicolas Pitre5b99d532009-02-26 22:55:59 -05001004 kirkwood_xor0_init();
1005 kirkwood_xor1_init();
Nicolas Pitreae5c8c82009-06-03 15:24:36 -04001006 kirkwood_crypto_init();
Saeed Bishara651c74c2008-06-22 22:45:06 +02001007}
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +02001008
1009static int __init kirkwood_clock_gate(void)
1010{
1011 unsigned int curr = readl(CLOCK_GATING_CTRL);
Saeed Bisharaffd58bd2010-06-08 14:21:34 +03001012 u32 dev, rev;
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +02001013
Saeed Bisharaffd58bd2010-06-08 14:21:34 +03001014 kirkwood_pcie_id(&dev, &rev);
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +02001015 printk(KERN_DEBUG "Gating clock of unused units\n");
1016 printk(KERN_DEBUG "before: 0x%08x\n", curr);
1017
1018 /* Make sure those units are accessible */
Saeed Bisharaffd58bd2010-06-08 14:21:34 +03001019 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +02001020
1021 /* For SATA: first shutdown the phy */
1022 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
1023 /* Disable PLL and IVREF */
1024 writel(readl(SATA0_PHY_MODE_2) & ~0xf, SATA0_PHY_MODE_2);
1025 /* Disable PHY */
1026 writel(readl(SATA0_IF_CTRL) | 0x200, SATA0_IF_CTRL);
1027 }
1028 if (!(kirkwood_clk_ctrl & CGC_SATA1)) {
1029 /* Disable PLL and IVREF */
1030 writel(readl(SATA1_PHY_MODE_2) & ~0xf, SATA1_PHY_MODE_2);
1031 /* Disable PHY */
1032 writel(readl(SATA1_IF_CTRL) | 0x200, SATA1_IF_CTRL);
1033 }
1034
1035 /* For PCIe: first shutdown the phy */
1036 if (!(kirkwood_clk_ctrl & CGC_PEX0)) {
1037 writel(readl(PCIE_LINK_CTRL) | 0x10, PCIE_LINK_CTRL);
1038 while (1)
1039 if (readl(PCIE_STATUS) & 0x1)
1040 break;
1041 writel(readl(PCIE_LINK_CTRL) & ~0x10, PCIE_LINK_CTRL);
1042 }
1043
Saeed Bisharaffd58bd2010-06-08 14:21:34 +03001044 /* For PCIe 1: first shutdown the phy */
1045 if (dev == MV88F6282_DEV_ID) {
1046 if (!(kirkwood_clk_ctrl & CGC_PEX1)) {
1047 writel(readl(PCIE1_LINK_CTRL) | 0x10, PCIE1_LINK_CTRL);
1048 while (1)
1049 if (readl(PCIE1_STATUS) & 0x1)
1050 break;
1051 writel(readl(PCIE1_LINK_CTRL) & ~0x10, PCIE1_LINK_CTRL);
1052 }
1053 } else /* keep this bit set for devices that don't have PCIe1 */
1054 kirkwood_clk_ctrl |= CGC_PEX1;
1055
Rabeeh Khourye8b2b7b2009-03-22 17:30:32 +02001056 /* Now gate clock the required units */
1057 writel(kirkwood_clk_ctrl, CLOCK_GATING_CTRL);
1058 printk(KERN_DEBUG " after: 0x%08x\n", readl(CLOCK_GATING_CTRL));
1059
1060 return 0;
1061}
1062late_initcall(kirkwood_clock_gate);