diff options
author | Sandeep Paulraj <s-paulraj@ti.com> | 2009-06-20 12:23:39 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-08-26 03:56:58 -0400 |
commit | 8ed0a9d4e7cfff439f95d08c882841f25a12bf54 (patch) | |
tree | c516207140f5d91b9e45863fd168622ed779dda9 /arch/arm/mach-davinci/dm365.c | |
parent | 9f5131538368b299aabcc790f1cece0439e65a5e (diff) |
davinci: dm365: EMAC support for SoC and dm365 EVM
The patch adds Support for EMAC in the DM365 SOC and
the DM365 EVM board.
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/dm365.c')
-rw-r--r-- | arch/arm/mach-davinci/dm365.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c index c9ae97a476a4..9d615db4463c 100644 --- a/arch/arm/mach-davinci/dm365.c +++ b/arch/arm/mach-davinci/dm365.c | |||
@@ -546,6 +546,52 @@ INT_CFG(DM365, INT_EMAC_MISCPULSE, 17, 1, 1, false) | |||
546 | #endif | 546 | #endif |
547 | }; | 547 | }; |
548 | 548 | ||
549 | static struct emac_platform_data dm365_emac_pdata = { | ||
550 | .ctrl_reg_offset = DM365_EMAC_CNTRL_OFFSET, | ||
551 | .ctrl_mod_reg_offset = DM365_EMAC_CNTRL_MOD_OFFSET, | ||
552 | .ctrl_ram_offset = DM365_EMAC_CNTRL_RAM_OFFSET, | ||
553 | .mdio_reg_offset = DM365_EMAC_MDIO_OFFSET, | ||
554 | .ctrl_ram_size = DM365_EMAC_CNTRL_RAM_SIZE, | ||
555 | .version = EMAC_VERSION_2, | ||
556 | }; | ||
557 | |||
558 | static struct resource dm365_emac_resources[] = { | ||
559 | { | ||
560 | .start = DM365_EMAC_BASE, | ||
561 | .end = DM365_EMAC_BASE + 0x47ff, | ||
562 | .flags = IORESOURCE_MEM, | ||
563 | }, | ||
564 | { | ||
565 | .start = IRQ_DM365_EMAC_RXTHRESH, | ||
566 | .end = IRQ_DM365_EMAC_RXTHRESH, | ||
567 | .flags = IORESOURCE_IRQ, | ||
568 | }, | ||
569 | { | ||
570 | .start = IRQ_DM365_EMAC_RXPULSE, | ||
571 | .end = IRQ_DM365_EMAC_RXPULSE, | ||
572 | .flags = IORESOURCE_IRQ, | ||
573 | }, | ||
574 | { | ||
575 | .start = IRQ_DM365_EMAC_TXPULSE, | ||
576 | .end = IRQ_DM365_EMAC_TXPULSE, | ||
577 | .flags = IORESOURCE_IRQ, | ||
578 | }, | ||
579 | { | ||
580 | .start = IRQ_DM365_EMAC_MISCPULSE, | ||
581 | .end = IRQ_DM365_EMAC_MISCPULSE, | ||
582 | .flags = IORESOURCE_IRQ, | ||
583 | }, | ||
584 | }; | ||
585 | |||
586 | static struct platform_device dm365_emac_device = { | ||
587 | .name = "davinci_emac", | ||
588 | .id = 1, | ||
589 | .dev = { | ||
590 | .platform_data = &dm365_emac_pdata, | ||
591 | }, | ||
592 | .num_resources = ARRAY_SIZE(dm365_emac_resources), | ||
593 | .resource = dm365_emac_resources, | ||
594 | }; | ||
549 | 595 | ||
550 | static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = { | 596 | static u8 dm365_default_priorities[DAVINCI_N_AINTC_IRQ] = { |
551 | [IRQ_VDINT0] = 2, | 597 | [IRQ_VDINT0] = 2, |
@@ -702,6 +748,7 @@ static struct davinci_soc_info davinci_soc_info_dm365 = { | |||
702 | .gpio_num = 104, | 748 | .gpio_num = 104, |
703 | .gpio_irq = 44, | 749 | .gpio_irq = 44, |
704 | .serial_dev = &dm365_serial_device, | 750 | .serial_dev = &dm365_serial_device, |
751 | .emac_pdata = &dm365_emac_pdata, | ||
705 | .sram_dma = 0x00010000, | 752 | .sram_dma = 0x00010000, |
706 | .sram_len = SZ_32K, | 753 | .sram_len = SZ_32K, |
707 | }; | 754 | }; |
@@ -710,3 +757,14 @@ void __init dm365_init(void) | |||
710 | { | 757 | { |
711 | davinci_common_init(&davinci_soc_info_dm365); | 758 | davinci_common_init(&davinci_soc_info_dm365); |
712 | } | 759 | } |
760 | |||
761 | static int __init dm365_init_devices(void) | ||
762 | { | ||
763 | if (!cpu_is_davinci_dm365()) | ||
764 | return 0; | ||
765 | |||
766 | platform_device_register(&dm365_emac_device); | ||
767 | |||
768 | return 0; | ||
769 | } | ||
770 | postcore_initcall(dm365_init_devices); | ||