aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/mach-at32ap
diff options
context:
space:
mode:
authorHaavard Skinnemoen <hskinnemoen@atmel.com>2006-10-30 03:23:12 -0500
committerHaavard Skinnemoen <hskinnemoen@atmel.com>2006-12-08 07:06:18 -0500
commitcfcb3a89d04144c064023bdc7d8dc600a88cc5c4 (patch)
tree306ab7a72c2bedccd476b225a8420292747b219f /arch/avr32/mach-at32ap
parentc3e2a79c0bd3e12b67ce5f11cab10951ae8b7f37 (diff)
[AVR32] Add macb1 platform_device
Add platform_device definition and pio init code for the second ethernet controller in AT32AP7000. Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32/mach-at32ap')
-rw-r--r--arch/avr32/mach-at32ap/at32ap7000.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c
index ada7930d5a4d..48f4ef38c70e 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -646,6 +646,15 @@ DEFINE_DEV_DATA(macb, 0);
646DEV_CLK(hclk, macb0, hsb, 8); 646DEV_CLK(hclk, macb0, hsb, 8);
647DEV_CLK(pclk, macb0, pbb, 6); 647DEV_CLK(pclk, macb0, pbb, 6);
648 648
649static struct eth_platform_data macb1_data;
650static struct resource macb1_resource[] = {
651 PBMEM(0xfff01c00),
652 IRQ(26),
653};
654DEFINE_DEV_DATA(macb, 1);
655DEV_CLK(hclk, macb1, hsb, 9);
656DEV_CLK(pclk, macb1, pbb, 7);
657
649struct platform_device *__init 658struct platform_device *__init
650at32_add_device_eth(unsigned int id, struct eth_platform_data *data) 659at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
651{ 660{
@@ -679,6 +688,33 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data)
679 } 688 }
680 break; 689 break;
681 690
691 case 1:
692 pdev = &macb1_device;
693
694 select_peripheral(PD(13), PERIPH_B, 0); /* TXD0 */
695 select_peripheral(PD(14), PERIPH_B, 0); /* TXD1 */
696 select_peripheral(PD(11), PERIPH_B, 0); /* TXEN */
697 select_peripheral(PD(12), PERIPH_B, 0); /* TXCK */
698 select_peripheral(PD(10), PERIPH_B, 0); /* RXD0 */
699 select_peripheral(PD(6), PERIPH_B, 0); /* RXD1 */
700 select_peripheral(PD(5), PERIPH_B, 0); /* RXER */
701 select_peripheral(PD(4), PERIPH_B, 0); /* RXDV */
702 select_peripheral(PD(3), PERIPH_B, 0); /* MDC */
703 select_peripheral(PD(2), PERIPH_B, 0); /* MDIO */
704
705 if (!data->is_rmii) {
706 select_peripheral(PC(19), PERIPH_B, 0); /* COL */
707 select_peripheral(PC(23), PERIPH_B, 0); /* CRS */
708 select_peripheral(PC(26), PERIPH_B, 0); /* TXER */
709 select_peripheral(PC(27), PERIPH_B, 0); /* TXD2 */
710 select_peripheral(PC(28), PERIPH_B, 0); /* TXD3 */
711 select_peripheral(PC(29), PERIPH_B, 0); /* RXD2 */
712 select_peripheral(PC(30), PERIPH_B, 0); /* RXD3 */
713 select_peripheral(PC(24), PERIPH_B, 0); /* RXCK */
714 select_peripheral(PD(15), PERIPH_B, 0); /* SPD */
715 }
716 break;
717
682 default: 718 default:
683 return NULL; 719 return NULL;
684 } 720 }
@@ -830,6 +866,8 @@ struct clk *at32_clock_list[] = {
830 &atmel_usart3_usart, 866 &atmel_usart3_usart,
831 &macb0_hclk, 867 &macb0_hclk,
832 &macb0_pclk, 868 &macb0_pclk,
869 &macb1_hclk,
870 &macb1_pclk,
833 &spi0_mck, 871 &spi0_mck,
834 &lcdc0_hclk, 872 &lcdc0_hclk,
835 &lcdc0_pixclk, 873 &lcdc0_pixclk,