ar71xx: move AP91 specific ethernet initialization into a separate file
[openwrt-10.03/.git] / target / linux / ar71xx / files / arch / mips / ar71xx / dev-ap91-eth.c
1 /*
2  *  Atheros AP91 reference board ethernet initialization
3  *
4  *  Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
5  *
6  *  This program is free software; you can redistribute it and/or modify it
7  *  under the terms of the GNU General Public License version 2 as published
8  *  by the Free Software Foundation.
9  */
10
11 #include "devices.h"
12
13 void __init ap91_eth_init(u8 *mac_addr)
14 {
15         if (mac_addr)
16                 ar71xx_set_mac_base(mac_addr);
17
18         /* WAN port */
19         ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
20         ar71xx_eth0_data.phy_mask = 0x0;
21         ar71xx_eth0_data.speed = SPEED_100;
22         ar71xx_eth0_data.duplex = DUPLEX_FULL;
23         ar71xx_eth0_data.fifo_cfg1 = 0x0fff0000;
24         ar71xx_eth0_data.fifo_cfg2 = 0x00001fff;
25         ar71xx_eth0_data.fifo_cfg3 = 0x008001ff;
26
27         /* LAN ports */
28         ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
29         ar71xx_eth1_data.phy_mask = 0x0;
30         ar71xx_eth1_data.speed = SPEED_1000;
31         ar71xx_eth1_data.duplex = DUPLEX_FULL;
32         ar71xx_eth1_data.fifo_cfg1 = 0x0fff0000;
33         ar71xx_eth1_data.fifo_cfg2 = 0x00001fff;
34         ar71xx_eth1_data.fifo_cfg3 = 0x008001ff;
35
36         ar71xx_add_device_mdio(0x0);
37         ar71xx_add_device_eth(1);
38         ar71xx_add_device_eth(0);
39 }