ap91_dsa_chip.port_names[port] = (char *) name;
}
-void __init ap91_eth_init(u8 *mac_addr, const char *port_names[])
+void __init ap91_eth_init(const char *port_names[])
{
- if (mac_addr)
- ar71xx_set_mac_base(mac_addr);
-
if (port_names) {
int i;
#define AP91_ETH_NUM_PORT_NAMES 4
#if defined(CONFIG_AR71XX_DEV_AP91_ETH)
-void ap91_eth_init(u8 *mac_addr, const char *port_names[]) __init;
+void ap91_eth_init(const char *port_names[]) __init;
#else
-static inline void ap91_eth_init(u8 *mac_addr) { }
+static inline void ap91_eth_init(const char *port_names[]) { }
#endif
#endif /* _AR71XX_DEV_AP91_ETH_H */
#include "devices.h"
-static u8 ar71xx_mac_base[ETH_ALEN] __initdata;
+unsigned char ar71xx_mac_base[ETH_ALEN] __initdata;
static struct resource ar71xx_uart_resources[] = {
{
break;
}
- if (is_valid_ether_addr(ar71xx_mac_base)) {
- memcpy(pdata->mac_addr, ar71xx_mac_base, ETH_ALEN);
- pdata->mac_addr[5] += ar71xx_eth_instance;
- } else {
+ if (!is_valid_ether_addr(pdata->mac_addr)) {
random_ether_addr(pdata->mac_addr);
printk(KERN_DEBUG
"ar71xx: using random MAC address for eth%d\n",
return 1;
}
__setup("kmac=", ar71xx_kmac_setup);
+
+void __init ar71xx_init_mac(unsigned char *dst, const unsigned char *src,
+ unsigned offset)
+{
+ u32 t;
+
+ if (!is_valid_ether_addr(src)) {
+ memset(dst, '\0', ETH_ALEN);
+ return;
+ }
+
+ t = (((u32) src[3]) << 16) + (((u32) src[4]) << 8) + ((u32) src[5]);
+ t += offset;
+
+ dst[0] = src[0];
+ dst[1] = src[1];
+ dst[2] = src[2];
+ dst[3] = (t >> 16) & 0xff;
+ dst[4] = (t >> 8) & 0xff;
+ dst[5] = t & 0xff;
+}
struct spi_board_info const *info,
unsigned n) __init;
-void ar71xx_set_mac_base(unsigned char *mac) __init;
+extern unsigned char ar71xx_mac_base[] __initdata;
void ar71xx_parse_mac_addr(char *mac_str) __init;
+void ar71xx_init_mac(unsigned char *dst, const unsigned char *src,
+ unsigned offset) __init;
struct ar71xx_eth_pll_data {
u32 pll_10;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(eeprom);
ar71xx_add_device_mdio(0x0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = 0x10;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(eeprom);
-
ar71xx_add_device_mdio(0xfffffffe);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = 0x1;
ar71xx_add_device_eth(0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
u8 *mac = NULL;
if (nvram_parse_mac_addr(nvram, DIR_600_A1_NVRAM_SIZE,
- "lan_mac=", mac_buff) == 0)
+ "lan_mac=", mac_buff) == 0) {
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
mac = mac_buff;
+ }
ar71xx_add_device_m25p80(&dir_600_a1_flash_data);
ARRAY_SIZE(dir_600_a1_gpio_buttons),
dir_600_a1_gpio_buttons);
- ap91_eth_init(mac, NULL);
+ ap91_eth_init(NULL);
ap91_pci_init(ee, mac);
}
if (nvram_parse_mac_addr(config, DIR_615C1_CONFIG_SIZE,
"lan_mac=", mac) == 0) {
- ar71xx_set_mac_base(mac);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
wlan_mac = mac;
}
static void __init dir825b1_setup(void)
{
- u8 mac[6], i;
-
- memcpy(mac, (u8*)KSEG1ADDR(DIR825B1_MAC_LOCATION_1), 6);
- for(i = 5; i >= 3; i--)
- if(++mac[i] != 0x00) break;
-
- ar71xx_set_mac_base(mac);
+ u8 *mac = (u8 *) KSEG1ADDR(DIR825B1_MAC_LOCATION_1);
ar71xx_add_device_mdio(0x0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 1);
ar71xx_eth0_data.mii_bus_dev = &dir825b1_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 2);
ar71xx_eth1_data.mii_bus_dev = &dir825b1_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x10;
static void __init eap7660d_setup(void)
{
u8 *boardconfig = (u8 *) KSEG1ADDR(EAP7660D_BOARDCONFIG);
- ar71xx_set_mac_base(boardconfig + EAP7660D_GBIC_MAC_OFFSET);
+
ar71xx_add_device_mdio(~EAP7660D_PHYMASK);
+
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr,
+ boardconfig + EAP7660D_GBIC_MAC_OFFSET, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = EAP7660D_PHYMASK;
ar71xx_add_device_eth(0);
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(eeprom);
-
ar71xx_add_device_mdio(MZK_W04NU_MDIO_MASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = MZK_W04NU_WAN_PHYMASK;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(eeprom);
-
ar71xx_add_device_mdio(MZK_W300NH_MDIO_MASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = MZK_W300NH_WAN_PHYMASK;
/* last sector contains wlan calib data */
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(mac);
-
/* LAN Port */
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_data.mii_bus_dev = &nbg460n_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
/* WAN Port */
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
ar71xx_eth1_data.mii_bus_dev = &nbg460n_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = 0x10;
ar71xx_add_device_mdio(~PB42_MDIO_PHYMASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = PB42_WAN_PHYMASK;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.speed = SPEED_100;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
{
ar71xx_add_device_mdio(~PB44_MDIO_PHYMASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = PB44_WAN_PHYMASK;
ar71xx_add_device_eth(0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
{
u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
- ar71xx_set_mac_base(mac);
ar71xx_add_device_m25p80(&pb92_flash_data);
ar71xx_add_device_mdio(~0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(0xfffffffc);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x00000003;
ar71xx_add_device_mdio(~RB433_MDIO_PHYMASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = RB433_LAN_PHYMASK;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = RB433_WAN_PHYMASK;
ar71xx_add_device_mdio(~RB450_MDIO_PHYMASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth0_data.phy_if_mode = (gige) ? PHY_INTERFACE_MODE_RGMII : PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = RB450_LAN_PHYMASK;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth1_data.phy_if_mode = (gige) ? PHY_INTERFACE_MODE_RGMII : PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = RB450_WAN_PHYMASK;
ar71xx_add_device_mdio(0x3fffff00);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = 0x00000001;
#include <asm/mach-ar71xx/mach-rb750.h>
#include "machtype.h"
+#include "devices.h"
#include "dev-ap91-eth.h"
static struct rb750_led_data rb750_leds[] = {
AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
- ap91_eth_init(NULL, rb750_port_names);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
+ ap91_eth_init(rb750_port_names);
+
platform_device_register(&rb750_leds_device);
platform_device_register(&rb750_nand_device);
}
if (nvram_parse_mac_addr(config, TEW_632BRP_CONFIG_SIZE,
"lan_mac=", mac) == 0) {
- ar71xx_set_mac_base(mac);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
wlan_mac = mac;
}
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(mac);
-
/*
* ar71xx_eth0 would be the WAN port, but is not connected on
* the TL-WA901ND. ar71xx_eth1 connects to the internal switch chip,
* however we have a single LAN port only.
*/
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 0);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(mac);
-
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_data.mii_bus_dev = &tl_wr1043nd_rtl8366rb_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
tl_wr741nd_gpio_buttons);
ar71xx_eth1_data.has_ar7240_switch = 1;
- ar71xx_set_mac_base(mac);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
/* WAN port */
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
{
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
- ar71xx_set_mac_base(mac);
-
ar71xx_add_device_mdio(0x0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
u8 *mac = (u8 *) KSEG1ADDR(0x1f01fc00);
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(mac);
-
ar71xx_add_device_mdio(0x0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(~(UBNT_RS_WAN_PHYMASK | UBNT_RS_LAN_PHYMASK));
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = UBNT_RS_WAN_PHYMASK;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.speed = SPEED_100;
ar71xx_eth1_data.duplex = DUPLEX_FULL;
ar71xx_add_device_mdio(~(UBNT_RSPRO_WAN_PHYMASK | UBNT_RSPRO_LAN_PHYMASK));
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.phy_mask = UBNT_RSPRO_WAN_PHYMASK;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, ar71xx_mac_base, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth1_data.phy_mask = UBNT_RSPRO_LAN_PHYMASK;
ar71xx_eth1_data.speed = SPEED_1000;
ar71xx_add_device_mdio(~UBNT_LSSR71_PHY_MASK);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = UBNT_LSSR71_PHY_MASK;
u8 *mac = (u8 *) KSEG1ADDR(0x1fff0000);
u8 *ee = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(mac);
-
ar71xx_add_device_m25p80(NULL);
ar71xx_add_device_mdio(~0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- ar71xx_set_mac_base(art);
-
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, art, 0);
ar71xx_eth0_pll_data.pll_1000 = 0x11110000;
ar71xx_eth0_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, art, 1);
ar71xx_eth1_pll_data.pll_1000 = 0x11110000;
ar71xx_eth1_data.mii_bus_dev = &wndr3700_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
- ar71xx_set_mac_base(eeprom);
ar71xx_add_device_mdio(0x0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, eeprom, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
ar71xx_eth0_data.has_ar8216 = 1;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, eeprom, 1);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = 0x10;
ar71xx_add_device_mdio(0xfffffff7);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, ar71xx_mac_base, 0);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_MII;
ar71xx_eth0_data.phy_mask = 0x08;
ar71xx_eth0_data.reset_bit = RESET_MODULE_GE0_MAC |
u8 mac[6];
if (nvram_parse_mac_addr(nvram, WRT160NL_NVRAM_SIZE,
- "lan_hwaddr=", mac) == 0)
- ar71xx_set_mac_base(mac);
+ "lan_hwaddr=", mac) == 0) {
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
+ }
ar71xx_add_device_mdio(0x0);
static void __init wrt400n_setup(void)
{
u8 *art = (u8 *) KSEG1ADDR(0x1fff0000);
- u8 mac[6];
- int i;
-
- memcpy(mac, art + WRT400N_MAC_ADDR_OFFSET, 6);
- for (i = 5; i >= 3; i--)
- if (++mac[i] != 0x00) break;
-
- ar71xx_set_mac_base(mac);
+ u8 *mac = art + WRT400N_MAC_ADDR_OFFSET;
ar71xx_add_device_mdio(0x0);
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 1);
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth0_data.speed = SPEED_100;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 2);
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RMII;
ar71xx_eth1_data.phy_mask = 0x10;
static void __init wzrhpg300nh_setup(void)
{
u8 *eeprom = (u8 *) KSEG1ADDR(0x1fff1000);
+ u8 *mac = eeprom + WZRHPG300NH_MAC_OFFSET;
- ar71xx_set_mac_base(eeprom + WZRHPG300NH_MAC_OFFSET);
-
+ ar71xx_init_mac(ar71xx_eth0_data.mac_addr, mac, 0);
ar71xx_eth0_pll_data.pll_1000 = 0x1e000100;
ar71xx_eth0_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth0_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;
ar71xx_eth0_data.speed = SPEED_1000;
ar71xx_eth0_data.duplex = DUPLEX_FULL;
+ ar71xx_init_mac(ar71xx_eth1_data.mac_addr, mac, 1);
ar71xx_eth1_pll_data.pll_1000 = 0x1e000100;
ar71xx_eth1_data.mii_bus_dev = &wzrhpg300nh_rtl8366s_device.dev;
ar71xx_eth1_data.phy_if_mode = PHY_INTERFACE_MODE_RGMII;