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.
13 #include "dev-ap91-eth.h"
15 static struct dsa_chip_data ap91_dsa_chip
= {
16 .port_names
[0] = "cpu",
17 .port_names
[1] = "lan1",
18 .port_names
[2] = "lan2",
19 .port_names
[3] = "lan3",
20 .port_names
[4] = "lan4",
23 static struct dsa_platform_data ap91_dsa_data
= {
25 .chip
= &ap91_dsa_chip
,
28 static void ap91_eth_set_port_name(unsigned port
, const char *name
)
30 if (port
< 1 || port
> 5)
34 ap91_dsa_chip
.port_names
[port
] = (char *) name
;
37 void __init
ap91_eth_init(const char *port_names
[])
42 for (i
= 0; i
< AP91_ETH_NUM_PORT_NAMES
; i
++)
43 ap91_eth_set_port_name(i
+ 1, port_names
[i
]);
47 ar71xx_eth0_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
48 ar71xx_eth0_data
.speed
= SPEED_100
;
49 ar71xx_eth0_data
.duplex
= DUPLEX_FULL
;
52 ar71xx_eth1_data
.phy_if_mode
= PHY_INTERFACE_MODE_RMII
;
53 ar71xx_eth1_data
.speed
= SPEED_1000
;
54 ar71xx_eth1_data
.duplex
= DUPLEX_FULL
;
56 ar71xx_add_device_mdio(0x0);
57 ar71xx_add_device_eth(1);
58 ar71xx_add_device_eth(0);
60 ar71xx_add_device_dsa(1, &ap91_dsa_data
);