11 #include <linux/kernel.h>
24 #include <mach/bridge-regs.h>
65 resources[0].
start = mapbase;
66 resources[0].
end = mapbase +
size;
71 resources[1].
start = irq;
72 resources[1].
end = irq;
79 static unsigned long __init uart_get_clk_rate(
struct clk *
clk)
81 clk_prepare_enable(clk);
85 static void __init uart_complete(
97 data->
uartclk = uart_get_clk_rate(clk);
98 orion_uart->
dev.platform_data =
data;
100 fill_resources(orion_uart, resources, mapbase, 0xff, irq);
116 static struct resource orion_uart0_resources[2];
119 .name =
"serial8250",
128 uart_complete(&orion_uart0, orion_uart0_data, orion_uart0_resources,
129 membase, mapbase, irq, clk);
144 static struct resource orion_uart1_resources[2];
147 .name =
"serial8250",
156 uart_complete(&orion_uart1, orion_uart1_data, orion_uart1_resources,
157 membase, mapbase, irq, clk);
172 static struct resource orion_uart2_resources[2];
175 .name =
"serial8250",
184 uart_complete(&orion_uart2, orion_uart2_data, orion_uart2_resources,
185 membase, mapbase, irq, clk);
200 static struct resource orion_uart3_resources[2];
203 .name =
"serial8250",
212 uart_complete(&orion_uart3, orion_uart3_data, orion_uart3_resources,
213 membase, mapbase, irq, clk);
219 static struct resource orion_rtc_resource[2];
224 orion_rtc_resource[0].start = mapbase;
225 orion_rtc_resource[0].end = mapbase +
SZ_32 - 1;
227 orion_rtc_resource[1].start = irq;
228 orion_rtc_resource[1].end = irq;
231 platform_device_register_simple(
"rtc-mv", -1, orion_rtc_resource, 2);
237 static __init void ge_complete(
239 struct resource *orion_ge_resource,
unsigned long irq,
244 orion_ge_resource->
start = irq;
245 orion_ge_resource->
end = irq;
246 eth_data->
shared = orion_ge_shared;
247 orion_ge->
dev.platform_data = eth_data;
258 static struct resource orion_ge00_shared_resources[] = {
262 .name =
"ge00 err irq",
274 static struct resource orion_ge00_resources[] = {
285 .resource = orion_ge00_resources,
292 unsigned long mapbase,
294 unsigned long irq_err,
295 unsigned int tx_csum_limit)
297 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
298 mapbase + 0x2000,
SZ_16K - 1, irq_err);
301 orion_ge00_resources, irq, &orion_ge00_shared,
302 eth_data, &orion_ge00);
309 .shared_smi = &orion_ge00_shared,
312 static struct resource orion_ge01_shared_resources[] = {
316 .name =
"ge01 err irq",
328 static struct resource orion_ge01_resources[] = {
339 .resource = orion_ge01_resources,
346 unsigned long mapbase,
348 unsigned long irq_err,
349 unsigned int tx_csum_limit)
351 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
352 mapbase + 0x2000,
SZ_16K - 1, irq_err);
354 ge_complete(&orion_ge01_shared_data,
355 orion_ge01_resources, irq, &orion_ge01_shared,
356 eth_data, &orion_ge01);
363 .shared_smi = &orion_ge00_shared,
366 static struct resource orion_ge10_shared_resources[] = {
370 .name =
"ge10 err irq",
382 static struct resource orion_ge10_resources[] = {
393 .resource = orion_ge10_resources,
400 unsigned long mapbase,
402 unsigned long irq_err)
404 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
405 mapbase + 0x2000,
SZ_16K - 1, irq_err);
406 ge_complete(&orion_ge10_shared_data,
407 orion_ge10_resources, irq, &orion_ge10_shared,
408 eth_data, &orion_ge10);
415 .shared_smi = &orion_ge00_shared,
418 static struct resource orion_ge11_shared_resources[] = {
422 .name =
"ge11 err irq",
434 static struct resource orion_ge11_resources[] = {
445 .resource = orion_ge11_resources,
452 unsigned long mapbase,
454 unsigned long irq_err)
456 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
457 mapbase + 0x2000,
SZ_16K - 1, irq_err);
458 ge_complete(&orion_ge11_shared_data,
459 orion_ge11_resources, irq, &orion_ge11_shared,
460 eth_data, &orion_ge11);
466 static struct resource orion_switch_resources[] = {
478 .resource = orion_switch_resources,
486 orion_switch_resources[0].
start = irq;
487 orion_switch_resources[0].
end = irq;
493 d->
chip[i].mii_bus = &orion_ge00_shared.
dev;
494 orion_switch_device.
dev.platform_data = d;
507 static struct resource orion_i2c_resources[2];
513 .platform_data = &orion_i2c_pdata,
522 static struct resource orion_i2c_1_resources[2];
528 .platform_data = &orion_i2c_1_pdata,
534 unsigned long freq_m)
536 orion_i2c_pdata.
freq_m = freq_m;
537 fill_resources(&orion_i2c, orion_i2c_resources, mapbase,
544 unsigned long freq_m)
546 orion_i2c_1_pdata.
freq_m = freq_m;
547 fill_resources(&orion_i2c_1, orion_i2c_1_resources, mapbase,
555 static struct resource orion_spi_resources;
562 static struct resource orion_spi_1_resources;
574 fill_resources(&orion_spi, &orion_spi_resources,
581 fill_resources(&orion_spi_1, &orion_spi_1_resources,
589 static struct resource orion_wdt_resource =
596 .resource = &orion_wdt_resource,
632 static struct resource orion_xor0_shared_resources[] = {
637 .name =
"xor 0 high",
645 .num_resources =
ARRAY_SIZE(orion_xor0_shared_resources),
646 .resource = orion_xor0_shared_resources,
649 static struct resource orion_xor00_resources[] = {
656 .shared = &orion_xor0_shared,
664 .num_resources =
ARRAY_SIZE(orion_xor00_resources),
665 .resource = orion_xor00_resources,
667 .dma_mask = &orion_xor_dmamask,
669 .platform_data = &orion_xor00_data,
673 static struct resource orion_xor01_resources[] = {
680 .shared = &orion_xor0_shared,
688 .num_resources =
ARRAY_SIZE(orion_xor01_resources),
689 .resource = orion_xor01_resources,
691 .dma_mask = &orion_xor_dmamask,
693 .platform_data = &orion_xor01_data,
698 unsigned long mapbase_high,
702 orion_xor0_shared_resources[0].
start = mapbase_low;
703 orion_xor0_shared_resources[0].
end = mapbase_low + 0xff;
704 orion_xor0_shared_resources[1].
start = mapbase_high;
705 orion_xor0_shared_resources[1].
end = mapbase_high + 0xff;
707 orion_xor00_resources[0].
start = irq_0;
708 orion_xor00_resources[0].
end = irq_0;
709 orion_xor01_resources[0].
start = irq_1;
710 orion_xor01_resources[0].
end = irq_1;
715 &orion_xor01_data, &orion_xor01_channel);
721 static struct resource orion_xor1_shared_resources[] = {
726 .name =
"xor 1 high",
734 .num_resources =
ARRAY_SIZE(orion_xor1_shared_resources),
735 .resource = orion_xor1_shared_resources,
738 static struct resource orion_xor10_resources[] = {
745 .shared = &orion_xor1_shared,
753 .num_resources =
ARRAY_SIZE(orion_xor10_resources),
754 .resource = orion_xor10_resources,
756 .dma_mask = &orion_xor_dmamask,
758 .platform_data = &orion_xor10_data,
762 static struct resource orion_xor11_resources[] = {
769 .shared = &orion_xor1_shared,
777 .num_resources =
ARRAY_SIZE(orion_xor11_resources),
778 .resource = orion_xor11_resources,
780 .dma_mask = &orion_xor_dmamask,
782 .platform_data = &orion_xor11_data,
787 unsigned long mapbase_high,
791 orion_xor1_shared_resources[0].
start = mapbase_low;
792 orion_xor1_shared_resources[0].
end = mapbase_low + 0xff;
793 orion_xor1_shared_resources[1].
start = mapbase_high;
794 orion_xor1_shared_resources[1].
end = mapbase_high + 0xff;
796 orion_xor10_resources[0].
start = irq_0;
797 orion_xor10_resources[0].
end = irq_0;
798 orion_xor11_resources[0].
start = irq_1;
799 orion_xor11_resources[0].
end = irq_1;
804 &orion_xor11_data, &orion_xor11_channel);
817 static struct resource orion_ehci_resources[2];
820 .name =
"orion-ehci",
823 .dma_mask = &ehci_dmamask,
834 fill_resources(&orion_ehci, orion_ehci_resources, mapbase,
SZ_4K - 1,
843 static struct resource orion_ehci_1_resources[2];
846 .name =
"orion-ehci",
849 .dma_mask = &ehci_dmamask,
858 fill_resources(&orion_ehci_1, orion_ehci_1_resources,
859 mapbase,
SZ_4K - 1, irq);
867 static struct resource orion_ehci_2_resources[2];
870 .name =
"orion-ehci",
873 .dma_mask = &ehci_dmamask,
882 fill_resources(&orion_ehci_2, orion_ehci_2_resources,
883 mapbase,
SZ_4K - 1, irq);
891 static struct resource orion_sata_resources[2] = {
908 unsigned long mapbase,
911 orion_sata.
dev.platform_data = sata_data;
912 fill_resources(&orion_sata, orion_sata_resources,
913 mapbase, 0x5000 - 1, irq);
921 static struct resource orion_crypto_resources[] = {
925 .name =
"crypto interrupt",
938 unsigned long srambase,
939 unsigned long sram_size,
942 fill_resources(&orion_crypto, orion_crypto_resources,
943 mapbase, 0xffff, irq);
945 orion_crypto_resources[2].
start = srambase;
946 orion_crypto_resources[2].
end = srambase + sram_size - 1;