2 * Atheros AP91 reference board ethernet initialization
4 * Copyright (C) 2010 Gabor Juhos <juhosg@openwrt.org>
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.
14 static struct dsa_chip_data ap91_dsa_chip
= {
15 .port_names
[0] = "cpu",
16 .port_names
[1] = "lan1",
17 .port_names
[2] = "lan2",
18 .port_names
[3] = "lan3",
19 .port_names
[4] = "lan4",
22 static struct dsa_platform_data ap91_dsa_data
= {
24 .chip
= &ap91_dsa_chip
,
27 void __init
ap91_eth_init(u8
*mac_addr
)
30 ar71xx_set_mac_base(mac_addr
);
33 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
34 ar71xx_eth0_data
.phy_mask
= 0x0;
35 ar71xx_eth0_data
.speed
= SPEED_100
;
36 ar71xx_eth0_data
.duplex
= DUPLEX_FULL
;
37 ar71xx_eth0_data
.fifo_cfg1
= 0x0fff0000;
38 ar71xx_eth0_data
.fifo_cfg2
= 0x00001fff;
39 ar71xx_eth0_data
.fifo_cfg3
= 0x008001ff;
42 ar71xx_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
43 ar71xx_eth1_data
.phy_mask
= 0x0;
44 ar71xx_eth1_data
.speed
= SPEED_1000
;
45 ar71xx_eth1_data
.duplex
= DUPLEX_FULL
;
46 ar71xx_eth1_data
.fifo_cfg1
= 0x0fff0000;
47 ar71xx_eth1_data
.fifo_cfg2
= 0x00001fff;
48 ar71xx_eth1_data
.fifo_cfg3
= 0x008001ff;
50 ar71xx_add_device_mdio(0x0);
51 ar71xx_add_device_eth(1);
52 ar71xx_add_device_eth(0);
54 ar71xx_add_device_dsa(1, &ap91_dsa_data
);